Untitled

View as JSON View RAW
#include <stdio.h>
#include <string.h>

typedef struct {
    const char *wifi_name;
    const char *wifi_pass;
    const char *url;
    const char *include_line[10];
    const char *exclude_destinations[10];
} Config;
#include "config.h"

int main(void) {
    int number_of_configs = sizeof(configs) / sizeof(*configs);
    for (int i = 0; i < number_of_configs; ++i) {
        //if (configs[i].wifi_name) {
          printf("Wifi Name: %s\n", configs[i].wifi_name);
          printf("Exclude: %s\n", configs[i].exclude_destinations[0]);
        //}
    }
}


static Config configs[] = {
    {
        /* wifi_name             */ "foo",
        /* wifi_pass             */ "bar",
        /* url                   */ "1234",
        /* include_line          */ { "U4", "U5" },
        /* excxluce_destination  */ { "Moon", "Berlin" },
    },
    {
        /* wifi_name             */ "wifi_name",
        /* wifi_pass             */ "wifi_pas",
        /* url                   */ "1234",
        /* include_line          */ { "U9", "U1" },
        /* excxluce_destination  */ { "Ram", "Tam" },
    },
}