comparison src/accept.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 9d49dffc3070
children b27f66555ba8
comparison
equal deleted inserted replaced
365:934a223e4ee8 366:41958685480d
27 "ESMTP", 27 "ESMTP",
28 "(unknown)" /* should not happen, but better than crashing. */ 28 "(unknown)" /* should not happen, but better than crashing. */
29 }; 29 };
30 30
31 static gchar* 31 static gchar*
32 string_base62(gchar * res, guint value, gchar len) 32 string_base62(gchar *res, guint value, gchar len)
33 { 33 {
34 static gchar base62_chars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 34 static gchar base62_chars[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
35 gchar *p = res + len; 35 gchar *p = res + len;
36 *p = '\0'; 36 *p = '\0';
37 while (p > res) { 37 while (p > res) {
60 The -t option: With the ACC_RCPT_FROM_HEAD flag the addrs found found 60 The -t option: With the ACC_RCPT_FROM_HEAD flag the addrs found found
61 in To/Cc/Bcc headers are added to the recipient list. 61 in To/Cc/Bcc headers are added to the recipient list.
62 */ 62 */
63 63
64 accept_error 64 accept_error
65 accept_message_stream(FILE * in, message * msg, guint flags) 65 accept_message_stream(FILE *in, message *msg, guint flags)
66 { 66 {
67 gchar *line, *line1; 67 gchar *line, *line1;
68 int line_size = MAX_DATALINE; 68 int line_size = MAX_DATALINE;
69 gboolean in_headers = TRUE; 69 gboolean in_headers = TRUE;
70 header *hdr = NULL; 70 header *hdr = NULL;
129 } 129 }
130 130
131 if (line1[0] == ' ' || line1[0] == '\t') { 131 if (line1[0] == ' ' || line1[0] == '\t') {
132 /* continuation of 'folded' header: */ 132 /* continuation of 'folded' header: */
133 if (hdr) { 133 if (hdr) {
134 char* cp; 134 char *cp;
135 cp = g_strconcat(hdr->header, line1, NULL); 135 cp = g_strconcat(hdr->header, line1, NULL);
136 hdr->value = cp + (hdr->value - hdr->header); 136 hdr->value = cp + (hdr->value - hdr->header);
137 free(hdr->header); 137 free(hdr->header);
138 hdr->header = cp; 138 hdr->header = cp;
139 } 139 }
184 184
185 return AERR_OK; 185 return AERR_OK;
186 } 186 }
187 187
188 accept_error 188 accept_error
189 accept_message_prepare(message * msg, guint flags) 189 accept_message_prepare(message *msg, guint flags)
190 { 190 {
191 struct passwd *passwd = NULL; 191 struct passwd *passwd = NULL;
192 time_t rec_time = time(NULL); 192 time_t rec_time = time(NULL);
193 193
194 DEBUG(5) debugf("accept_message_prepare()\n"); 194 DEBUG(5) debugf("accept_message_prepare()\n");
397 397
398 return AERR_OK; 398 return AERR_OK;
399 } 399 }
400 400
401 accept_error 401 accept_error
402 accept_message(FILE * in, message * msg, guint flags) 402 accept_message(FILE *in, message *msg, guint flags)
403 { 403 {
404 accept_error err; 404 accept_error err;
405 405
406 err = accept_message_stream(in, msg, flags); 406 err = accept_message_stream(in, msg, flags);
407 if (err == AERR_OK) { 407 if (err == AERR_OK) {