C   22

serv h

Guest on 10th May 2022 05:17:06 PM

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <sys/types.h>
  4. #include <time.h>
  5. #include <string.h>
  6.  
  7. #define HELO    0
  8. #define GET     1
  9. #define POST    2
  10. #define BLST    3
  11. #define BLTHR   4
  12.  
  13.  
  14. #define GREET "Hey, how's it going?\n"
  15. #define GRTSIZ 21
  16. #define POLITE "Polite people first say hello.\n"
  17. #define PLTSIZ 31
  18. #define PRTERR "You're talking rubbish, honey.\n"
  19. #define PRTSIZ 31
  20. #define REPLY "Nice to meet you.\n"
  21. #define RPLSIZ 18
  22. #define REPEAT "I'm not deaf, ya know.\n"
  23. #define RPTSIZ 23
  24. #define BYE "BCNU\n"
  25. #define BYESIZ 5
  26.  
  27. #define SERV_TCP_PORT 12755
  28.  
  29. #define SPOOLPATH "/users/04/info/ramanana/dbforum"
  30. #define PQCONN "host='clipper' dbname='ramanana'"
  31.  
  32.  
  33. #define LMXSIZ 1024 /* max line size */
  34.  
  35. struct msg {
  36.     int nngrp;
  37.     char **newsgrps;
  38.     char *subject;
  39.     char *from;
  40.     char *sender;
  41.     int nrefs;
  42.     char **refs;
  43.     time_t date;
  44.     char *body;
  45. };
  46.  
  47. int parse (char *str, char **t, int p, int n);

Raw Paste


Login or Register to edit or fork this paste. It's free.