Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this is perfectly readable, everything is compact, and different parts of the functionality
- of reading each config line is grouped column-wise
- ...
- else if (!strcmp("user", key)) { conf.user = remaining_line(fd); }
- else if (!strcmp("password", key)) { conf.password = remaining_line(fd); }
- else if (!strcmp("client_cert", key)) { conf.client_cert = remaining_line(fd); }
- else if (!strcmp("client_key", key)) { conf.client_key = remaining_line(fd); }
- else if (!strcmp("server_cert", key)) { conf.server_cert = remaining_line(fd); }
- else if (!strcmp("f_samp_Hz", key)) { conf.fsamp = read_integer(fd); }
- else if (!strcmp("f_bitrate_bps", key)) { conf.bps = read_integer(fd); }
- ...
- but oh no! lines too long (or imagine they are at least)!
- ...
- else if (!strcmp("user", key)) {
- conf.user = remaining_line(fd);
- }
- else if (!strcmp("password", key)) {
- conf.password = remaining_line(fd);
- }
- else if (!strcmp("client_cert", key)) {
- conf.client_cert = remaining_line(fd);
- }
- ...
- which is less compact and you can't get an as good overview, I've reformatted less than
- half of the config reading, and I'm already using more lines
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement