comparison src/masqmail.h @ 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 f4ba4ed28848
children b27f66555ba8
comparison
equal deleted inserted replaced
365:934a223e4ee8 366:41958685480d
331 331
332 message *msg; 332 message *msg;
333 } smtp_connection; 333 } smtp_connection;
334 334
335 /* alias.c*/ 335 /* alias.c*/
336 gboolean addr_is_local(address * addr); 336 gboolean addr_is_local(address *addr);
337 GList *alias_expand(GList * alias_table, GList * rcpt_list, GList * non_rcpt_list); 337 GList *alias_expand(GList *alias_table, GList *rcpt_list, GList *non_rcpt_list);
338 338
339 /* child.c */ 339 /* child.c */
340 int child(const char *command); 340 int child(const char *command);
341 341
342 /* conf.c */ 342 /* conf.c */
343 void init_conf(); 343 void init_conf();
344 gboolean read_conf(gchar * filename); 344 gboolean read_conf(gchar *filename);
345 connect_route *read_route(gchar * filename, gboolean is_perma); 345 connect_route *read_route(gchar *filename, gboolean is_perma);
346 GList *read_route_list(GList * rf_list, gboolean is_perma); 346 GList *read_route_list(GList *rf_list, gboolean is_perma);
347 void destroy_route(connect_route * r); 347 void destroy_route(connect_route *r);
348 void destroy_route_list(GList * list); 348 void destroy_route_list(GList *list);
349 349
350 /* expand.c */ 350 /* expand.c */
351 GList *var_table_rcpt(GList * var_table, address * rcpt); 351 GList *var_table_rcpt(GList *var_table, address *rcpt);
352 GList *var_table_msg(GList * var_table, message * msg); 352 GList *var_table_msg(GList *var_table, message *msg);
353 GList *var_table_conf(GList * var_table); 353 GList *var_table_conf(GList *var_table);
354 gint expand(GList * var_list, gchar * format, gchar * result, gint result_len); 354 gint expand(GList *var_list, gchar *format, gchar *result, gint result_len);
355 355
356 /* message.c */ 356 /* message.c */
357 message *create_message(void); 357 message *create_message(void);
358 void destroy_message(message * msg); 358 void destroy_message(message *msg);
359 void destroy_msg_list(GList * msg_list); 359 void destroy_msg_list(GList *msg_list);
360 void msg_free_data(message * msg); 360 void msg_free_data(message *msg);
361 gint msg_calc_size(message * msg, gboolean is_smtp); 361 gint msg_calc_size(message *msg, gboolean is_smtp);
362 362
363 msg_out *create_msg_out(message * msg); 363 msg_out *create_msg_out(message *msg);
364 msg_out *clone_msg_out(msg_out * msgout_orig); 364 msg_out *clone_msg_out(msg_out *msgout_orig);
365 void destroy_msg_out(msg_out * msgout); 365 void destroy_msg_out(msg_out *msgout);
366 void destroy_msg_out_list(GList * msgout_list); 366 void destroy_msg_out_list(GList *msgout_list);
367 367
368 /* address.c */ 368 /* address.c */
369 address *create_address(gchar * path, gboolean is_rfc821); 369 address *create_address(gchar *path, gboolean is_rfc821);
370 address *create_address_qualified(gchar * path, gboolean is_rfc821, gchar * domain); 370 address *create_address_qualified(gchar *path, gboolean is_rfc821, gchar *domain);
371 address *create_address_pipe(gchar * path); 371 address *create_address_pipe(gchar *path);
372 void destroy_address(address * addr); 372 void destroy_address(address *addr);
373 address *copy_modify_address(const address * orig, gchar * l_part, gchar * dom); 373 address *copy_modify_address(const address *orig, gchar *l_part, gchar *dom);
374 #define copy_address(addr) copy_modify_address(addr, NULL, NULL) 374 #define copy_address(addr) copy_modify_address(addr, NULL, NULL)
375 gboolean addr_isequal(address * addr1, address * addr2, int (*cmpfunc) (const char*, const char*)); 375 gboolean addr_isequal(address *addr1, address *addr2, int (*cmpfunc) (const char*, const char*));
376 gboolean addr_isequal_parent(address * addr1, address * addr2, int (*cmpfunc) (const char*, const char*)); 376 gboolean addr_isequal_parent(address *addr1, address *addr2, int (*cmpfunc) (const char*, const char*));
377 address *addr_find_ancestor(address * addr); 377 address *addr_find_ancestor(address *addr);
378 gboolean addr_is_delivered_children(address * addr); 378 gboolean addr_is_delivered_children(address *addr);
379 gboolean addr_is_finished_children(address * addr); 379 gboolean addr_is_finished_children(address *addr);
380 gchar *addr_string(address * addr); 380 gchar *addr_string(address *addr);
381 381
382 /* accept.c */ 382 /* accept.c */
383 accept_error accept_message(FILE * in, message * msg, guint flags); 383 accept_error accept_message(FILE *in, message *msg, guint flags);
384 accept_error accept_message_prepare(message * msg, guint flags); 384 accept_error accept_message_prepare(message *msg, guint flags);
385 385
386 /* header.c */ 386 /* header.c */
387 gchar *rec_timestamp(); 387 gchar *rec_timestamp();
388 GList *find_header(GList * hdr_list, header_id id, gchar * hdr_str); 388 GList *find_header(GList *hdr_list, header_id id, gchar *hdr_str);
389 void header_unfold(header * hdr); 389 void header_unfold(header *hdr);
390 void header_fold(header * hdr, unsigned int maxlen); 390 void header_fold(header *hdr, unsigned int maxlen);
391 header *create_header(header_id id, gchar * fmt, ...); 391 header *create_header(header_id id, gchar *fmt, ...);
392 void destroy_header(header * hdr); 392 void destroy_header(header *hdr);
393 header *copy_header(header * hdr); 393 header *copy_header(header *hdr);
394 header *get_header(gchar * line); 394 header *get_header(gchar *line);
395 395
396 /* smtp_in.c */ 396 /* smtp_in.c */
397 void smtp_in(FILE * in, FILE * out, gchar * remote_host, gchar * ident); 397 void smtp_in(FILE *in, FILE *out, gchar *remote_host, gchar *ident);
398 398
399 /* listen.c */ 399 /* listen.c */
400 void listen_port(GList * addr_list, gint qival, char *argv[]); 400 void listen_port(GList *addr_list, gint qival, char *argv[]);
401 401
402 /* parse.c */ 402 /* parse.c */
403 gboolean split_address(const gchar * path, gchar ** local_part, gchar ** domain, gboolean is_rfc821); 403 gboolean split_address(const gchar *path, gchar **local_part, gchar **domain, gboolean is_rfc821);
404 gboolean parse_address_rfc822(gchar * string, gchar ** local_begin, gchar ** local_end, gchar ** domain_begin, gchar ** domain_end, gchar ** address_end); 404 gboolean parse_address_rfc822(gchar *string, gchar **local_begin, gchar **local_end, gchar **domain_begin, gchar **domain_end, gchar **address_end);
405 gboolean parse_address_rfc821(gchar * string, gchar ** local_begin, gchar ** local_end, gchar ** domain_begin, gchar ** domain_end, gchar ** address_end); 405 gboolean parse_address_rfc821(gchar *string, gchar **local_begin, gchar **local_end, gchar **domain_begin, gchar **domain_end, gchar **address_end);
406 address *_create_address(gchar * string, gchar ** end, gboolean is_rfc821); 406 address *_create_address(gchar *string, gchar **end, gboolean is_rfc821);
407 address *create_address_rfc821(gchar * string, gchar ** end); 407 address *create_address_rfc821(gchar *string, gchar **end);
408 address *create_address_rfc822(gchar * string, gchar ** end); 408 address *create_address_rfc822(gchar *string, gchar **end);
409 GList *addr_list_append_rfc822(GList * addr_list, gchar * string, gchar * domain); 409 GList *addr_list_append_rfc822(GList *addr_list, gchar *string, gchar *domain);
410 410
411 /* connect.c */ 411 /* connect.c */
412 mxip_addr *connect_hostlist(int *psockfd, gchar * host, guint port, GList * addr_list); 412 mxip_addr *connect_hostlist(int *psockfd, gchar *host, guint port, GList *addr_list);
413 mxip_addr *connect_resolvelist(int *psockfd, gchar * host, guint port, GList * res_funcs); 413 mxip_addr *connect_resolvelist(int *psockfd, gchar *host, guint port, GList *res_funcs);
414 414
415 /* deliver.c */ 415 /* deliver.c */
416 void msg_rcptlist_local(GList * rcpt_list, GList **, GList **); 416 void msg_rcptlist_local(GList *rcpt_list, GList **, GList **);
417 gboolean deliver_local(msg_out * msgout); 417 gboolean deliver_local(msg_out *msgout);
418 gboolean deliver_msglist_host(connect_route * route, GList * msg_list, gchar * host, GList * res_list); 418 gboolean deliver_msglist_host(connect_route *route, GList *msg_list, gchar *host, GList *res_list);
419 gboolean deliver_route_msgout_list(connect_route * route, GList * msgout_list); 419 gboolean deliver_route_msgout_list(connect_route *route, GList *msgout_list);
420 gboolean deliver_route_msg_list(connect_route * route, GList * msgout_list); 420 gboolean deliver_route_msg_list(connect_route *route, GList *msgout_list);
421 gboolean deliver_finish(msg_out * msgout); 421 gboolean deliver_finish(msg_out *msgout);
422 gboolean deliver_msg_list(GList * msg_list, guint flags); 422 gboolean deliver_msg_list(GList *msg_list, guint flags);
423 gboolean deliver(message * msg); 423 gboolean deliver(message *msg);
424 424
425 /* fail_msg.c */ 425 /* fail_msg.c */
426 gboolean fail_msg(message * msg, gchar * template, GList * failed_rcpts, gchar * err_fmt, va_list args); 426 gboolean fail_msg(message *msg, gchar *template, GList *failed_rcpts, gchar *err_fmt, va_list args);
427 gboolean warn_msg(message * msg, gchar * template, GList * failed_rcpts, gchar * err_fmt, va_list args); 427 gboolean warn_msg(message *msg, gchar *template, GList *failed_rcpts, gchar *err_fmt, va_list args);
428 428
429 /* interface.c */ 429 /* interface.c */
430 gboolean init_sockaddr(struct sockaddr_in *name, interface * iface); 430 gboolean init_sockaddr(struct sockaddr_in *name, interface *iface);
431 int make_server_socket(interface * iface); 431 int make_server_socket(interface *iface);
432 432
433 /* local.c */ 433 /* local.c */
434 gboolean append_file(message * msg, GList * hdr_list, gchar * user); 434 gboolean append_file(message *msg, GList *hdr_list, gchar *user);
435 gboolean pipe_out(message * msg, GList * hdr_list, address * rcpt, gchar * cmd, guint flags); 435 gboolean pipe_out(message *msg, GList *hdr_list, address *rcpt, gchar *cmd, guint flags);
436 436
437 /* log.c */ 437 /* log.c */
438 gchar *ext_strerror(int err); 438 gchar *ext_strerror(int err);
439 gboolean logopen(void); 439 gboolean logopen(void);
440 void logclose(void); 440 void logclose(void);
443 void debugf(const char *fmt, ...); 443 void debugf(const char *fmt, ...);
444 void vdebugf(const char *fmt, va_list args); 444 void vdebugf(const char *fmt, va_list args);
445 void maillog(const char *fmt, ...); 445 void maillog(const char *fmt, ...);
446 446
447 /* spool.c */ 447 /* spool.c */
448 gboolean spool_read_data(message * msg); 448 gboolean spool_read_data(message *msg);
449 message *msg_spool_read(gchar * uid); 449 message *msg_spool_read(gchar *uid);
450 gboolean spool_write(message * msg, gboolean do_writedata); 450 gboolean spool_write(message *msg, gboolean do_writedata);
451 gboolean spool_lock(gchar * uid); 451 gboolean spool_lock(gchar *uid);
452 gboolean spool_unlock(gchar * uid); 452 gboolean spool_unlock(gchar *uid);
453 gboolean spool_delete_all(message * msg); 453 gboolean spool_delete_all(message *msg);
454 454
455 /* queue.c */ 455 /* queue.c */
456 GList *read_queue(void); 456 GList *read_queue(void);
457 gboolean queue_run(void); 457 gboolean queue_run(void);
458 gboolean queue_run_online(void); 458 gboolean queue_run_online(void);
459 void queue_list(void); 459 void queue_list(void);
460 gboolean queue_delete(gchar * uid); 460 gboolean queue_delete(gchar *uid);
461 461
462 /* online.c */ 462 /* online.c */
463 gchar *online_query(); 463 gchar *online_query();
464 464
465 /* permissions.c */ 465 /* permissions.c */
466 gboolean is_ingroup(uid_t uid, gid_t gid); 466 gboolean is_ingroup(uid_t uid, gid_t gid);
467 void set_euidgid(gint uid, gint gid, uid_t * old_uid, gid_t * old_gid); 467 void set_euidgid(gint uid, gint gid, uid_t *old_uid, gid_t *old_gid);
468 void set_identity(uid_t old_uid, gchar * task_name); 468 void set_identity(uid_t old_uid, gchar *task_name);
469 469
470 /* rewrite.c */ 470 /* rewrite.c */
471 gboolean set_address_header_domain(header * hdr, gchar * domain); 471 gboolean set_address_header_domain(header *hdr, gchar *domain);
472 gboolean map_address_header(header * hdr, GList * table); 472 gboolean map_address_header(header *hdr, GList *table);
473 473
474 /* route.c */ 474 /* route.c */
475 msgout_perhost *create_msgout_perhost(gchar * host); 475 msgout_perhost *create_msgout_perhost(gchar *host);
476 void destroy_msgout_perhost(msgout_perhost * mo_ph); 476 void destroy_msgout_perhost(msgout_perhost *mo_ph);
477 void rewrite_headers(msg_out * msgout, connect_route * route); 477 void rewrite_headers(msg_out *msgout, connect_route *route);
478 void split_rcpts(GList* rcpt_list, GList* localnets, GList** rl_local, GList** rl_localnet, GList** rl_others); 478 void split_rcpts(GList *rcpt_list, GList *localnets, GList **rl_local, GList **rl_localnet, GList **rl_others);
479 GList* local_rcpts(GList* rcpt_list); 479 GList *local_rcpts(GList *rcpt_list);
480 GList* remote_rcpts(GList* rcpt_list); 480 GList *remote_rcpts(GList *rcpt_list);
481 gboolean route_strip_msgout(connect_route * route, msg_out * msgout); 481 gboolean route_strip_msgout(connect_route *route, msg_out *msgout);
482 msg_out *route_prepare_msgout(connect_route * route, msg_out * msgout); 482 msg_out *route_prepare_msgout(connect_route *route, msg_out *msgout);
483 GList *route_msgout_list(connect_route * route, GList * msgout_list); 483 GList *route_msgout_list(connect_route *route, GList *msgout_list);
484 gboolean route_sender_is_allowed(connect_route * route, address * ret_path); 484 gboolean route_sender_is_allowed(connect_route *route, address *ret_path);
485 void route_split_rcpts(connect_route * route, GList * rcpt_list, GList ** p_rcpt_list, GList ** p_non_rcpt_list); 485 void route_split_rcpts(connect_route *route, GList *rcpt_list, GList **p_rcpt_list, GList **p_non_rcpt_list);
486 486
487 /* tables.c */ 487 /* tables.c */
488 table_pair *create_pair(gchar * key, gpointer value); 488 table_pair *create_pair(gchar *key, gpointer value);
489 table_pair *create_pair_string(gchar * key, gpointer value); 489 table_pair *create_pair_string(gchar *key, gpointer value);
490 table_pair *parse_table_pair(gchar * line, char delim); 490 table_pair *parse_table_pair(gchar *line, char delim);
491 gpointer *table_find_func(GList * table_list, gchar * key, int (*cmp_func) (const char *, const char *)); 491 gpointer *table_find_func(GList *table_list, gchar *key, int (*cmp_func) (const char *, const char *));
492 gpointer *table_find(GList * table_list, gchar * key); 492 gpointer *table_find(GList *table_list, gchar *key);
493 gpointer *table_find_case(GList * table_list, gchar * key); 493 gpointer *table_find_case(GList *table_list, gchar *key);
494 gpointer *table_find_fnmatch(GList * table_list, gchar * key); 494 gpointer *table_find_fnmatch(GList *table_list, gchar *key);
495 GList *table_read(gchar * fname, gchar delim); 495 GList *table_read(gchar *fname, gchar delim);
496 void destroy_table(GList * table); 496 void destroy_table(GList *table);
497 497
498 /* timeival.c */ 498 /* timeival.c */
499 gint time_interval(gchar * str); 499 gint time_interval(gchar *str);
500 500
501 /* permissions.c */ 501 /* permissions.c */
502 gboolean is_privileged_user(uid_t uid); 502 gboolean is_privileged_user(uid_t uid);
503 503
504 /* other things */ 504 /* other things */