2 * libEtPan! -- a mail stuff library
4 * Copyright (C) 2001, 2002 - DINH Viet Hoa
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the libEtPan! project nor the names of its
16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #ifndef MAILIMF_WRITE_H
38 #define MAILIMF_WRITE_H
45 #include "mailimf_types.h"
48 mailimf_string_write writes a string to a given stream
50 @param f is the stream
51 @param col (* col) is the column number where we will start to
52 write the text, the ending column will be stored in (* col)
53 @param str is the string to write
56 int mailimf_string_write(FILE * f
, int * col
,
57 const char * str
, size_t length
);
61 mailimf_fields_write writes the fields to a given stream
63 @param f is the stream
64 @param col (* col) is the column number where we will start to
65 write the text, the ending column will be stored in (* col)
66 @param fields is the fields to write
69 int mailimf_fields_write(FILE * f
, int * col
,
70 struct mailimf_fields
* fields
);
74 mailimf_envelope_fields_write writes only some fields to a given stream
76 @param f is the stream
77 @param col (* col) is the column number where we will start to
78 write the text, the ending column will be stored in (* col)
79 @param fields is the fields to write
82 int mailimf_envelope_fields_write(FILE * f
, int * col
,
83 struct mailimf_fields
* fields
);
87 mailimf_field_write writes a field to a given stream
89 @param f is the stream
90 @param col (* col) is the column number where we will start to
91 write the text, the ending column will be stored in (* col)
92 @param field is the field to write
95 int mailimf_field_write(FILE * f
, int * col
,
96 struct mailimf_field
* field
);
99 mailimf_quoted_string_write writes a string that is quoted
102 @param f is the stream
103 @param col (* col) is the column number where we will start to
104 write the text, the ending column will be stored in (* col)
105 @param string is the string to quote and write
108 int mailimf_quoted_string_write(FILE * f
, int * col
,
109 const char * string
, size_t len
);
111 int mailimf_address_list_write(FILE * f
, int * col
,
112 struct mailimf_address_list
* addr_list
);
114 int mailimf_mailbox_list_write(FILE * f
, int * col
,
115 struct mailimf_mailbox_list
* mb_list
);
118 mailimf_header_string_write writes a header value and fold the header
121 @param f is the stream
122 @param col (* col) is the column number where we will start to
123 write the text, the ending column will be stored in (* col)
124 @param str is the string to write
127 int mailimf_header_string_write(FILE * f
, int * col
,
128 const char * str
, size_t length
);