Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. this is perfectly readable, everything is compact, and different parts of the functionality
  2. of reading each config line is grouped column-wise
  3.  
  4. ...
  5. else if (!strcmp("user", key)) { conf.user = remaining_line(fd); }
  6. else if (!strcmp("password", key)) { conf.password = remaining_line(fd); }
  7. else if (!strcmp("client_cert", key)) { conf.client_cert = remaining_line(fd); }
  8. else if (!strcmp("client_key", key)) { conf.client_key = remaining_line(fd); }
  9. else if (!strcmp("server_cert", key)) { conf.server_cert = remaining_line(fd); }
  10. else if (!strcmp("f_samp_Hz", key)) { conf.fsamp = read_integer(fd); }
  11. else if (!strcmp("f_bitrate_bps", key)) { conf.bps = read_integer(fd); }
  12. ...
  13.  
  14. but oh no! lines too long (or imagine they are at least)!
  15.  
  16. ...
  17. else if (!strcmp("user", key)) {
  18. conf.user = remaining_line(fd);
  19. }
  20. else if (!strcmp("password", key)) {
  21. conf.password = remaining_line(fd);
  22. }
  23. else if (!strcmp("client_cert", key)) {
  24. conf.client_cert = remaining_line(fd);
  25. }
  26. ...
  27.  
  28. which is less compact and you can't get an as good overview, I've reformatted less than
  29. half of the config reading, and I'm already using more lines
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement