Commit a8e98469 a8e98469ab9c18ccd81b503611610f78f8eb4368 by Sergey Poznyakoff

Fixed indentation.

1 parent de692ff6
...@@ -37,25 +37,23 @@ ...@@ -37,25 +37,23 @@
37 37
38 #include <mailer0.h> 38 #include <mailer0.h>
39 39
40 static 40 static char *mailer_url_default;
41 char*
42 mailer_url_default;
43 41
44 /* FIXME: I'd like to check that the URL is valid, but that requires that the 42 /* FIXME: I'd like to check that the URL is valid, but that requires that the
45 mailers already be registered! */ 43 mailers already be registered! */
46 int 44 int
47 mailer_set_url_default(const char* url) 45 mailer_set_url_default (const char *url)
48 { 46 {
49 char* n = NULL; 47 char *n = NULL;
50 48
51 if(!url) 49 if (!url)
52 return EINVAL; 50 return EINVAL;
53 51
54 if((n = strdup(url)) == NULL) 52 if ((n = strdup (url)) == NULL)
55 return ENOMEM; 53 return ENOMEM;
56 54
57 if(mailer_url_default) 55 if (mailer_url_default)
58 free(mailer_url_default); 56 free (mailer_url_default);
59 57
60 mailer_url_default = n; 58 mailer_url_default = n;
61 59
...@@ -63,12 +61,12 @@ mailer_set_url_default(const char* url) ...@@ -63,12 +61,12 @@ mailer_set_url_default(const char* url)
63 } 61 }
64 62
65 int 63 int
66 mailer_get_url_default(const char** url) 64 mailer_get_url_default (const char **url)
67 { 65 {
68 if(!url) 66 if (!url)
69 return EINVAL; 67 return EINVAL;
70 68
71 if(mailer_url_default) 69 if (mailer_url_default)
72 *url = mailer_url_default; 70 *url = mailer_url_default;
73 else 71 else
74 *url = MAILER_URL_DEFAULT; 72 *url = MAILER_URL_DEFAULT;
...@@ -153,7 +151,7 @@ mailer_create (mailer_t * pmailer, const char *name) ...@@ -153,7 +151,7 @@ mailer_create (mailer_t * pmailer, const char *name)
153 } 151 }
154 152
155 void 153 void
156 mailer_destroy (mailer_t *pmailer) 154 mailer_destroy (mailer_t * pmailer)
157 { 155 {
158 if (pmailer && *pmailer) 156 if (pmailer && *pmailer)
159 { 157 {
...@@ -216,45 +214,45 @@ mailer_close (mailer_t mailer) ...@@ -216,45 +214,45 @@ mailer_close (mailer_t mailer)
216 214
217 215
218 int 216 int
219 mailer_check_from(address_t from) 217 mailer_check_from (address_t from)
220 { 218 {
221 size_t n = 0; 219 size_t n = 0;
222 220
223 if(!from) 221 if (!from)
224 return EINVAL; 222 return EINVAL;
225 223
226 if(address_get_count(from, &n) || n != 1) 224 if (address_get_count (from, &n) || n != 1)
227 return MU_ERR_MAILER_BAD_FROM; 225 return MU_ERR_MAILER_BAD_FROM;
228 226
229 if(address_get_email_count(from, &n) || n == 0) 227 if (address_get_email_count (from, &n) || n == 0)
230 return MU_ERR_MAILER_BAD_FROM; 228 return MU_ERR_MAILER_BAD_FROM;
231 229
232 return 0; 230 return 0;
233 } 231 }
234 232
235 int 233 int
236 mailer_check_to(address_t to) 234 mailer_check_to (address_t to)
237 { 235 {
238 size_t count = 0; 236 size_t count = 0;
239 size_t emails = 0; 237 size_t emails = 0;
240 size_t groups = 0; 238 size_t groups = 0;
241 239
242 if(!to) 240 if (!to)
243 return EINVAL; 241 return EINVAL;
244 242
245 if(address_get_count(to, &count)) 243 if (address_get_count (to, &count))
246 return MU_ERR_MAILER_BAD_TO; 244 return MU_ERR_MAILER_BAD_TO;
247 245
248 if(address_get_email_count(to, &emails)) 246 if (address_get_email_count (to, &emails))
249 return MU_ERR_MAILER_BAD_TO; 247 return MU_ERR_MAILER_BAD_TO;
250 248
251 if(emails == 0) 249 if (emails == 0)
252 return MU_ERR_MAILER_NO_RCPT_TO; 250 return MU_ERR_MAILER_NO_RCPT_TO;
253 251
254 if(address_get_group_count(to, &groups)) 252 if (address_get_group_count (to, &groups))
255 return MU_ERR_MAILER_BAD_TO; 253 return MU_ERR_MAILER_BAD_TO;
256 254
257 if(count - emails - groups != 0) 255 if (count - emails - groups != 0)
258 /* then not everything is a group or an email address */ 256 /* then not everything is a group or an email address */
259 return MU_ERR_MAILER_BAD_TO; 257 return MU_ERR_MAILER_BAD_TO;
260 258
...@@ -298,7 +296,7 @@ mailer_set_stream (mailer_t mailer, stream_t stream) ...@@ -298,7 +296,7 @@ mailer_set_stream (mailer_t mailer, stream_t stream)
298 } 296 }
299 297
300 int 298 int
301 mailer_get_stream (mailer_t mailer, stream_t *pstream) 299 mailer_get_stream (mailer_t mailer, stream_t * pstream)
302 { 300 {
303 if (mailer == NULL || pstream == NULL) 301 if (mailer == NULL || pstream == NULL)
304 return EINVAL; 302 return EINVAL;
...@@ -308,7 +306,7 @@ mailer_get_stream (mailer_t mailer, stream_t *pstream) ...@@ -308,7 +306,7 @@ mailer_get_stream (mailer_t mailer, stream_t *pstream)
308 } 306 }
309 307
310 int 308 int
311 mailer_get_observable (mailer_t mailer, observable_t *pobservable) 309 mailer_get_observable (mailer_t mailer, observable_t * pobservable)
312 { 310 {
313 /* FIXME: I should check for invalid types */ 311 /* FIXME: I should check for invalid types */
314 if (mailer == NULL || pobservable == NULL) 312 if (mailer == NULL || pobservable == NULL)
...@@ -325,7 +323,7 @@ mailer_get_observable (mailer_t mailer, observable_t *pobservable) ...@@ -325,7 +323,7 @@ mailer_get_observable (mailer_t mailer, observable_t *pobservable)
325 } 323 }
326 324
327 int 325 int
328 mailer_get_property (mailer_t mailer, property_t *pproperty) 326 mailer_get_property (mailer_t mailer, property_t * pproperty)
329 { 327 {
330 if (mailer == NULL || pproperty == NULL) 328 if (mailer == NULL || pproperty == NULL)
331 return EINVAL; 329 return EINVAL;
...@@ -350,7 +348,7 @@ mailer_set_debug (mailer_t mailer, mu_debug_t debug) ...@@ -350,7 +348,7 @@ mailer_set_debug (mailer_t mailer, mu_debug_t debug)
350 } 348 }
351 349
352 int 350 int
353 mailer_get_debug (mailer_t mailer, mu_debug_t *pdebug) 351 mailer_get_debug (mailer_t mailer, mu_debug_t * pdebug)
354 { 352 {
355 if (mailer == NULL || pdebug == NULL) 353 if (mailer == NULL || pdebug == NULL)
356 return EINVAL; 354 return EINVAL;
...@@ -365,7 +363,7 @@ mailer_get_debug (mailer_t mailer, mu_debug_t *pdebug) ...@@ -365,7 +363,7 @@ mailer_get_debug (mailer_t mailer, mu_debug_t *pdebug)
365 } 363 }
366 364
367 int 365 int
368 mailer_get_url (mailer_t mailer, url_t *purl) 366 mailer_get_url (mailer_t mailer, url_t * purl)
369 { 367 {
370 if (!mailer || !purl) 368 if (!mailer || !purl)
371 return EINVAL; 369 return EINVAL;
......