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 __MMAP_STRING_H__
38 #define __MMAP_STRING_H__
40 #include <sys/types.h>
50 typedef struct _MMAPString MMAPString
;
60 char * old_non_mmapped_str;
64 /* configure location of mmaped files */
66 void mmap_string_set_tmpdir(char * directory
);
71 MMAPString
* mmap_string_new (const char * init
);
73 MMAPString
* mmap_string_new_len (const char * init
,
76 MMAPString
* mmap_string_sized_new (size_t dfl_size
);
78 void mmap_string_free (MMAPString
* string
);
80 MMAPString
* mmap_string_assign (MMAPString
* string
,
83 MMAPString
* mmap_string_truncate (MMAPString
*string
,
86 MMAPString
* mmap_string_set_size (MMAPString
* string
,
89 MMAPString
* mmap_string_insert_len (MMAPString
* string
,
94 MMAPString
* mmap_string_append (MMAPString
* string
,
97 MMAPString
* mmap_string_append_len (MMAPString
* string
,
101 MMAPString
* mmap_string_append_c (MMAPString
* string
,
104 MMAPString
* mmap_string_prepend (MMAPString
* string
,
107 MMAPString
* mmap_string_prepend_c (MMAPString
* string
,
110 MMAPString
* mmap_string_prepend_len (MMAPString
* string
,
114 MMAPString
* mmap_string_insert (MMAPString
* string
,
118 MMAPString
* mmap_string_insert_c (MMAPString
*string
,
122 MMAPString
* mmap_string_erase(MMAPString
* string
,
126 void mmap_string_set_ceil(size_t ceil
);
128 int mmap_string_ref(MMAPString
* string
);
129 int mmap_string_unref(char * str
);
136 #endif /* __MMAP_STRING_H__ */