Fix indentation
Showing
1 changed file
with
31 additions
and
31 deletions
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. | 2 | Copyright (C) 1999, 2000, 2001, 2003, 2004, |
3 | 2007 Free Software Foundation, Inc. | ||
3 | 4 | ||
4 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
... | @@ -150,7 +151,7 @@ _strttrim (char *str) | ... | @@ -150,7 +151,7 @@ _strttrim (char *str) |
150 | return (str); | 151 | return (str); |
151 | } | 152 | } |
152 | 153 | ||
153 | char *_strtrim (char *str); | 154 | char *_strtrim (char *str); |
154 | 155 | ||
155 | #define _strtrim(str) _strltrim(_strttrim(str)) | 156 | #define _strtrim(str) _strltrim(_strttrim(str)) |
156 | 157 | ||
... | @@ -440,7 +441,7 @@ _mimepart_body_stream_size (mu_stream_t stream, mu_off_t *psize) | ... | @@ -440,7 +441,7 @@ _mimepart_body_stream_size (mu_stream_t stream, mu_off_t *psize) |
440 | static int | 441 | static int |
441 | _mimepart_body_read (mu_stream_t stream, | 442 | _mimepart_body_read (mu_stream_t stream, |
442 | char *buf, size_t buflen, mu_off_t off, | 443 | char *buf, size_t buflen, mu_off_t off, |
443 | size_t * nbytes) | 444 | size_t *nbytes) |
444 | { | 445 | { |
445 | mu_body_t body = mu_stream_get_owner (stream); | 446 | mu_body_t body = mu_stream_get_owner (stream); |
446 | mu_message_t msg = mu_body_get_owner (body); | 447 | mu_message_t msg = mu_body_get_owner (body); |
... | @@ -474,8 +475,8 @@ _mimepart_body_read (mu_stream_t stream, | ... | @@ -474,8 +475,8 @@ _mimepart_body_read (mu_stream_t stream, |
474 | } | 475 | } |
475 | 476 | ||
476 | static int | 477 | static int |
477 | _mimepart_body_transport (mu_stream_t stream, mu_transport_t * tr1, | 478 | _mimepart_body_transport (mu_stream_t stream, mu_transport_t *tr1, |
478 | mu_transport_t * tr2) | 479 | mu_transport_t *tr2) |
479 | { | 480 | { |
480 | mu_body_t body = mu_stream_get_owner (stream); | 481 | mu_body_t body = mu_stream_get_owner (stream); |
481 | mu_message_t msg = mu_body_get_owner (body); | 482 | mu_message_t msg = mu_body_get_owner (body); |
... | @@ -485,7 +486,7 @@ _mimepart_body_transport (mu_stream_t stream, mu_transport_t * tr1, | ... | @@ -485,7 +486,7 @@ _mimepart_body_transport (mu_stream_t stream, mu_transport_t * tr1, |
485 | } | 486 | } |
486 | 487 | ||
487 | static int | 488 | static int |
488 | _mimepart_body_size (mu_body_t body, size_t * psize) | 489 | _mimepart_body_size (mu_body_t body, size_t *psize) |
489 | { | 490 | { |
490 | mu_message_t msg = mu_body_get_owner (body); | 491 | mu_message_t msg = mu_body_get_owner (body); |
491 | struct _mime_part *mime_part = mu_message_get_owner (msg); | 492 | struct _mime_part *mime_part = mu_message_get_owner (msg); |
... | @@ -498,7 +499,7 @@ _mimepart_body_size (mu_body_t body, size_t * psize) | ... | @@ -498,7 +499,7 @@ _mimepart_body_size (mu_body_t body, size_t * psize) |
498 | } | 499 | } |
499 | 500 | ||
500 | static int | 501 | static int |
501 | _mimepart_body_lines (mu_body_t body, size_t * plines) | 502 | _mimepart_body_lines (mu_body_t body, size_t *plines) |
502 | { | 503 | { |
503 | mu_message_t msg = mu_body_get_owner (body); | 504 | mu_message_t msg = mu_body_get_owner (body); |
504 | struct _mime_part *mime_part = mu_message_get_owner (msg); | 505 | struct _mime_part *mime_part = mu_message_get_owner (msg); |
... | @@ -516,7 +517,7 @@ _mime_set_content_type (mu_mime_t mime) | ... | @@ -516,7 +517,7 @@ _mime_set_content_type (mu_mime_t mime) |
516 | { | 517 | { |
517 | char content_type[256], *content_te; | 518 | char content_type[256], *content_te; |
518 | char boundary[128]; | 519 | char boundary[128]; |
519 | mu_header_t hdr = NULL; | 520 | mu_header_t hdr = NULL; |
520 | size_t size; | 521 | size_t size; |
521 | int ret; | 522 | int ret; |
522 | 523 | ||
... | @@ -549,8 +550,7 @@ _mime_set_content_type (mu_mime_t mime) | ... | @@ -549,8 +550,7 @@ _mime_set_content_type (mu_mime_t mime) |
549 | } | 550 | } |
550 | else | 551 | else |
551 | { | 552 | { |
552 | if ((mime-> | 553 | if ((mime->flags & (MIME_ADDED_CT | MIME_ADDED_MULTIPART_CT)) |
553 | flags & (MIME_ADDED_CT | MIME_ADDED_MULTIPART_CT)) | ||
554 | == MIME_ADDED_CT) | 554 | == MIME_ADDED_CT) |
555 | return 0; | 555 | return 0; |
556 | mime->flags &= ~MIME_ADDED_MULTIPART_CT; | 556 | mime->flags &= ~MIME_ADDED_MULTIPART_CT; |
... | @@ -595,13 +595,13 @@ _mime_set_content_type (mu_mime_t mime) | ... | @@ -595,13 +595,13 @@ _mime_set_content_type (mu_mime_t mime) |
595 | 595 | ||
596 | static int | 596 | static int |
597 | _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, | 597 | _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, |
598 | size_t * nbytes) | 598 | size_t *nbytes) |
599 | { | 599 | { |
600 | mu_body_t body = mu_stream_get_owner (stream); | 600 | mu_body_t body = mu_stream_get_owner (stream); |
601 | mu_message_t msg = mu_body_get_owner (body); | 601 | mu_message_t msg = mu_body_get_owner (body); |
602 | mu_mime_t mime = mu_message_get_owner (msg); | 602 | mu_mime_t mime = mu_message_get_owner (msg); |
603 | int ret = 0; | 603 | int ret = 0; |
604 | size_t part_nbytes = 0; | 604 | size_t part_nbytes = 0; |
605 | mu_stream_t msg_stream = NULL; | 605 | mu_stream_t msg_stream = NULL; |
606 | 606 | ||
607 | if (mime->nmtp_parts == 0) | 607 | if (mime->nmtp_parts == 0) |
... | @@ -668,7 +668,7 @@ _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, | ... | @@ -668,7 +668,7 @@ _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, |
668 | if (mime->cur_part >= mime->nmtp_parts) | 668 | if (mime->cur_part >= mime->nmtp_parts) |
669 | return 0; | 669 | return 0; |
670 | mu_message_get_stream (mime->mtp_parts[mime->cur_part]->msg, | 670 | mu_message_get_stream (mime->mtp_parts[mime->cur_part]->msg, |
671 | &msg_stream); | 671 | &msg_stream); |
672 | } | 672 | } |
673 | else | 673 | else |
674 | { | 674 | { |
... | @@ -677,7 +677,7 @@ _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, | ... | @@ -677,7 +677,7 @@ _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, |
677 | if (mime->cur_part >= mime->nmtp_parts) | 677 | if (mime->cur_part >= mime->nmtp_parts) |
678 | return 0; | 678 | return 0; |
679 | mu_message_get_body (mime->mtp_parts[mime->cur_part]->msg, | 679 | mu_message_get_body (mime->mtp_parts[mime->cur_part]->msg, |
680 | &part_body); | 680 | &part_body); |
681 | mu_body_get_stream (part_body, &msg_stream); | 681 | mu_body_get_stream (part_body, &msg_stream); |
682 | } | 682 | } |
683 | ret = | 683 | ret = |
... | @@ -704,8 +704,8 @@ _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, | ... | @@ -704,8 +704,8 @@ _mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off, |
704 | } | 704 | } |
705 | 705 | ||
706 | static int | 706 | static int |
707 | _mime_body_transport (mu_stream_t stream, mu_transport_t * tr1, | 707 | _mime_body_transport (mu_stream_t stream, mu_transport_t *tr1, |
708 | mu_transport_t * tr2) | 708 | mu_transport_t *tr2) |
709 | { | 709 | { |
710 | mu_body_t body = mu_stream_get_owner (stream); | 710 | mu_body_t body = mu_stream_get_owner (stream); |
711 | mu_message_t msg = mu_body_get_owner (body); | 711 | mu_message_t msg = mu_body_get_owner (body); |
... | @@ -719,12 +719,12 @@ _mime_body_transport (mu_stream_t stream, mu_transport_t * tr1, | ... | @@ -719,12 +719,12 @@ _mime_body_transport (mu_stream_t stream, mu_transport_t * tr1, |
719 | } | 719 | } |
720 | 720 | ||
721 | static int | 721 | static int |
722 | _mime_body_size (mu_body_t body, size_t * psize) | 722 | _mime_body_size (mu_body_t body, size_t *psize) |
723 | { | 723 | { |
724 | mu_message_t msg = mu_body_get_owner (body); | 724 | mu_message_t msg = mu_body_get_owner (body); |
725 | mu_mime_t mime = mu_message_get_owner (msg); | 725 | mu_mime_t mime = mu_message_get_owner (msg); |
726 | int i, ret; | 726 | int i, ret; |
727 | size_t size; | 727 | size_t size; |
728 | 728 | ||
729 | if (mime->nmtp_parts == 0) | 729 | if (mime->nmtp_parts == 0) |
730 | return EINVAL; | 730 | return EINVAL; |
... | @@ -745,7 +745,7 @@ _mime_body_size (mu_body_t body, size_t * psize) | ... | @@ -745,7 +745,7 @@ _mime_body_size (mu_body_t body, size_t * psize) |
745 | } | 745 | } |
746 | 746 | ||
747 | static int | 747 | static int |
748 | _mime_body_lines (mu_body_t body, size_t * plines) | 748 | _mime_body_lines (mu_body_t body, size_t *plines) |
749 | { | 749 | { |
750 | mu_message_t msg = mu_body_get_owner (body); | 750 | mu_message_t msg = mu_body_get_owner (body); |
751 | mu_mime_t mime = mu_message_get_owner (msg); | 751 | mu_mime_t mime = mu_message_get_owner (msg); |
... | @@ -768,7 +768,7 @@ _mime_body_lines (mu_body_t body, size_t * plines) | ... | @@ -768,7 +768,7 @@ _mime_body_lines (mu_body_t body, size_t * plines) |
768 | } | 768 | } |
769 | 769 | ||
770 | int | 770 | int |
771 | mu_mime_create (mu_mime_t * pmime, mu_message_t msg, int flags) | 771 | mu_mime_create (mu_mime_t *pmime, mu_message_t msg, int flags) |
772 | { | 772 | { |
773 | mu_mime_t mime = NULL; | 773 | mu_mime_t mime = NULL; |
774 | int ret = 0; | 774 | int ret = 0; |
... | @@ -836,7 +836,7 @@ mu_mime_create (mu_mime_t * pmime, mu_message_t msg, int flags) | ... | @@ -836,7 +836,7 @@ mu_mime_create (mu_mime_t * pmime, mu_message_t msg, int flags) |
836 | } | 836 | } |
837 | 837 | ||
838 | void | 838 | void |
839 | mu_mime_destroy (mu_mime_t * pmime) | 839 | mu_mime_destroy (mu_mime_t *pmime) |
840 | { | 840 | { |
841 | mu_mime_t mime; | 841 | mu_mime_t mime; |
842 | struct _mime_part *mime_part; | 842 | struct _mime_part *mime_part; |
... | @@ -876,7 +876,7 @@ mu_mime_destroy (mu_mime_t * pmime) | ... | @@ -876,7 +876,7 @@ mu_mime_destroy (mu_mime_t * pmime) |
876 | } | 876 | } |
877 | 877 | ||
878 | int | 878 | int |
879 | mu_mime_get_part (mu_mime_t mime, size_t part, mu_message_t * msg) | 879 | mu_mime_get_part (mu_mime_t mime, size_t part, mu_message_t *msg) |
880 | { | 880 | { |
881 | size_t nmtp_parts; | 881 | size_t nmtp_parts; |
882 | int ret = 0, flags = 0; | 882 | int ret = 0, flags = 0; |
... | @@ -924,7 +924,7 @@ mu_mime_get_part (mu_mime_t mime, size_t part, mu_message_t * msg) | ... | @@ -924,7 +924,7 @@ mu_mime_get_part (mu_mime_t mime, size_t part, mu_message_t * msg) |
924 | } | 924 | } |
925 | 925 | ||
926 | int | 926 | int |
927 | mu_mime_get_num_parts (mu_mime_t mime, size_t * nmtp_parts) | 927 | mu_mime_get_num_parts (mu_mime_t mime, size_t *nmtp_parts) |
928 | { | 928 | { |
929 | int ret = 0; | 929 | int ret = 0; |
930 | 930 | ||
... | @@ -956,7 +956,7 @@ mu_mime_add_part (mu_mime_t mime, mu_message_t msg) | ... | @@ -956,7 +956,7 @@ mu_mime_add_part (mu_mime_t mime, mu_message_t msg) |
956 | } | 956 | } |
957 | 957 | ||
958 | int | 958 | int |
959 | mu_mime_get_message (mu_mime_t mime, mu_message_t * msg) | 959 | mu_mime_get_message (mu_mime_t mime, mu_message_t *msg) |
960 | { | 960 | { |
961 | mu_stream_t body_stream; | 961 | mu_stream_t body_stream; |
962 | mu_body_t body; | 962 | mu_body_t body; |
... | @@ -983,14 +983,14 @@ mu_mime_get_message (mu_mime_t mime, mu_message_t * msg) | ... | @@ -983,14 +983,14 @@ mu_mime_get_message (mu_mime_t mime, mu_message_t * msg) |
983 | mu_body_set_size (body, _mime_body_size, mime->msg); | 983 | mu_body_set_size (body, _mime_body_size, mime->msg); |
984 | mu_body_set_lines (body, _mime_body_lines, mime->msg); | 984 | mu_body_set_lines (body, _mime_body_lines, mime->msg); |
985 | if ((ret = | 985 | if ((ret = |
986 | mu_stream_create (&body_stream, MU_STREAM_READ, body)) | 986 | mu_stream_create (&body_stream, |
987 | == 0) | 987 | MU_STREAM_READ, body)) == 0) |
988 | { | 988 | { |
989 | mu_stream_set_read (body_stream, _mime_body_read, | 989 | mu_stream_set_read (body_stream, _mime_body_read, |
990 | body); | 990 | body); |
991 | mu_stream_set_get_transport2 (body_stream, | 991 | mu_stream_set_get_transport2 (body_stream, |
992 | _mime_body_transport, | 992 | _mime_body_transport, |
993 | body); | 993 | body); |
994 | mu_body_set_stream (body, body_stream, mime->msg); | 994 | mu_body_set_stream (body, body_stream, mime->msg); |
995 | *msg = mime->msg; | 995 | *msg = mime->msg; |
996 | return 0; | 996 | return 0; | ... | ... |
-
Please register or sign in to post a comment