summaryrefslogtreecommitdiffabout
path: root/libetpan/src/low-level/imf/mailimf_write_file.h
Unidiff
Diffstat (limited to 'libetpan/src/low-level/imf/mailimf_write_file.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libetpan/src/low-level/imf/mailimf_write_file.h169
1 files changed, 169 insertions, 0 deletions
diff --git a/libetpan/src/low-level/imf/mailimf_write_file.h b/libetpan/src/low-level/imf/mailimf_write_file.h
new file mode 100644
index 0000000..2b7707f
--- a/dev/null
+++ b/libetpan/src/low-level/imf/mailimf_write_file.h
@@ -0,0 +1,169 @@
1/*
2 * libEtPan! -- a mail stuff library
3 *
4 * Copyright (C) 2001, 2005 - DINH Viet Hoa
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
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.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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
29 * SUCH DAMAGE.
30 */
31
32/*
33 * $Id$
34 */
35
36#ifndef MAILIMF_WRITE_H
37
38#define MAILIMF_WRITE_H
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#include <stdio.h>
45#include <libetpan/mailimf_types.h>
46
47 //#define MAILIMF_WRITE_COMPATIBILITY
48
49/*
50 mailimf_string_write_file writes a string to a given stream
51
52 @param f is the stream
53 @param col (* col) is the column number where we will start to
54 write the text, the ending column will be stored in (* col)
55 @param str is the string to write
56*/
57
58int mailimf_string_write_file(FILE * f, int * col,
59 const char * str, size_t length);
60
61
62/*
63 mailimf_fields_write_file writes the fields to a given stream
64
65 @param f is the stream
66 @param col (* col) is the column number where we will start to
67 write the text, the ending column will be stored in (* col)
68 @param fields is the fields to write
69*/
70
71int mailimf_fields_write_file(FILE * f, int * col,
72 struct mailimf_fields * fields);
73
74
75/*
76 mailimf_envelope_fields_write_file writes only some fields to a given stream
77
78 @param f is the stream
79 @param col (* col) is the column number where we will start to
80 write the text, the ending column will be stored in (* col)
81 @param fields is the fields to write
82*/
83
84int mailimf_envelope_fields_write_file(FILE * f, int * col,
85 struct mailimf_fields * fields);
86
87
88/*
89 mailimf_field_write_file writes a field to a given stream
90
91 @param f is the stream
92 @param col (* col) is the column number where we will start to
93 write the text, the ending column will be stored in (* col)
94 @param field is the field to write
95*/
96
97int mailimf_field_write_file(FILE * f, int * col,
98 struct mailimf_field * field);
99
100/*
101 mailimf_quoted_string_write_file writes a string that is quoted
102 to a given stream
103
104 @param f is the stream
105 @param col (* col) is the column number where we will start to
106 write the text, the ending column will be stored in (* col)
107 @param string is the string to quote and write
108*/
109
110int mailimf_quoted_string_write_file(FILE * f, int * col,
111 const char * string, size_t len);
112
113int mailimf_address_list_write_file(FILE * f, int * col,
114 struct mailimf_address_list * addr_list);
115
116int mailimf_mailbox_list_write_file(FILE * f, int * col,
117 struct mailimf_mailbox_list * mb_list);
118
119/*
120 mailimf_header_string_write_file writes a header value and fold the header
121 if needed.
122
123 @param f is the stream
124 @param col (* col) is the column number where we will start to
125 write the text, the ending column will be stored in (* col)
126 @param str is the string to write
127*/
128
129int mailimf_header_string_write_file(FILE * f, int * col,
130 const char * str, size_t length);
131
132
133
134/* binary compatibility with 0.34 - begin */
135
136#ifdef MAILIMF_WRITE_COMPATIBILITY
137int mailimf_string_write(FILE * f, int * col,
138 const char * str, size_t length);
139
140int mailimf_fields_write(FILE * f, int * col,
141 struct mailimf_fields * fields);
142
143int mailimf_envelope_fields_write(FILE * f, int * col,
144 struct mailimf_fields * fields);
145
146int mailimf_field_write(FILE * f, int * col,
147 struct mailimf_field * field);
148
149int mailimf_quoted_string_write(FILE * f, int * col,
150 const char * string, size_t len);
151
152int mailimf_address_list_write(FILE * f, int * col,
153 struct mailimf_address_list * addr_list);
154
155int mailimf_mailbox_list_write(FILE * f, int * col,
156 struct mailimf_mailbox_list * mb_list);
157
158int mailimf_header_string_write(FILE * f, int * col,
159 const char * str, size_t length);
160#endif
161
162/* binary compatibility with 0.34 - end */
163
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif