Mercurial > masqmail
comparison src/readsock.c @ 366:41958685480d
Switched to `type *name' style
Andrew Koenig's ``C Traps and Pitfalls'' (Ch.2.1) convinced
me that it is best to go with the way C had been designed.
The ``declaration reflects use'' concept conflicts with a
``type* name'' notation. Hence I switched.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Thu, 22 Sep 2011 15:07:40 +0200 |
parents | 3654c502a4df |
children | b27f66555ba8 |
comparison
equal
deleted
inserted
replaced
365:934a223e4ee8 | 366:41958685480d |
---|---|
57 | 57 |
58 sigaction(SIGALRM, &old_sa_alrm, NULL); | 58 sigaction(SIGALRM, &old_sa_alrm, NULL); |
59 } | 59 } |
60 | 60 |
61 static void | 61 static void |
62 _read_chug(FILE * in) | 62 _read_chug(FILE *in) |
63 { | 63 { |
64 int c = 0; | 64 int c = 0; |
65 | 65 |
66 c = fgetc(in); | 66 c = fgetc(in); |
67 while (isspace(c) && (c != EOF)) | 67 while (isspace(c) && (c != EOF)) |
68 c = fgetc(in); | 68 c = fgetc(in); |
69 ungetc(c, in); | 69 ungetc(c, in); |
70 } | 70 } |
71 | 71 |
72 static int | 72 static int |
73 _read_line(FILE * in, char *buf, int buf_len, int timeout) | 73 _read_line(FILE *in, char *buf, int buf_len, int timeout) |
74 { | 74 { |
75 int p = 0; | 75 int p = 0; |
76 int c = 0; | 76 int c = 0; |
77 | 77 |
78 c = fgetc(in); | 78 c = fgetc(in); |
95 | 95 |
96 return p; | 96 return p; |
97 } | 97 } |
98 | 98 |
99 int | 99 int |
100 read_sockline(FILE * in, char *buf, int buf_len, int timeout, unsigned int flags) | 100 read_sockline(FILE *in, char *buf, int buf_len, int timeout, unsigned int flags) |
101 { | 101 { |
102 int p = 0; | 102 int p = 0; |
103 | 103 |
104 if (setjmp(jmp_timeout) != 0) { | 104 if (setjmp(jmp_timeout) != 0) { |
105 alarm_off(); | 105 alarm_off(); |
129 } | 129 } |
130 return p; | 130 return p; |
131 } | 131 } |
132 | 132 |
133 int | 133 int |
134 read_sockline1(FILE * in, char **pbuf, int *buf_len, int timeout, unsigned int flags) | 134 read_sockline1(FILE *in, char **pbuf, int *buf_len, int timeout, unsigned int flags) |
135 { | 135 { |
136 int p = 0, size = *buf_len; | 136 int p = 0, size = *buf_len; |
137 char *buf; | 137 char *buf; |
138 | 138 |
139 if (setjmp(jmp_timeout) != 0) { | 139 if (setjmp(jmp_timeout) != 0) { |