cleanup of unused stuff
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6339 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
b7c6c0e483
commit
60fc10a888
|
@ -143,16 +143,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cepstral", "src\mod\asr
|
|||
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_perl", "src\mod\languages\mod_perl\fs_perl.vcproj", "{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_perl", "src\mod\languages\mod_perl\mod_perl.vcproj", "{7B077E7F-1BE7-4291-AB86-55E527B25CAC}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.vcproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
|
||||
|
@ -215,12 +205,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod
|
|||
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr", "src\mod\event_handlers\mod_cdr\mod_cdr.vcproj", "{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
|
||||
{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgsm", "libs\codec\gsm\libgsm.vcproj", "{8FD2E297-4096-47E5-9258-C48FF1841523}"
|
||||
|
@ -371,15 +355,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_enum", "src\mod\applica
|
|||
{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_etpan", "src\mod\languages\mod_spidermonkey_etpan\mod_spidermonkey_etpan.vcproj", "{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
|
||||
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
|
||||
{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
|
||||
{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_odbc", "src\mod\languages\mod_spidermonkey_odbc\mod_spidermonkey_odbc.vcproj", "{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}
|
||||
|
@ -388,8 +363,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_odbc", "sr
|
|||
{204FA0DE-305D-4414-AE2E-F195A23F390D} = {204FA0DE-305D-4414-AE2E-F195A23F390D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libetpan", "libs\win32\etpan\libetpan.vcproj", "{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_curl", "src\mod\xml_int\mod_xml_curl\mod_xml_curl.vcproj", "{AB91A099-7690-4ECF-8994-E458F4EA1ED4}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}
|
||||
|
@ -523,6 +496,7 @@ EndProject
|
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build System", "_Build System", "{DB1024A8-41BF-4AD7-9AE6-13202230D1F3}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
acsite.m4 = acsite.m4
|
||||
bootstrap.sh = bootstrap.sh
|
||||
build\buildlib.sh = build\buildlib.sh
|
||||
configure.in = configure.in
|
||||
Makefile.am = Makefile.am
|
||||
|
@ -804,14 +778,6 @@ Global
|
|||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|Win32
|
||||
{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8}.Release|x64.ActiveCfg = Release|Win32
|
||||
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32
|
||||
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
|
@ -866,12 +832,6 @@ Global
|
|||
{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32
|
||||
{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|Win32
|
||||
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|Win32.Build.0 = Release|Win32
|
||||
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8}.Release|x64.ActiveCfg = Release|Win32
|
||||
{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8FD2E297-4096-47E5-9258-C48FF1841523}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
|
@ -1094,24 +1054,12 @@ Global
|
|||
{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32
|
||||
{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|Win32
|
||||
{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|Win32.Build.0 = Release|Win32
|
||||
{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9}.Release|x64.ActiveCfg = Release|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.Build.0 = Release|Win32
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.ActiveCfg = Release|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|Win32.Build.0 = Release|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release|x64.ActiveCfg = Release|Win32
|
||||
{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
|
@ -1320,7 +1268,6 @@ Global
|
|||
{C7705DC4-2088-493E-AF8D-65BC6D65C125} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
|
||||
{784113EF-44D9-4949-835D-7065D3C7AD08} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
|
||||
{05515420-16DE-4E63-BE73-85BE85BA5142} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
|
||||
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
|
||||
{1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A}
|
||||
{EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}
|
||||
{89385C74-5860-4174-9CAF-A39E7C48909C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
|
@ -1351,15 +1298,11 @@ Global
|
|||
{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{ACFD96F2-58AA-491D-B4C0-33BD0BD57FDE} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{B0C6CFF9-7DCD-4A21-8BA4-C2011E18DED8} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{8F992C49-6C51-412F-B2A3-34EAB708EB65} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{D6C82F86-2B05-4A7F-8CC6-D2592E66FBB9} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{028C7278-05D7-4E18-82FE-BE231B844F41} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
|
||||
|
|
|
@ -4,7 +4,7 @@ echo "bootstrap: checking installation..."
|
|||
BASEDIR=`pwd`;
|
||||
LIBDIR=${BASEDIR}/libs;
|
||||
SUBDIRS="codec/g7xx codec/g726 codec/gsm codec/ilbc codec/lpc10 curl iax iksemel \
|
||||
js js/nsprpub libdingaling libetpan libresample libsndfile pcre sofia-sip \
|
||||
js js/nsprpub libdingaling libresample libsndfile pcre sofia-sip \
|
||||
speex sqlite srtp xmlrpc-c";
|
||||
|
||||
|
||||
|
|
|
@ -454,7 +454,6 @@ AC_CONFIG_SUBDIRS(libs/iksemel)
|
|||
AC_CONFIG_SUBDIRS(libs/js/nsprpub)
|
||||
AC_CONFIG_SUBDIRS(libs/js)
|
||||
AC_CONFIG_SUBDIRS(libs/libdingaling)
|
||||
AC_CONFIG_SUBDIRS(libs/libetpan)
|
||||
AC_CONFIG_SUBDIRS(libs/libsndfile)
|
||||
AC_CONFIG_SUBDIRS(libs/sofia-sip)
|
||||
AC_CONFIG_SUBDIRS(libs/speex)
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
include
|
||||
libetpan-config
|
||||
libetpan-config.h
|
||||
libtool
|
||||
ltmain.sh
|
||||
Makefile
|
||||
Rules
|
|
@ -1 +0,0 @@
|
|||
Fri Mar 16 17:17:12 EDT 2007
|
|
@ -1,31 +0,0 @@
|
|||
libEtPan! -- a mail stuff library
|
||||
|
||||
Copyright (C) 2001 - 2005 - DINH Viet Hoa
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the libEtPan! project nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
This project contains code from sendmail, NetBSD,
|
||||
RSA Data Security MD5 Message-Digest Algorithm, Cyrus IMAP.
|
File diff suppressed because it is too large
Load Diff
|
@ -1,183 +0,0 @@
|
|||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
# Main makefile
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_builddir = .
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
mandir = @mandir@
|
||||
bindir = @bindir@
|
||||
SHELL = /bin/sh
|
||||
RM = rm -fr
|
||||
INSTALL = @INSTALL@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
@SET_MAKE@
|
||||
|
||||
#SUBDIRS = imap nntp pop3 smtp tools imf mbox mh maildir mime generic
|
||||
#SUBLIBS = imap/libmailimap.la nntp/libnewsnntp.la pop3/libmailpop3.la \
|
||||
# smtp/libmailsmtp.la tools/libtools.la imf/libmailimf.la \
|
||||
# mbox/libmailmbox.la mh/libmailmh.la mime/libmailmime.la \
|
||||
# maildir/libmaildir.la generic/libmaildriver.la
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
#TARGET = libetpan.la
|
||||
#VERSINFO = @API_VERSION@
|
||||
#CC = @CC@
|
||||
#LDFLAGS = @LIBS@ @SSLLIBS@ @LDFLAGS@ @DBLIB@
|
||||
CPP = @CPP@
|
||||
|
||||
all: config-files prepare all-recursive
|
||||
|
||||
distclean: clean distclean-recursive
|
||||
$(RM) config.h config.cache config.log config.status \
|
||||
Makefile Rules *~ gmon.out *.bak core libtool \
|
||||
libetpan-config src/main/libetpan_version.h \
|
||||
libetpan-config.h
|
||||
|
||||
maintainer-clean: distclean
|
||||
$(RM) configure config.h.in aclocal.m4 config.guess config.sub ltmain.sh autom4te.cache
|
||||
|
||||
realclean: maintainer-clean
|
||||
|
||||
all-recursive install-recursive clean-recursive \
|
||||
distclean-recursive prepare-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
|
||||
install: all install-dirs install-recursive
|
||||
$(INSTALL) -m 755 libetpan-config $(DESTDIR)$(bindir)
|
||||
$(INSTALL) -m 644 libetpan-config.h $(DESTDIR)$(includedir)/libetpan
|
||||
$(INSTALL) -m 644 src/main/libetpan.h $(DESTDIR)$(includedir)
|
||||
|
||||
install-dirs:
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(includedir)
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(includedir)/libetpan
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
|
||||
|
||||
#realclean: maintainer-clean
|
||||
|
||||
clean: clean-recursive
|
||||
$(RM) $(TARGET) .libs $(top_builddir)/include libetpan-config.h
|
||||
|
||||
test:
|
||||
|
||||
#$(TARGET): config-files $(SUBLIBS)
|
||||
# $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(SUBLIBS) \
|
||||
# -rpath $(libdir) -version-info $(VERSINFO)
|
||||
|
||||
#$(SUBLIBS): all-recursive
|
||||
|
||||
libetpan-config.h: $(srcdir)/libetpan-config.h.in
|
||||
cp $(srcdir)/libetpan-config.h.in libetpan-config-in.h
|
||||
$(CPP) -I$(srcdir) libetpan-config-in.h | sed -e '/^#/d;/^[ \t]*$$/d;s/^@/#/' > libetpan-config.h
|
||||
$(RM) -f libetpan-config-in.h
|
||||
|
||||
prepare: prepare-recursive libetpan-config.h
|
||||
mkdir -p ${top_builddir}/include/libetpan
|
||||
cp -f libetpan-config.h $(top_builddir)/include/libetpan
|
||||
|
||||
# config files
|
||||
config-files: ${srcdir}/configure ${srcdir}/config.h.in Makefile config.status Rules ${srcdir}/src/Makefile
|
||||
|
||||
${srcdir}/configure: configure.in
|
||||
cd ${srcdir} && aclocal && autoconf
|
||||
|
||||
${srcdir}/config.h.in: configure.in
|
||||
rm -f ${srcdir}/config.h.in && cd ${srcdir} && autoheader
|
||||
|
||||
Makefile: Makefile.in config.status
|
||||
cd ${top_builddir} && CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status
|
||||
|
||||
${srcdir}/src/Makefile : ${srcdir}/src/Makefile.in config.status
|
||||
cd ${top_builddir} && CONFIG_FILES=src/Makefile CONFIG_HEADERS= ./config.status
|
||||
|
||||
#${srcdir}/src/low-level/Makefile : ${srcdir}/src/low-level/Makefile.in config.status
|
||||
# cd ${top_builddir} && CONFIG_FILES=src/low-level/Makefile CONFIG_HEADERS= ./config.status
|
||||
|
||||
Rules: Rules.in config.status
|
||||
cd ${top_builddir} && CONFIG_FILES=Rules CONFIG_HEADERS= ./config.status
|
||||
|
||||
config.status: configure
|
||||
./config.status --recheck
|
||||
|
|
@ -1,284 +0,0 @@
|
|||
2006-03-22 - libetpan-0.45
|
||||
|
||||
* release 0.45 - Depth Charge
|
||||
bugfix release
|
||||
|
||||
2006-03-08 - libetpan-0.43
|
||||
|
||||
* release 0.43 - Lateralus
|
||||
bugfix release
|
||||
|
||||
2006-01-09 - libetpan-0.42
|
||||
|
||||
* release 0.41 - Figure Number Five
|
||||
bugfix release
|
||||
|
||||
2005-12-02 - libetpan-0.41
|
||||
|
||||
* release 0.41 - Transfixion
|
||||
* passphrase is implemented for S/MIME and PGP.
|
||||
* avoid symbols conflict between GnuTLS and OpenSSL.
|
||||
|
||||
2005-10-07 - libetpan-0.40 - hoa
|
||||
|
||||
* release 0.40 - Kashmir
|
||||
|
||||
* SSL initialization is optional.
|
||||
|
||||
2005-09-16 - libetpan-0.39 - hoa
|
||||
|
||||
* release 0.39 - Deliverance
|
||||
|
||||
* compatibility with GnuTLS
|
||||
* SASL for higher level
|
||||
|
||||
2005-07-20 - libetpan-0.38 - hoa
|
||||
|
||||
* release 0.38 - Deadwing
|
||||
|
||||
* fixed SSL
|
||||
* IMAP improvements
|
||||
* SASL
|
||||
|
||||
2005-07-03 - libetpan-0.37 - hoa
|
||||
|
||||
* release 0.37 - Deadwing
|
||||
|
||||
* windows port
|
||||
* fixed IMAP implementation (for sylpheed)
|
||||
|
||||
2005-02-22 - libetpan-0.36 - hoa
|
||||
|
||||
* release 0.36 - Silver Drop
|
||||
|
||||
* memory leak
|
||||
* fixed maildir support
|
||||
|
||||
2004-12-28 - libetpan-0.35 - hoa
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* release 0.35 - Dimebag Darrell
|
||||
|
||||
* minor bugfixes.
|
||||
|
||||
2004-11-04 - libetpan-0.34 - hoa
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* release 0.34 - edge
|
||||
|
||||
* general
|
||||
- support for debian systems mbox
|
||||
- ability to disable thread-safe support
|
||||
|
||||
|
||||
2004-08-24 - libetpan-0.33 - hoa
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* release 0.33 - entropia
|
||||
|
||||
* general
|
||||
- bugfixes in IMAP module and mailstream
|
||||
- fixed low-level data structures
|
||||
- better support for ARM and PPC architecture
|
||||
- support for cross-compilation
|
||||
- fixed Berkeley DB support
|
||||
- changed folder structure of libetpan package
|
||||
- can now add a message to a mailbox with flags
|
||||
- support for hotmail mailboxes (with help of hotwayd)
|
||||
- added Berkeley DB mail storage as experimental
|
||||
- added support for PGP and S/MIME
|
||||
- better folder API
|
||||
|
||||
|
||||
2003-12-16 - libetpan-0.32 - hoa
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* release 0.32 - Black Utopia
|
||||
|
||||
* general
|
||||
- added documentation for IMF / tools
|
||||
- bugfixes in IMAP module due to structures change.
|
||||
- Application that use libEtPan! now have to use
|
||||
'#include <libetpan/libetpan.h>'
|
||||
|
||||
* generic
|
||||
- get_message() is implemented in Maildir cached driver.
|
||||
|
||||
2003-12-10 - libEtPan! version 0.31
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* release 0.31 - Steve Morse release
|
||||
|
||||
* general
|
||||
- all fields name of structures are changed.
|
||||
- bugfixes.
|
||||
- union {} are added everywhere it is possible to save memory.
|
||||
- support for Berkeley DB 1.
|
||||
- improved compatibility with FreeBSD and Mac OS X.
|
||||
|
||||
* drivers
|
||||
- cache drivers are disable if Berkeley DB is not found.
|
||||
- disable search call.
|
||||
- support of buggy Courier-IMAP server.
|
||||
- semantic of mailsession_get_envelopes_list() changed : it
|
||||
does no more remove messages from the list.
|
||||
- mailsession_get_message_by_uid() is added and implemented
|
||||
in some drivers.
|
||||
|
||||
2003-11-21 - libEtPan! version 0.30
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* release 0.30 - Spock's Beard release
|
||||
|
||||
* main new features
|
||||
- cache for drivers is cleaned up.
|
||||
- maildir driver.
|
||||
|
||||
* general
|
||||
- fixed several memory leaks.
|
||||
|
||||
- defines now exist for new features since version 0.29
|
||||
|
||||
|
||||
* tools
|
||||
- dump of network traffic is now possible by setting
|
||||
exported variable mailstream_debug to 1.
|
||||
|
||||
- TLS/SSL driver for stream is fixed.
|
||||
|
||||
* imf
|
||||
- fixed RFC 2822 format, wrap headers and break lines
|
||||
when they are longer than requirement (998).
|
||||
|
||||
- reduced size of headers data.
|
||||
a union is used inside the structure.
|
||||
*** WARNING *** : this change use of structure field as a union
|
||||
member is used in mailimf_field structure.
|
||||
|
||||
* imap
|
||||
- several fixes in IMAP module.
|
||||
|
||||
* mime
|
||||
- fixed quoted-printable parser.
|
||||
|
||||
* generic - cache for drivers
|
||||
- cache database is now cleaned up.
|
||||
|
||||
- fixed header fields cache.
|
||||
*** WARNING *** cache format changed. You should reset all
|
||||
your cache of headers (env.db).
|
||||
|
||||
* generic - threading
|
||||
|
||||
- fixed threading when threading by references with subject.
|
||||
|
||||
* generic - drivers for message
|
||||
|
||||
- separated flush() and check() in message.
|
||||
*** WARNING *** : this changes the API of the message.
|
||||
flush() is used to free the internal structure used
|
||||
to store the MIME structure of the message. It invalidates
|
||||
the "mime" member of the message.
|
||||
check() is used for to notify the modification of message
|
||||
flags to the session, so that the session saves the flags
|
||||
of the message at the next call of mailsession_check() or
|
||||
when leaving the session.
|
||||
|
||||
- IMAP implementation is more compliant.
|
||||
|
||||
- added driver to build MIME message and see the rendering
|
||||
through fetch functions.
|
||||
|
||||
- added driver to parse message content given with a string.
|
||||
|
||||
* generic - drivers for maildir
|
||||
|
||||
- maildir driver for storage / session / messages
|
||||
is implemented.
|
||||
|
||||
* 2003-10-06 - libEtPan! version 0.29
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* XetPan release
|
||||
|
||||
* debug for stream, network timeout
|
||||
* SSL library is initialized by SSL stream driver
|
||||
* fixed messages threading
|
||||
* added SMTP authentication CRAM-MD5, LOGIN, PLAIN
|
||||
* added example of use of SMTP
|
||||
|
||||
* 2003-04-01 - libEtPan! version 0.28
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* Avril Lavigne Release
|
||||
|
||||
* fixed IMAP parser
|
||||
* access to network protocols with a command
|
||||
* pop3 driver can try APOP authentication and fallback on clear
|
||||
authentication
|
||||
|
||||
* 2002-12-18 - libEtPan! version 0.27
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* Christmas release ^^ //clindoeil
|
||||
|
||||
* helper interface for IMF (RFC 2822) and MIME
|
||||
* changed interface for mail threading so that a default
|
||||
charset can be set.
|
||||
*** this means that mail threading INTERFACE CHANGED ***
|
||||
* API documentation in code
|
||||
* flags directory and cache directory can be different.
|
||||
*** this means that storage INTERFACE CHANGED ***
|
||||
|
||||
* 2002-09-02 - libEtPan! version 0.26
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* flags for all cache drivers
|
||||
* flags stored on disk use Berkeley DB
|
||||
* mailmessage, session and storage interface are separated
|
||||
*** this means that generic INTERFACE CHANGED ***
|
||||
* fixes various bugs and memory leaks
|
||||
|
||||
etpan - a console mail client
|
||||
|
||||
* available on CVS
|
||||
* virtual folder (using storage interface) is used
|
||||
* folder list view / message list view / message view
|
||||
* we can poll for status of mailboxes
|
||||
* got rid of expat
|
||||
* uses new interface of libEtPan!
|
||||
|
||||
* 2002-06-26 - libEtPan! version 0.25
|
||||
|
||||
libEtPan! - a mail library
|
||||
|
||||
* BSD licence
|
||||
* portability tested on Solaris, FreeBSD, IRIX and Linux
|
||||
* implementation of messages threads
|
||||
* MIME message generator
|
||||
* drivers are implemented for IMAP4rev1, POP3, NNTP, MH, mbox
|
||||
in both cached and non-cached version.
|
||||
|
||||
etpan - a console mail client
|
||||
|
||||
* a small mail client not distributed has been implemented
|
||||
written in ncurses
|
||||
featuring :
|
||||
- MIME message editor
|
||||
- IMAP4rev1, POP3, NNTP, MH, mbox access
|
||||
- renderer (HTML rendering for example)
|
||||
- retrieving of MIME parts
|
||||
- messages threads
|
||||
|
||||
big missing feature :
|
||||
- removing messages is not yet possible
|
|
@ -1,70 +0,0 @@
|
|||
# common part for sub directories Makefiles
|
||||
#
|
||||
# each submakefile should define SOURCES and TARGET
|
||||
# optionnaly HEADRS and INCLUDES
|
||||
|
||||
DESTDIR =
|
||||
srcdir = $(top_builddir)/src
|
||||
prefix = @prefix@
|
||||
includedir = @includedir@
|
||||
SHELL = /bin/sh
|
||||
RM = rm -fr
|
||||
INSTALL = @INSTALL@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
CC = @CC@
|
||||
@SET_MAKE@
|
||||
|
||||
CFLAGS = -I$(top_builddir)/include -I$(top_builddir) -I. $(INCLUDES) @CFLAGS@ @CPPFLAGS@ @DEFS@
|
||||
|
||||
LDFLAGS = @LDFLAGS@
|
||||
OBJECTS = $(SOURCES:.c=.lo)
|
||||
|
||||
all: $(TARGET).la
|
||||
|
||||
.SUFFIXES: .lo .c
|
||||
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $<
|
||||
|
||||
$(TARGET).la: $(OBJECTS) $(SUBLIBS)
|
||||
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SUBLIBS)
|
||||
|
||||
$(SUBLIBS) no-sublibs: all-recursive
|
||||
|
||||
clean: clean-recursive
|
||||
$(RM) *.o *.lo $(TARGET).la .libs *~
|
||||
|
||||
# install headers here only
|
||||
install: $(HEADERS) install-recursive
|
||||
for header in $(HEADERS) _listend; do \
|
||||
if [ $$header != _listend ]; then \
|
||||
$(INSTALL) -m 644 $$header $(DESTDIR)$(includedir)/libetpan ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
Makefile: $(top_builddir)/Rules
|
||||
|
||||
$(top_builddir)/Rules: $(top_builddir)/Rules.in $(top_builddir)/config.status
|
||||
cd ${top_builddir} && CONFIG_FILES=`basename $@` \
|
||||
CONFIG_HEADERS= ./config.status
|
||||
|
||||
prepare: prepare-recursive
|
||||
mkdir -p ${top_builddir}/include/libetpan
|
||||
@for header in $(HEADERS) _listend; do \
|
||||
[ "$$header" = _listend ] && break ; \
|
||||
cmp -s "$$header" "${top_builddir}/include/libetpan/$$header" && continue ; \
|
||||
cp -pf "$$header" ${top_builddir}/include/libetpan ; \
|
||||
echo "Copied $$header -> include/libetpan/$$header" ; \
|
||||
done
|
||||
|
||||
# recursive
|
||||
all-recursive install-recursive clean-recursive \
|
||||
distclean-recursive prepare-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
API documentation
|
||||
-----------------
|
||||
|
||||
- doc for cache
|
||||
|
||||
- doc for mbox
|
||||
|
||||
- doc for MH
|
||||
|
||||
- doc for NNTP
|
||||
|
||||
- doc for POP3
|
||||
|
||||
- comments within code
|
||||
|
||||
|
||||
mail drivers
|
||||
------------
|
||||
|
||||
- bodystructure should be cached
|
||||
|
||||
- sort messages
|
||||
|
||||
- SMTP - recipient resolver
|
||||
|
||||
|
||||
IMF
|
||||
---
|
||||
|
||||
- rewrite efficient RFC 2822 message parser
|
||||
|
||||
|
||||
IMAP
|
||||
----
|
||||
|
||||
- rewrite efficient IMAP parser
|
||||
|
||||
|
||||
MIME
|
||||
----
|
||||
|
||||
- generate MIME-encoded headers (done in etpan)
|
||||
|
||||
|
||||
binding
|
||||
-------
|
||||
|
||||
- perl binding
|
||||
|
||||
- objective C binding
|
||||
|
||||
- C++ mapping
|
||||
|
||||
- python binding
|
||||
|
||||
- emacs-lisp binding
|
||||
|
||||
- ocaml binding
|
||||
|
||||
|
||||
miscellaneous
|
||||
-------------
|
||||
|
||||
- SASL authentification : cyrus-sasl
|
||||
CRAM-MD5 / DIGEST-MD5
|
||||
|
||||
- S/MIME / GPG /PGP
|
||||
|
||||
- filtering / scoring / searching language
|
||||
|
||||
- generic tools for mail clients
|
||||
|
||||
- check SSL certificates
|
||||
|
||||
|
||||
compilation
|
||||
-----------
|
||||
|
||||
- improve autoconf / portability (header checks...)
|
||||
|
||||
|
||||
|
||||
new API
|
||||
-------
|
||||
|
||||
wim delvaux
|
||||
|
||||
|
||||
-- storage
|
||||
|
||||
struct storage {
|
||||
void * data; /* storage dependant */
|
||||
}
|
||||
|
||||
storage_bind(&storage, driver);
|
||||
storage_release(&storage);
|
||||
|
||||
storage_commit(storage)
|
||||
|
||||
storage_get_folder_set(storage, pattern, &set) -> list of subfolders
|
||||
list of pair (basename, path)
|
||||
storage_get_folder_tree(storage, pattern, &tree) -> tree of folders
|
||||
tree of pair (basename, path)
|
||||
folder_list_cleanup(&list)
|
||||
folder_tree_cleanup(&list)
|
||||
|
||||
storage_set_option(storage, option_id, value, ...)
|
||||
storage_set_option_by_name(storage, option_name, value, ...)
|
||||
|
||||
storage_build_folder_name(storage, name, ...)
|
||||
storage_create_folder(storage, name);
|
||||
storage_delete_folder(storage, name);
|
||||
storage_rename_folder(storage, folder, newname);
|
||||
|
||||
struct etpan_folder {
|
||||
struct storage * storage;
|
||||
}
|
||||
|
||||
one connection per storage,
|
||||
a connection can be a set of TCP/IP socket
|
||||
|
||||
-- folder
|
||||
|
||||
folder_bind(&folder, storage, path);
|
||||
folder_release(&folder);
|
||||
|
||||
folder_set_option(folder, option_id, value, ...)
|
||||
folder_set_option_by_name(folder, option_name, value, ...)
|
||||
folder_ctl(folder, function_id, param, ...)
|
||||
folder_ctl_by_name(folder, function_name, param, ...)
|
||||
|
||||
folder_get_path(folder)
|
||||
|
||||
when an action is done on folder we have to query the storage state,
|
||||
to see which folder we are manipulating and select the right folder.
|
||||
|
||||
one binding per folder.
|
||||
|
||||
several binding may be using one shared TCP/IP connection
|
||||
or one TCP/IP connection for each binding.
|
||||
|
||||
folder_commit(folder) -- write all flags the data down for persistant
|
||||
folder_expunge(folder) -- delete messages marked as deleted
|
||||
folder_status(folder, &count, &unread_count, &new_count)
|
||||
-- return messages number, unread messages number, new messages number
|
||||
folder_append_message(folder, message) -- add a message
|
||||
(message will already contain the new flags),
|
||||
really add it after commit()
|
||||
|
||||
folder_get_envelopes_list(folder, &list) -- return list of message
|
||||
binded to folder.
|
||||
folder_fill_envelopes_list(folder, &list) -- fill the envelope info of the
|
||||
list of messages.
|
||||
|
||||
switch_connection_to_binding()
|
||||
|
||||
struct connection {
|
||||
struct current_binding * binding;
|
||||
}
|
||||
|
||||
|
||||
struct etpan_message {
|
||||
struct etpan_folder * folder;
|
||||
}
|
||||
|
||||
message_bind(&message, folder, msg_id) -- initializes the message structure
|
||||
message_release(&message) -- release the message
|
||||
message_commit(&message) -- let the folder structure knows the flags we changed
|
||||
message_get_mime_tree(&message, &mime_tree) -- return the MIME structure of
|
||||
the message
|
||||
message_mime_tree_cleanup(mime_tree) -- free the mime structure returned
|
||||
|
||||
message_get_flags(&message, &flags) -- fetch the flags of the message
|
||||
message_flags_cleanup(&message, flags) -- free the flags
|
||||
|
||||
struct etpan_mime {
|
||||
struct etpan_message * message;
|
||||
}
|
||||
|
||||
message_get_parsed_header(msg, &header)
|
||||
message_get_raw_header(msg, &header)
|
||||
message_get_header_set(msg, &headers)
|
||||
message_get_body(msg, &Body)
|
||||
|
||||
standard headers
|
||||
special headers
|
||||
body
|
||||
flags
|
|
@ -1,86 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
|
||||
# name of the current package
|
||||
PKG_NAME=`basename \`(cd $srcdir; pwd)\``
|
||||
|
||||
# default configure options
|
||||
conf_flags="--enable-debug --with-debug"
|
||||
|
||||
DIE=0
|
||||
libtool=0
|
||||
gettext=0
|
||||
libtoolize=libtoolize
|
||||
|
||||
if which glibtoolize >/dev/null 2>&1 ; then
|
||||
libtoolize=glibtoolize
|
||||
fi
|
||||
|
||||
missing() {
|
||||
echo
|
||||
echo "**Error**: You must have \`$1' installed to compile $PKG_NAME."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || missing autoconf
|
||||
(aclocal --version) < /dev/null > /dev/null 2>&1 || missing aclocal
|
||||
|
||||
grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && gettext=1
|
||||
grep "^AC_PROG_LIBTOOL" $srcdir/configure.in >/dev/null && libtool=1
|
||||
|
||||
if test "$gettext" -eq 1; then
|
||||
grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
|
||||
(gettextize --version) < /dev/null > /dev/null 2>&1 || missing gettext
|
||||
fi
|
||||
|
||||
if test "$libtool" -eq 1; then
|
||||
($libtoolize --version) < /dev/null > /dev/null 2>&1 || missing libtool
|
||||
fi
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$*"; then
|
||||
echo "**Warning**: I am going to run \`configure' with default arguments."
|
||||
echo "If you wish to pass any others to it, please specify them on the"
|
||||
echo \`$0\'" command line."
|
||||
echo
|
||||
else
|
||||
unset conf_flags
|
||||
fi
|
||||
|
||||
echo "Running aclocal..."
|
||||
aclocal
|
||||
|
||||
if test "$gettext" -eq 1; then
|
||||
echo "Running gettextize... Ignore non-fatal messages."
|
||||
echo "no" | gettextize --force --copy
|
||||
fi
|
||||
|
||||
if test "$libtool" -eq 1; then
|
||||
echo "Running libtoolize..."
|
||||
$libtoolize --force --copy
|
||||
fi
|
||||
|
||||
echo "Running autoheader..."
|
||||
autoheader
|
||||
echo "Running autoconf ..."
|
||||
autoconf
|
||||
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
$srcdir/configure $conf_flags "$@" \
|
||||
&& echo Now type \`make\' to compile $PKG_NAME
|
||||
else
|
||||
echo Skipping configure process.
|
||||
fi
|
||||
|
||||
if which jade >/dev/null; then
|
||||
echo "Generate documentation ..."
|
||||
(cd doc && make)
|
||||
fi
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
libEtPan!
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
Windows Build:
|
||||
|
||||
This folder contains the suff needed for the Windows build.
|
||||
_________________________________________________________________
|
||||
|
||||
Build a version:
|
||||
|
||||
1. Open libetpan.sln with VC++ 7.1
|
||||
|
||||
2. Choose configuration Debug or Release
|
||||
|
||||
3. Build Solution
|
||||
|
||||
This will generate libetpan.dll and readmsg.exe and the include/libetpan
|
||||
folder. This folder, in combinaition with libetpan.lib, is needed for your
|
||||
Windows applications using the libetpan.dll.
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
Copy of headers:
|
||||
|
||||
The include folder is build by build_headers.bat, the dependence is not based on headers
|
||||
files themselves, but on a fake file, genarated after the .bat was executed (_headers_depends).
|
||||
So, if you modify original headers (in src), you need to remove this file to refresh the
|
||||
includes copy folder.
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
Supported drivers:
|
||||
|
||||
pop3
|
||||
imap
|
||||
nntp
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
TODO :
|
||||
|
||||
- support mmap
|
||||
- support dirent
|
||||
- support Berkeley DB cache
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#include "libetpan-config.h"
|
||||
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
@mkdir include
|
||||
@mkdir include\libetpan
|
||||
@for /F "eol=" %%i in (build_headers.list) do @copy "%%i" include\libetpan
|
||||
@echo "done" >_headers_depends
|
|
@ -1,159 +0,0 @@
|
|||
libetpan-config.h
|
||||
libetpan_version.h
|
||||
..\src\data-types\base64.h
|
||||
..\src\data-types\carray.h
|
||||
..\src\data-types\charconv.h
|
||||
..\src\data-types\chash.h
|
||||
..\src\data-types\cinthash.h
|
||||
..\src\data-types\clist.h
|
||||
..\src\data-types\connect.h
|
||||
..\src\data-types\hmac-md5.h
|
||||
..\src\data-types\mail.h
|
||||
..\src\data-types\maillock.h
|
||||
..\src\data-types\mailsasl.h
|
||||
..\src\data-types\mailsem.h
|
||||
..\src\data-types\mailstream.h
|
||||
..\src\data-types\mailstream_helper.h
|
||||
..\src\data-types\mailstream_low.h
|
||||
..\src\data-types\mailstream_socket.h
|
||||
..\src\data-types\mailstream_ssl.h
|
||||
..\src\data-types\mailstream_types.h
|
||||
..\src\data-types\mail_cache_db.h
|
||||
..\src\data-types\mail_cache_db_types.h
|
||||
..\src\data-types\mapping.h
|
||||
..\src\data-types\md5.h
|
||||
..\src\data-types\md5global.h
|
||||
..\src\data-types\mmapstring.h
|
||||
..\src\driver\implementation\data-message\data_message_driver.h
|
||||
..\src\driver\implementation\db\dbdriver.h
|
||||
..\src\driver\implementation\db\dbdriver_message.h
|
||||
..\src\driver\implementation\db\dbdriver_types.h
|
||||
..\src\driver\implementation\db\dbstorage.h
|
||||
..\src\driver\implementation\hotmail\hotmailstorage.h
|
||||
..\src\driver\implementation\imap\imapdriver.h
|
||||
..\src\driver\implementation\imap\imapdriver_cached.h
|
||||
..\src\driver\implementation\imap\imapdriver_cached_message.h
|
||||
..\src\driver\implementation\imap\imapdriver_message.h
|
||||
..\src\driver\implementation\imap\imapdriver_tools.h
|
||||
..\src\driver\implementation\imap\imapdriver_types.h
|
||||
..\src\driver\implementation\imap\imapstorage.h
|
||||
..\src\driver\implementation\maildir\maildirdriver.h
|
||||
..\src\driver\implementation\maildir\maildirdriver_cached.h
|
||||
..\src\driver\implementation\maildir\maildirdriver_cached_message.h
|
||||
..\src\driver\implementation\maildir\maildirdriver_message.h
|
||||
..\src\driver\implementation\maildir\maildirdriver_tools.h
|
||||
..\src\driver\implementation\maildir\maildirdriver_types.h
|
||||
..\src\driver\implementation\maildir\maildirstorage.h
|
||||
..\src\driver\implementation\mbox\mboxdriver.h
|
||||
..\src\driver\implementation\mbox\mboxdriver_cached.h
|
||||
..\src\driver\implementation\mbox\mboxdriver_cached_message.h
|
||||
..\src\driver\implementation\mbox\mboxdriver_message.h
|
||||
..\src\driver\implementation\mbox\mboxdriver_tools.h
|
||||
..\src\driver\implementation\mbox\mboxdriver_types.h
|
||||
..\src\driver\implementation\mbox\mboxstorage.h
|
||||
..\src\driver\implementation\mh\mhdriver.h
|
||||
..\src\driver\implementation\mh\mhdriver_cached.h
|
||||
..\src\driver\implementation\mh\mhdriver_cached_message.h
|
||||
..\src\driver\implementation\mh\mhdriver_message.h
|
||||
..\src\driver\implementation\mh\mhdriver_tools.h
|
||||
..\src\driver\implementation\mh\mhdriver_types.h
|
||||
..\src\driver\implementation\mh\mhstorage.h
|
||||
..\src\driver\implementation\mime-message\mime_message_driver.h
|
||||
..\src\driver\implementation\nntp\nntpdriver.h
|
||||
..\src\driver\implementation\nntp\nntpdriver_cached.h
|
||||
..\src\driver\implementation\nntp\nntpdriver_cached_message.h
|
||||
..\src\driver\implementation\nntp\nntpdriver_message.h
|
||||
..\src\driver\implementation\nntp\nntpdriver_tools.h
|
||||
..\src\driver\implementation\nntp\nntpdriver_types.h
|
||||
..\src\driver\implementation\nntp\nntpstorage.h
|
||||
..\src\driver\implementation\pop3\pop3driver.h
|
||||
..\src\driver\implementation\pop3\pop3driver_cached.h
|
||||
..\src\driver\implementation\pop3\pop3driver_cached_message.h
|
||||
..\src\driver\implementation\pop3\pop3driver_message.h
|
||||
..\src\driver\implementation\pop3\pop3driver_tools.h
|
||||
..\src\driver\implementation\pop3\pop3driver_types.h
|
||||
..\src\driver\implementation\pop3\pop3storage.h
|
||||
..\src\driver\interface\maildriver.h
|
||||
..\src\driver\interface\maildriver_errors.h
|
||||
..\src\driver\interface\maildriver_tools.h
|
||||
..\src\driver\interface\maildriver_types.h
|
||||
..\src\driver\interface\maildriver_types_helper.h
|
||||
..\src\driver\interface\mailfolder.h
|
||||
..\src\driver\interface\mailmessage.h
|
||||
..\src\driver\interface\mailmessage_tools.h
|
||||
..\src\driver\interface\mailmessage_types.h
|
||||
..\src\driver\interface\mailstorage.h
|
||||
..\src\driver\interface\mailstorage_tools.h
|
||||
..\src\driver\interface\mailstorage_types.h
|
||||
..\src\driver\tools\generic_cache.h
|
||||
..\src\driver\tools\generic_cache_types.h
|
||||
..\src\driver\tools\imfcache.h
|
||||
..\src\driver\tools\mailthread.h
|
||||
..\src\driver\tools\mailthread_types.h
|
||||
..\src\engine\mailengine.h
|
||||
..\src\engine\mailprivacy.h
|
||||
..\src\engine\mailprivacy_gnupg.h
|
||||
..\src\engine\mailprivacy_smime.h
|
||||
..\src\engine\mailprivacy_tools.h
|
||||
..\src\engine\mailprivacy_types.h
|
||||
..\src\low-level\imap\mailimap.h
|
||||
..\src\low-level\imap\mailimap_helper.h
|
||||
..\src\low-level\imap\mailimap_keywords.h
|
||||
..\src\low-level\imap\mailimap_parser.h
|
||||
..\src\low-level\imap\mailimap_print.h
|
||||
..\src\low-level\imap\mailimap_sender.h
|
||||
..\src\low-level\imap\mailimap_socket.h
|
||||
..\src\low-level\imap\mailimap_ssl.h
|
||||
..\src\low-level\imap\mailimap_types.h
|
||||
..\src\low-level\imap\mailimap_types_helper.h
|
||||
..\src\low-level\imap\mailimap_extension.h
|
||||
..\src\low-level\imap\mailimap_extension_types.h
|
||||
..\src\low-level\imap\annotatemore.h
|
||||
..\src\low-level\imap\annotatemore_parser.h
|
||||
..\src\low-level\imap\annotatemore_sender.h
|
||||
..\src\low-level\imap\annotatemore_types.h
|
||||
..\src\low-level\imap\acl.h
|
||||
..\src\low-level\imap\acl_parser.h
|
||||
..\src\low-level\imap\acl_types.h
|
||||
..\src\low-level\imap\acl_sender.h
|
||||
..\src\low-level\imap\uidplus.h
|
||||
..\src\low-level\imap\uidplus_types.h
|
||||
..\src\low-level\imf\mailimf.h
|
||||
..\src\low-level\imf\mailimf_types.h
|
||||
..\src\low-level\imf\mailimf_types_helper.h
|
||||
..\src\low-level\imf\mailimf_write.h
|
||||
..\src\low-level\imf\mailimf_write_file.h
|
||||
..\src\low-level\imf\mailimf_write_generic.h
|
||||
..\src\low-level\imf\mailimf_write_mem.h
|
||||
..\src\low-level\maildir\maildir.h
|
||||
..\src\low-level\maildir\maildir_types.h
|
||||
..\src\low-level\mbox\mailmbox.h
|
||||
..\src\low-level\mbox\mailmbox_parse.h
|
||||
..\src\low-level\mbox\mailmbox_types.h
|
||||
..\src\low-level\mh\mailmh.h
|
||||
..\src\low-level\mime\mailmime.h
|
||||
..\src\low-level\mime\mailmime_content.h
|
||||
..\src\low-level\mime\mailmime_decode.h
|
||||
..\src\low-level\mime\mailmime_disposition.h
|
||||
..\src\low-level\mime\mailmime_types.h
|
||||
..\src\low-level\mime\mailmime_types_helper.h
|
||||
..\src\low-level\mime\mailmime_write.h
|
||||
..\src\low-level\mime\mailmime_write_file.h
|
||||
..\src\low-level\mime\mailmime_write_generic.h
|
||||
..\src\low-level\mime\mailmime_write_mem.h
|
||||
..\src\low-level\nntp\newsnntp.h
|
||||
..\src\low-level\nntp\newsnntp_socket.h
|
||||
..\src\low-level\nntp\newsnntp_ssl.h
|
||||
..\src\low-level\nntp\newsnntp_types.h
|
||||
..\src\low-level\pop3\mailpop3.h
|
||||
..\src\low-level\pop3\mailpop3_helper.h
|
||||
..\src\low-level\pop3\mailpop3_socket.h
|
||||
..\src\low-level\pop3\mailpop3_ssl.h
|
||||
..\src\low-level\pop3\mailpop3_types.h
|
||||
..\src\low-level\smtp\mailsmtp.h
|
||||
..\src\low-level\smtp\mailsmtp_helper.h
|
||||
..\src\low-level\smtp\mailsmtp_socket.h
|
||||
..\src\low-level\smtp\mailsmtp_ssl.h
|
||||
..\src\low-level\smtp\mailsmtp_types.h
|
||||
..\src\main\libetpan.h
|
||||
..\src\windows\win_etpan.h
|
|
@ -1,80 +0,0 @@
|
|||
#ifndef LIBETPAN_CONFIG_H
|
||||
#define LIBETPAN_CONFIG_H
|
||||
|
||||
#ifdef WIN32
|
||||
# define PATH_MAX 512
|
||||
|
||||
// Windows API security level
|
||||
# define SECURITY_WIN32
|
||||
|
||||
# ifdef __cplusplus
|
||||
# define PropVariantInit __inline PropVariantInit
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4005 4141 )
|
||||
# endif
|
||||
|
||||
# include <tchar.h>
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# include <io.h>
|
||||
# include <Winsock2.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
# pragma warning( pop )
|
||||
# undef PropVariantInit
|
||||
# endif
|
||||
|
||||
# if !defined(snprintf)
|
||||
# define snprintf _snprintf
|
||||
# endif
|
||||
# if !defined(strncasecmp)
|
||||
# define strncasecmp _strnicmp
|
||||
# endif
|
||||
# if !defined(strcasecmp)
|
||||
# define strcasecmp _stricmp
|
||||
# endif
|
||||
|
||||
/* use Windows Types */
|
||||
# if !defined(ssize_t)
|
||||
typedef SSIZE_T ssize_t;
|
||||
# endif
|
||||
# if !defined(uint16_t)
|
||||
typedef UINT16 uint16_t;
|
||||
# endif
|
||||
# if !defined(uint32_t)
|
||||
typedef UINT32 uint32_t;
|
||||
# endif
|
||||
# if !defined(int32_t)
|
||||
typedef INT32 int32_t;
|
||||
# endif
|
||||
# if !defined(pid_t)
|
||||
typedef DWORD pid_t;
|
||||
# endif
|
||||
|
||||
# if !defined(caddr_t)
|
||||
typedef void * caddr_t;
|
||||
# endif
|
||||
|
||||
/* avoid config.h*/
|
||||
# define CONFIG_H
|
||||
#endif // WIN32
|
||||
|
||||
#include <limits.h>
|
||||
#ifdef _MSC_VER
|
||||
# define MMAP_UNAVAILABLE
|
||||
# define inline __inline
|
||||
#else
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#define MAIL_DIR_SEPARATOR '/'
|
||||
#define MAIL_DIR_SEPARATOR_S "/"
|
||||
#ifdef _MSC_VER
|
||||
# ifdef LIBETPAN_DLL
|
||||
# define LIBETPAN_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define LIBETPAN_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define LIBETPAN_EXPORT
|
||||
#endif
|
||||
#endif
|
|
@ -1,38 +0,0 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libetpan", "libetpan\libetpan.vcproj", "{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readmsg", "readmsg\readmsg.vcproj", "{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE} = {BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smtpsend", "smtpsend\smtpsend.vcproj", "{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug.ActiveCfg = Debug|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Debug.Build.0 = Debug|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release.ActiveCfg = Release|Win32
|
||||
{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}.Release.Build.0 = Release|Win32
|
||||
{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Debug.ActiveCfg = Debug|Win32
|
||||
{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Debug.Build.0 = Debug|Win32
|
||||
{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Release.ActiveCfg = Release|Win32
|
||||
{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}.Release.Build.0 = Release|Win32
|
||||
{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Debug.ActiveCfg = Debug|Win32
|
||||
{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Debug.Build.0 = Debug|Win32
|
||||
{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Release.ActiveCfg = Release|Win32
|
||||
{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,850 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="libetpan"
|
||||
ProjectGUID="{BA4DED3C-E56F-4484-BFC3-9C13E461A1BE}"
|
||||
RootNamespace="libetpan"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
InlineFunctionExpansion="0"
|
||||
AdditionalIncludeDirectories="../include;../include/libetpan"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBETPAN_DLL"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"
|
||||
ForcedIncludeFiles="../StdAfx.h"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/DLL"
|
||||
AdditionalDependencies="oldnames.lib Ws2_32.lib mswsock.lib"
|
||||
OutputFile="../Debug/libetpan.dll"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreDefaultLibraryNames="C"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/libetpan.pdb"
|
||||
MapExports="TRUE"
|
||||
SubSystem="0"
|
||||
ImportLibrary="../Debug/libetpan.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../include;../include/libetpan"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBETPAN_DLL"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="0"
|
||||
CompileAs="1"
|
||||
ForcedIncludeFiles="../StdAfx.h"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/DLL"
|
||||
AdditionalDependencies="oldnames.lib Ws2_32.lib mswsock.lib"
|
||||
OutputFile="../Release/libetpan.dll"
|
||||
LinkIncremental="2"
|
||||
IgnoreDefaultLibraryNames="C"
|
||||
GenerateDebugInformation="FALSE"
|
||||
SubSystem="0"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
ImportLibrary="../Release/libetpan.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\build_headers.list">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="cd ..
|
||||
build_headers.bat
|
||||
"
|
||||
Outputs="$(InputDir)\_headers_depends"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="cd ..
|
||||
build_headers.bat
|
||||
"
|
||||
Outputs="$(InputDir)\_headers_depends"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<Filter
|
||||
Name="engine"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\engine\mailengine.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\engine\mailprivacy.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\engine\mailprivacy_gnupg.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\engine\mailprivacy_smime.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\engine\mailprivacy_tools.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="datatypes"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\base64.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\carray.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\charconv.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\chash.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\cinthash.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\clist.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\connect.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mail_cache_db.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\maillock.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mailsem.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mailstream.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mailstream_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mailstream_low.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mailstream_socket.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mailstream_ssl.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mapping.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\md5.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\data-types\mmapstring.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="low-level"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="imap"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_keywords.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_parser.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_print.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_sender.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_socket.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_ssl.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_types_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\mailimap_extension.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\annotatemore.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\annotatemore_sender.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\annotatemore_types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\annotatemore_parser.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\acl.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\acl_sender.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\acl_types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imap\acl_parser.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="pop3"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\pop3\mailpop3.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\pop3\mailpop3_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\pop3\mailpop3_socket.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\pop3\mailpop3_ssl.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mime"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_content.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_decode.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_disposition.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_types_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_write.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_write_file.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_write_generic.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mime\mailmime_write_mem.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="imf"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imf\mailimf.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imf\mailimf_types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imf\mailimf_types_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imf\mailimf_write.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imf\mailimf_write_file.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imf\mailimf_write_generic.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\imf\mailimf_write_mem.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="maildir"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\maildir\maildir.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mbox"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mbox\mailmbox.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mbox\mailmbox_parse.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mbox\mailmbox_types.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mh"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\mh\mailmh.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="nntp"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\nntp\newsnntp.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\nntp\newsnntp_socket.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\nntp\newsnntp_ssl.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="smtp"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\smtp\mailsmtp.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\smtp\mailsmtp_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\smtp\mailsmtp_socket.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\low-level\smtp\mailsmtp_ssl.c">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="driver"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="interface"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\maildriver.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\maildriver_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\maildriver_types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\maildriver_types_helper.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\mailfolder.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\mailmessage.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\mailmessage_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\mailmessage_types.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\mailstorage.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\interface\mailstorage_tools.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="implementation"
|
||||
Filter="">
|
||||
<Filter
|
||||
Name="data-message"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\data-message\data_message_driver.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="db"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\db\dbdriver.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\db\dbdriver_message.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\db\dbstorage.c">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="hotmail"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\hotmail\hotmailstorage.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="imap"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\imap\imapdriver.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\imap\imapdriver_cached.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\imap\imapdriver_cached_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\imap\imapdriver_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\imap\imapdriver_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\imap\imapstorage.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="maildir"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\maildir\maildirdriver.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_cached.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_cached_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\maildir\maildirdriver_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\maildir\maildirstorage.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mbox"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mbox\mboxdriver.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_cached.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_cached_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mbox\mboxdriver_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mbox\mboxstorage.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mh"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mh\mhdriver.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mh\mhdriver_cached.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mh\mhdriver_cached_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mh\mhdriver_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mh\mhdriver_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mh\mhstorage.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mime-message"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\mime-message\mime_message_driver.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="nntp"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\nntp\nntpdriver.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_cached.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_cached_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\nntp\nntpdriver_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\nntp\nntpstorage.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="pop3"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\pop3\pop3driver.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\pop3\pop3driver_cached.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\pop3\pop3driver_cached_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\pop3\pop3driver_message.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\pop3\pop3driver_tools.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\implementation\pop3\pop3storage.c">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="tools"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\driver\tools\generic_cache.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\tools\imfcache.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\tools\mailthread.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\driver\tools\mailthread_types.c">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Windows"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\src\windows\dirent.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\windows\misc.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\windows\mmap.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\windows\time_r.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\windows\wsocket.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="2"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
CompileAs="2"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\libetpan-config.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\libetpan_version.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\StdAfx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: libetpan_version.h.in,v 1.3 2004/10/17 23:18:03 g_roualland Exp $
|
||||
*/
|
||||
|
||||
#ifndef LIBETPAN_VERSION_H
|
||||
|
||||
#define LIBETPAN_VERSION_H
|
||||
|
||||
#ifndef LIBETPAN_VERSION_MAJOR
|
||||
#define LIBETPAN_VERSION_MAJOR 0
|
||||
#endif
|
||||
|
||||
#ifndef LIBETPAN_VERSION_MINOR
|
||||
#define LIBETPAN_VERSION_MINOR 48
|
||||
#endif
|
||||
|
||||
#ifndef LIBETPAN_REENTRANT
|
||||
#if 1
|
||||
#define LIBETPAN_REENTRANT 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int libetpan_get_version_major(void);
|
||||
int libetpan_get_version_minor(void);
|
||||
|
||||
#endif
|
|
@ -1,170 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="readmsg"
|
||||
ProjectGUID="{5FEA913A-5CE4-4DEB-B6BE-B8EA1BF6F653}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_MBCS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"
|
||||
ForcedIncludeFiles="../../StdAfx.h"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libetpan.lib"
|
||||
OutputFile="../Debug/readmsg.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\Debug"
|
||||
IgnoreDefaultLibraryNames="C"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/readmsg.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="0"
|
||||
ForcedIncludeFiles="../StdAfx.h"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libetpan.lib"
|
||||
OutputFile="../Release/readmsg.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\Release"
|
||||
IgnoreDefaultLibraryNames="C"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\src\bsd\getopt.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\bsd\getopt_long.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tests\Makefile">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tests\option-parser.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tests\readmsg-common.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tests\readmsg.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,164 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="smtpsend"
|
||||
ProjectGUID="{FF9F45C9-74A0-4B4E-99E9-6ADE0EB6D8AC}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_MBCS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"
|
||||
ForcedIncludeFiles="../../StdAfx.h"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libetpan.lib"
|
||||
OutputFile="../Debug/smtpsend.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\Debug"
|
||||
IgnoreDefaultLibraryNames="C"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/smtpsend.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../include/libetpan/;../include;../../src/gnu"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="0"
|
||||
ForcedIncludeFiles="../StdAfx.h"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libetpan.lib"
|
||||
OutputFile="../Release/smtpsend.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\Release"
|
||||
IgnoreDefaultLibraryNames="C"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\..\src\bsd\getopt.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\bsd\getopt_long.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tests\Makefile">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tests\smtpsend.c">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,3 +0,0 @@
|
|||
#! /bin/sh
|
||||
./configure "$@" --disable-shared --with-pic
|
||||
|
|
@ -1,483 +0,0 @@
|
|||
dnl Process this file with autoconf to create configure
|
||||
dnl $Id: configure.in,v 1.68 2006/10/26 18:02:59 alfie Exp $
|
||||
|
||||
AC_INIT(src/main/libetpan_version.h.in)
|
||||
|
||||
dnl Version major and minor
|
||||
VERSION_MAJOR=0
|
||||
VERSION_MINOR=48
|
||||
|
||||
dnl API version
|
||||
dnl 1. If you have changed any of the sources for this library, the revision
|
||||
dnl number must be incremented. This is a new revision of the current
|
||||
dnl interface.
|
||||
dnl 2. If the interface has changed, then current must be incremented, and
|
||||
dnl revision reset to `0'. This is the first revision of a new interface.
|
||||
dnl 3. If the new interface is a superset of the previous interface (that is,
|
||||
dnl if the previous interface has not been broken by the changes in this new
|
||||
dnl release), then age must be incremented. This release is backwards
|
||||
dnl compatible with the previous release.
|
||||
dnl 4. If the new interface has removed elements with respect to the previous
|
||||
dnl interface, then you have broken backward compatibility and age must be
|
||||
dnl reset to `0'. This release has a new, but backwards incompatible
|
||||
dnl interface.
|
||||
API_CURRENT=10
|
||||
API_REVISION=0
|
||||
API_COMPATIBILITY=10
|
||||
|
||||
API_AGE=`expr $API_CURRENT - $API_COMPATIBILITY`
|
||||
API_VERSION="$API_CURRENT:$API_REVISION:$API_AGE"
|
||||
AC_SUBST(API_VERSION)
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug setup flags (gcc) for debugging (default=no)],
|
||||
CFLAGS="$CFLAGS -g"
|
||||
CPPFLAGS="$CPPFLAGS -DDEBUG"
|
||||
LDFLAGS="$LDFLAGS",)
|
||||
AC_ARG_ENABLE(optim, [ --enable-optim setup flags (gcc) for optimizations (default=no)],
|
||||
if test "x$enable_debug" != "xyes" ; then
|
||||
CFLAGS="$CFLAGS -O2 -ffast-math -funroll-loops -g0"
|
||||
CPPFLAGS="$CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS -s"
|
||||
else
|
||||
AC_MSG_WARN([enable-optim and enable-debug are incompatible -- disabling optimizations])
|
||||
fi,)
|
||||
CFLAGS="$CFLAGS"
|
||||
AC_ARG_ENABLE(syntax, [ --enable-unstrict-syntax be lazy on syntax checking for protocols (default=no)], , [AC_DEFINE(UNSTRICT_SYNTAX, 1, [Define to be lazy on protocol syntax])])
|
||||
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
AH_VERBATIM([CONFIG_H_FIRST], [/* Check for Linux's /usr/include/features.h
|
||||
*/
|
||||
#ifdef _FEATURES_H
|
||||
# error config.h must be first file included
|
||||
#endif])
|
||||
|
||||
AC_C_INLINE
|
||||
|
||||
dnl Programs
|
||||
AC_PROG_CC
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl Can't use AC_PROG_INSTALL
|
||||
INSTALL='$(SHELL) $(top_builddir)/install-sh -c'
|
||||
AC_SUBST(INSTALL)
|
||||
|
||||
dnl Headers
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h sys/types.h sys/stat.h sys/mman.h limits.h)
|
||||
AC_CHECK_HEADERS(netdb.h netinet/in.h sys/socket.h)
|
||||
AC_CHECK_HEADERS(sys/param.h sys/select.h inttypes.h)
|
||||
|
||||
dnl Functions
|
||||
AC_FUNC_MMAP
|
||||
|
||||
dnl Network libs
|
||||
AC_CHECK_FUNC(connect, checksocket=no, checksocket=yes)
|
||||
if test "x$checksocket" = "xyes"; then
|
||||
case "x$LIBS" in
|
||||
*-lsocket*);;
|
||||
*) AC_CHECK_LIB(socket, connect) ;;
|
||||
esac
|
||||
fi
|
||||
AC_CHECK_FUNC(inet_ntoa, checknsl=no, checknsl=yes)
|
||||
if test "x$checknsl" = "xyes"; then
|
||||
case "x$LIBS" in
|
||||
*-lnsl*);;
|
||||
*) AC_CHECK_LIB(nsl, inet_ntoa) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl OpenSSL -- very primitive right now
|
||||
AC_ARG_WITH(openssl, [ --with-openssl[=DIR] include OpenSSL support (default=auto)],
|
||||
[], [with_openssl=yes])
|
||||
if test "x$with_openssl" != "xno"; then
|
||||
OCPPFLAGS="$CPPFLAGS"
|
||||
OLDFLAGS="$LDFLAGS"
|
||||
if test "x$with_openssl" != "xyes" ; then
|
||||
CPPFLAGS="$CPPFLAGS -I$with_openssl/include"
|
||||
LDFLAGS="$LDFLAGS -L$with_openssl/lib"
|
||||
fi
|
||||
with_openssl=no
|
||||
SSLLIBS=""
|
||||
AC_CHECK_HEADER(openssl/ssl.h, [
|
||||
AC_CHECK_LIB(rsaref, main, [SSLLIBS="-lrsaref"])
|
||||
AC_CHECK_LIB(crypto, main, [SSLLIBS="-lcrypto $SSLLIBS"], [], [$SSLLIBS])
|
||||
AC_CHECK_LIB(ssl, SSL_library_init, with_openssl=yes, [], [$SSLLIBS])])
|
||||
if test "x$with_openssl" != "xyes"; then
|
||||
CPPFLAGS="$OCPPFLAGS"
|
||||
LDFLAGS="$OLDFLAGS"
|
||||
else
|
||||
with_gnutls="no"
|
||||
fi
|
||||
fi
|
||||
if test "x$with_openssl" = "xyes"; then
|
||||
AC_DEFINE([USE_SSL], 1, [Define to use OpenSSL])
|
||||
SSLLIBS="-lssl $SSLLIBS"
|
||||
else
|
||||
SSLLIBS=""
|
||||
fi
|
||||
AC_SUBST(SSLLIBS)
|
||||
|
||||
dnl GNUTLS
|
||||
AC_ARG_WITH(gnutls, [ --with-gnutls[=DIR] include GnuTLS support (default=auto)],
|
||||
[], [with_gnutls=no])
|
||||
if test "x$with_gnutls" != "xno"; then
|
||||
OCPPFLAGS="$CPPFLAGS"
|
||||
OLDFLAGS="$LDFLAGS"
|
||||
if test "x$with_gnutls" != "xyes" ; then
|
||||
CPPFLAGS="CRPPFLAGS -I$with_gnutls/include"
|
||||
LDFLAGS="$LDFLAGS -L$with_gnutls/lib"
|
||||
fi
|
||||
GNUTLSLIB=""
|
||||
AC_CHECK_HEADER(gnutls/gnutls.h, [
|
||||
AC_CHECK_LIB(gnutls, gnutls_global_deinit, with_gnutls=yes, [GNUTLSLIB="-lgnutls"])
|
||||
])
|
||||
if test "x$with_gnutls" != "xyes"; then
|
||||
CPPFLAGS="$OCPPFLAGS"
|
||||
LDFLAGS="$OLDFLAGS"
|
||||
else
|
||||
with_openssl="no"
|
||||
fi
|
||||
fi
|
||||
if test "x$with_gnutls" = "xyes"; then
|
||||
AC_DEFINE([USE_GNUTLS],1, [Define to use GnuTLS])
|
||||
AC_DEFINE([USE_SSL], 1, [Define to use OpenSSL])
|
||||
GNUTLSLIB="-lgnutls"
|
||||
else
|
||||
GNUTLSLIB=""
|
||||
fi
|
||||
AC_SUBST(GNUTLSLIB)
|
||||
|
||||
if test "x$with_openssl" = "xno"; then
|
||||
if test "x$with_gnutls" = "xno"; then
|
||||
AC_MSG_WARN([OpenSSL support disabled.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl iconv
|
||||
LIBICONV=""
|
||||
|
||||
AC_ARG_ENABLE(iconv,
|
||||
[ --disable-iconv make a version not using iconv],
|
||||
enable_iconv=no, enable_iconv=yes)
|
||||
if test x$enable_iconv = xyes; then
|
||||
dnl get prototype
|
||||
AC_CHECK_HEADER(iconv.h, [ICONV_HEADER=1], [ICONV_HEADER=0])
|
||||
|
||||
ICONV_PROTO=no
|
||||
AC_MSG_CHECKING([checking iconv() prototype])
|
||||
if test "x$ICONV_HEADER" = x1 ; then
|
||||
SAVED_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-std=c99 $CPPFLAGS"
|
||||
AC_TRY_COMPILE([#include <iconv.h>
|
||||
size_t iconv (iconv_t cd, char ** restrict inbuf,
|
||||
size_t * restrict inbytesleft,
|
||||
char ** restrict outbuf,
|
||||
size_t * restrict outbytesleft);],
|
||||
[],
|
||||
[ICONV_PROTO=noconst]
|
||||
[])
|
||||
AC_TRY_COMPILE([#include <iconv.h>
|
||||
size_t iconv (iconv_t cd, const char ** restrict inbuf,
|
||||
size_t * restrict inbytesleft,
|
||||
char ** restrict outbuf,
|
||||
size_t * restrict outbytesleft);],
|
||||
[],
|
||||
[ICONV_PROTO=const]
|
||||
[])
|
||||
CPPFLAGS="$SAVED_CPPFLAGS"
|
||||
fi
|
||||
|
||||
dnl try to link
|
||||
ICONV_LINKED=NO
|
||||
if test "$ICONV_PROTO" != "xno" ; then
|
||||
AC_MSG_RESULT([ok])
|
||||
|
||||
AC_MSG_CHECKING([for iconv])
|
||||
|
||||
ICONV_LINKED=0
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
[ICONV_LINKED=1],
|
||||
[])
|
||||
for lib in iconv ; do
|
||||
if test "x$ICONV_LINKED" = "x0" ; then
|
||||
LIBS=-l$lib
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
[LIBICONV="$LIBS" ; ICONV_LINKED=1],
|
||||
[])
|
||||
fi
|
||||
done
|
||||
LIBS=""
|
||||
|
||||
if test "x$ICONV_LINKED" = "x1" ; then
|
||||
AC_MSG_RESULT([found])
|
||||
else
|
||||
AC_MSG_RESULT([not found])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([failed])
|
||||
fi
|
||||
|
||||
if test "x$ICONV_LINKED" = "x1" ; then
|
||||
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
||||
fi
|
||||
|
||||
ICONV_PROTO_CONST=0
|
||||
if test "x$ICONV_PROTO" = "xconst" ; then
|
||||
AC_DEFINE_UNQUOTED(HAVE_ICONV_PROTO_CONST, 1,
|
||||
[prototype of iconv() has const parameters])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(LIBICONV)
|
||||
|
||||
dnl Berkeley DB
|
||||
|
||||
DBVERS=0
|
||||
DBLINKED=0
|
||||
DBLIB=""
|
||||
|
||||
AC_ARG_ENABLE(db, [ --disable-db disable Berkeley DB (default=try to detect DB)],[enable_db=$enableval],[enable_db=yes])
|
||||
|
||||
dnl Check for a presence of Berkeley DB header
|
||||
if test "x$enable_db" != "xyes"; then
|
||||
AC_MSG_WARN(cache support disabled)
|
||||
else
|
||||
AC_CHECK_HEADER(db.h, [DB_HEADER=1], [DB_HEADER=0])
|
||||
fi
|
||||
|
||||
if test "x$DB_HEADER" = "x1"; then
|
||||
dnl Check for version of Berkeley DB
|
||||
AC_MSG_CHECKING([version of Berkeley DB])
|
||||
|
||||
dnl check for version 3 and above
|
||||
AC_TRY_COMPILE(
|
||||
[#include <db.h>],
|
||||
[#if DB_VERSION_MAJOR < 3
|
||||
#error DB version 3 or above needed
|
||||
#endif],
|
||||
[DBVERS=3]
|
||||
[])
|
||||
|
||||
dnl check for version 2
|
||||
if test "x$DBVERS" = "x0"; then
|
||||
AC_TRY_COMPILE([#include <db.h>],
|
||||
[#if DB_VERSION_MAJOR != 2
|
||||
#error DB version 2 needed
|
||||
#endif],
|
||||
[DBVERS=2]
|
||||
[])
|
||||
fi
|
||||
|
||||
if test "x$DBVERS" = "x0"; then
|
||||
dnl assume version 1
|
||||
DBVERS=1
|
||||
fi
|
||||
|
||||
dnl test linkage with Berkeley DB
|
||||
|
||||
dnl Look for db3 or superior with db_create call
|
||||
case "$DBVERS" in
|
||||
3)
|
||||
AC_MSG_RESULT([version 3.x or above])
|
||||
for lib in db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db-3.2 db-3 db3 db; do
|
||||
if test "x$DBLINKED" = "x0"; then
|
||||
dnl AC_CHECK_LIB($lib, db_create, [DBLIB="-l$lib"; DBLINKED=1], [])
|
||||
dnl installations of libdb4 function names are defined in db.h
|
||||
dnl to other symbols
|
||||
AC_MSG_CHECKING([for db_create() in -l$lib])
|
||||
LIBS=-l$lib
|
||||
AC_TRY_LINK(
|
||||
[#include <db.h>],
|
||||
[db_create(0,0,0)],
|
||||
[DBLIB="-l$lib"; DBLINKED=1; AC_MSG_RESULT([found])],
|
||||
[AC_MSG_RESULT([not found])])
|
||||
fi
|
||||
done
|
||||
LIBS=""
|
||||
;;
|
||||
|
||||
dnl Look for db2 with db_open call
|
||||
2)
|
||||
AC_MSG_RESULT([version 2.x])
|
||||
for lib in db2 db; do
|
||||
if test "x$DBLINKED" = "x0"; then
|
||||
AC_CHECK_LIB($lib, db_open, [DBLIB="-l$lib"; DBLINKED=1], [])
|
||||
fi
|
||||
done
|
||||
;;
|
||||
|
||||
*)
|
||||
dnl Look for db1 with dbopen call in -ldb or in libc (bsds)
|
||||
AC_MSG_RESULT([version 1.x])
|
||||
AC_CHECK_FUNC(dbopen, [DBLINKED=1], [])
|
||||
for lib in db-1 db1 db; do
|
||||
if test "x$DBLINKED" = "x0"; then
|
||||
AC_CHECK_LIB($lib, dbopen, [DBLIB="-l$lib"; DBLINKED=1], [])
|
||||
fi
|
||||
done
|
||||
;;
|
||||
dnl fi
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$DBLINKED" = "x0"; then
|
||||
DBVERS=0
|
||||
if test "x$enable_db" = "xyes"; then
|
||||
AC_MSG_WARN(cache support disabled (Berkeley DB is missing).)
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(DBVERS, $DBVERS,
|
||||
[Define to detected Berkeley DB major version number])
|
||||
AC_SUBST(DBLIB)
|
||||
|
||||
dnl Threading support, if enabled
|
||||
AC_ARG_ENABLE(threads, [ --disable-threads do not include multithreading support using pthread],,[enable_threads=yes])
|
||||
|
||||
if test "x$enable_threads" = "xyes"; then
|
||||
dnl Try to find a good CFLAGS/LDFLAGS for pthreads
|
||||
AC_CHECK_HEADERS(pthread.h, [], [AC_MSG_ERROR([pthread support required])])
|
||||
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
|
||||
checkpthread=yes
|
||||
|
||||
AC_MSG_CHECKING([for pthread_create with libc])
|
||||
AC_TRY_LINK([], [pthread_create();],
|
||||
[pthflag=yes; checkpthread=no],
|
||||
[pthflag=no])
|
||||
AC_MSG_RESULT($pthflag)
|
||||
|
||||
for flag in "pthreads" "pthread"; do
|
||||
if test "x$checkpthread" = "xyes"; then
|
||||
AC_MSG_CHECKING([for pthread_create with -$flag])
|
||||
OLDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="-$flag $LDFLAGS"
|
||||
AC_TRY_LINK([], [pthread_create();],
|
||||
[pthflag=yes; checkpthread=no],
|
||||
[pthflag=no; LDFLAGS="$OLDCFLAGS"])
|
||||
AC_MSG_RESULT($pthflag)
|
||||
fi
|
||||
done
|
||||
|
||||
for lib in "c_r" "pthread"; do
|
||||
if test "x$checkpthread" = "xyes"; then
|
||||
case "x$LIBS" in
|
||||
*-l$lib*);;
|
||||
*) AC_CHECK_LIB($lib, pthread_create, [LIBS="$LIBS -l$lib"; checkpthread=no]) ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
if test "x$checkpthread" = "xyes"; then
|
||||
AC_CHECK_FUNC(pthread_create, checkpthread=no)
|
||||
text "x$checkpthread" = "xyes" && AC_MSG_ERROR([pthread library required])
|
||||
fi
|
||||
AC_DEFINE([LIBETPAN_REENTRANT], 1, [Define to include multithreading support])
|
||||
LIBSUFFIX=
|
||||
REENTRANT=1
|
||||
else
|
||||
REENTRANT=0
|
||||
LIBSUFFIX=-no-mt
|
||||
fi
|
||||
AC_SUBST(LIBSUFFIX)
|
||||
AC_SUBST(REENTRANT)
|
||||
|
||||
dnl liblockfile on debian systems
|
||||
AC_CHECK_LIB(lockfile, lockfile_create)
|
||||
|
||||
AC_DEFINE_UNQUOTED(LIBETPAN_VERSION_MAJOR, $VERSION_MAJOR,
|
||||
[Define this to the major version of libEtPan])
|
||||
AC_DEFINE_UNQUOTED(LIBETPAN_VERSION_MINOR, $VERSION_MINOR,
|
||||
[Define this to the minor version of libEtPan])
|
||||
AC_SUBST(VERSION_MAJOR)
|
||||
AC_SUBST(VERSION_MINOR)
|
||||
|
||||
dnl Cyrus SASL
|
||||
AC_ARG_WITH(sasl, [ --with-sasl[=DIR] include SASL support (default=auto)],
|
||||
[], [with_sasl=yes])
|
||||
if test "x$with_sasl" != "xno"; then
|
||||
OCPPFLAGS="$CPPFLAGS"
|
||||
OLDFLAGS="$LDFLAGS"
|
||||
if test "x$with_sasl" != "xyes" ; then
|
||||
CPPFLAGS="$CPPFLAGS -I$with_sasl/include"
|
||||
LDFLAGS="$LDFLAGS -L$with_sasl/lib"
|
||||
fi
|
||||
with_sasl=no
|
||||
SASLLIBS=""
|
||||
AC_CHECK_HEADER(sasl/sasl.h, [
|
||||
AC_CHECK_LIB(sasl2, sasl_client_init, with_sasl=yes, [], [$SASLLIBS])])
|
||||
if test "x$with_sasl" != "xyes"; then
|
||||
CPPFLAGS="$OCPPFLAGS"
|
||||
LDFLAGS="$OLDFLAGS"
|
||||
fi
|
||||
fi
|
||||
if test "x$with_sasl" = "xyes"; then
|
||||
AC_DEFINE([USE_SASL], 1, [Define to use SASL])
|
||||
SASLLIBS="-lsasl2 $SASLLIBS"
|
||||
else
|
||||
AC_MSG_WARN([SASL support disabled.])
|
||||
SASLLIBS=""
|
||||
fi
|
||||
AC_SUBST(SASLLIBS)
|
||||
|
||||
dnl IPv6 support
|
||||
AC_ARG_ENABLE(ipv6, AC_HELP_STRING([--disable-ipv6], [enable IPv6 support (default=yes)]), , enable_ipv6=no)
|
||||
AC_MSG_CHECKING([whether to use IPv6])
|
||||
AC_MSG_RESULT($enable_ipv6)
|
||||
if test "x$enable_ipv6" = "xyes"; then
|
||||
AC_DEFINE(HAVE_IPV6, 1, [Define to enable IPv6 support.])
|
||||
|
||||
dnl check for IPv6 support
|
||||
AC_MSG_CHECKING([for IPv6 support])
|
||||
AC_TRY_COMPILE([#define INET6
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>],
|
||||
[int x = IPPROTO_IPV6; struct in6_addr a;],
|
||||
ipv6_support=yes, ipv6_support=no)
|
||||
AC_MSG_RESULT($ipv6_support)
|
||||
|
||||
if test "x$ipv6_support" = "xyes"; then
|
||||
|
||||
dnl check for getaddrinfo and freeaddrinfo function presence
|
||||
for func in "getaddrinfo" "freeaddrinfo"; do
|
||||
AC_MSG_CHECKING([for $func])
|
||||
AC_TRY_LINK([], [$func();],
|
||||
[func_present=yes],
|
||||
[func_present=no])
|
||||
AC_MSG_RESULT($func_present)
|
||||
|
||||
if test "x$func_present" = "xno"; then
|
||||
AC_MSG_ERROR([$func function required for IPv6 support])
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
AC_MSG_ERROR([cannot enable IPv6 support])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl Version
|
||||
VERSION="$VERSION_MAJOR.$VERSION_MINOR"
|
||||
test -d CVS && VERSION="$VERSION-dev-"`date +'%Y%m%d'`
|
||||
AC_DEFINE_UNQUOTED(LIBETPAN_VERSION, "$VERSION",
|
||||
[Define this to the version of libEtPan])
|
||||
AC_SUBST(VERSION)
|
||||
|
||||
|
||||
AC_OUTPUT(Makefile \
|
||||
Rules \
|
||||
libetpan-config \
|
||||
src/Makefile \
|
||||
src/main/libetpan_version.h \
|
||||
)
|
||||
|
||||
cp -f src/main/libetpan_version.h build-windows
|
|
@ -1,6 +0,0 @@
|
|||
API
|
||||
API.html
|
||||
API.txt
|
||||
README
|
||||
README.html
|
||||
README.txt
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,139 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Introduction</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Tools and datatypes"
|
||||
HREF="c16.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="AEN13"
|
||||
></A
|
||||
>Chapter 1. Introduction</H1
|
||||
><P
|
||||
> This document will describe the API of libEtPan!
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>libEtPan! API</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Tools and datatypes</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,303 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>MIME</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Rendering of messages"
|
||||
HREF="x1556.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Data types"
|
||||
HREF="x1614.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x1556.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x1614.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="AEN1586"
|
||||
></A
|
||||
>Chapter 4. MIME</H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="c1586.htm#AEN1598"
|
||||
>Quick start</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x1614.htm"
|
||||
>Data types</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x2180.htm"
|
||||
>Parser functions</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x2583.htm"
|
||||
>Rendering of MIME parts</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x2669.htm"
|
||||
>Creation functions</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x2946.htm"
|
||||
>Helper functions</A
|
||||
></DT
|
||||
></DL
|
||||
></DIV
|
||||
><P
|
||||
> libEtPan! implements a MIME message parser (also known as
|
||||
messages with attachments or
|
||||
multipart messages). This also allows to generate MIME messages.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="WARNING"
|
||||
><P
|
||||
></P
|
||||
><TABLE
|
||||
CLASS="WARNING"
|
||||
BORDER="1"
|
||||
WIDTH="100%"
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="CENTER"
|
||||
><B
|
||||
>Warning</B
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="LEFT"
|
||||
><P
|
||||
> All allocation functions will take as argument allocated data
|
||||
and will store these data in the structure they will allocate.
|
||||
Data should be persistant during all the use of the structure
|
||||
and will be freed by the free function of the structure
|
||||
</P
|
||||
><P
|
||||
> allocation functions will return <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> on failure
|
||||
|
||||
functions returning integer will be returning one of the
|
||||
following error code:
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_NO_ERROR</B
|
||||
>,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_PARSE</B
|
||||
>,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_MEMORY</B
|
||||
>,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_INVAL</B
|
||||
>,
|
||||
or <B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_FILE</B
|
||||
>.
|
||||
</P
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN1598"
|
||||
>Quick start</A
|
||||
></H1
|
||||
><P
|
||||
> You will need this module when you want to parse a MIME
|
||||
message.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN1601"
|
||||
>Parse MIME message</A
|
||||
></H2
|
||||
><P
|
||||
> You will use the following function :
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_parse</B
|
||||
>
|
||||
(<A
|
||||
HREF="x1094.htm#MAILIMF-ENVELOPE-AND-OPTIONAL-FIELDS-PARSE"
|
||||
>the Section called <I
|
||||
>mailimf_envelope_and_optional_fields_parse</I
|
||||
> in Chapter 3</A
|
||||
>)
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN1609"
|
||||
>Render the MIME message</A
|
||||
></H2
|
||||
><P
|
||||
> Build your MIME message, then use
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_write</B
|
||||
>
|
||||
(<A
|
||||
HREF="x2583.htm#MAILMIME-WRITE"
|
||||
>the Section called <I
|
||||
>mailmime_write</I
|
||||
></A
|
||||
>)
|
||||
to render a MIME message.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x1556.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x1614.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Rendering of messages</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Data types</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,629 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Tools and datatypes</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Introduction"
|
||||
HREF="c13.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="List"
|
||||
HREF="x88.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c13.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x88.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="AEN16"
|
||||
></A
|
||||
>Chapter 2. Tools and datatypes</H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="c16.htm#AEN19"
|
||||
>Array</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x88.htm"
|
||||
>List</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x161.htm"
|
||||
>Hash table</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x229.htm"
|
||||
>Buffered I/O</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x289.htm"
|
||||
>non-buffered I/O</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x312.htm"
|
||||
>strings</A
|
||||
></DT
|
||||
></DL
|
||||
></DIV
|
||||
><P
|
||||
> libEtPan! include a collection of datatypes such as lists,
|
||||
arrays, hash tables and tools such as buffered I/O.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN19"
|
||||
>Array</A
|
||||
></H1
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
typedef struct carray_s carray;
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray</B
|
||||
> is an array of pointers that will
|
||||
resize automatically in case a new element is added.
|
||||
</P
|
||||
><P
|
||||
>
|
||||
The <B
|
||||
CLASS="COMMAND"
|
||||
>carray</B
|
||||
> is implemented with an array
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>(void **)</B
|
||||
> that can be resized. An array has a
|
||||
size: this is the number of elements that can be added before
|
||||
the table is resized. It also has a count of elements: this is
|
||||
the elements that exist in the array.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CARRAY-NEW"
|
||||
>carray_new and carray_free</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>carray * carray_new(unsigned int initsize);
|
||||
|
||||
void carray_free(carray * array);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_new()</B
|
||||
> creates a new array with an
|
||||
initial size. The array is not resized until the number of
|
||||
element reach the initial size. It returns
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> in case of failure.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_free()</B
|
||||
> releases memory used by the
|
||||
given array.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN35"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-1. carray creation</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define SIZE 50
|
||||
|
||||
int main(void)
|
||||
{
|
||||
carray * a;
|
||||
|
||||
a = carray_new(SIZE);
|
||||
if (a == NULL)
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
/* do things here */
|
||||
|
||||
carray_free(a);
|
||||
|
||||
exit(EXIT_SUCESS);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CARRAY-SET-SIZE"
|
||||
>carray_set_size</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int carray_set_size(carray * array, uint32_t new_size);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_set_size()</B
|
||||
> sets the size of the
|
||||
array. It returns <B
|
||||
CLASS="COMMAND"
|
||||
>0</B
|
||||
> in case of success,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>-1</B
|
||||
> in case of failure.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN45"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-2. preallocating carray</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define SIZE 50
|
||||
#define NEWSIZE 200
|
||||
|
||||
int main(void)
|
||||
{
|
||||
carray * a;
|
||||
unsigned int i;
|
||||
char p[500];
|
||||
|
||||
a = carray_new(SIZE);
|
||||
if (a == NULL)
|
||||
goto err;
|
||||
|
||||
r = carray_set_size(NEWSIZE);
|
||||
if (r < 0)
|
||||
goto free;
|
||||
|
||||
for(i = 0 ; i < NEWSIZE ; i ++)
|
||||
carray_set(a, i, &p[i]);
|
||||
|
||||
/* do things here */
|
||||
|
||||
carray_free(a);
|
||||
|
||||
exit(EXIT_SUCESS);
|
||||
|
||||
free:
|
||||
carray_free(a);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CARRAY-COUNT"
|
||||
>carray_count, carray_add, carray_get and carray_set</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int carray_count(carray);
|
||||
|
||||
int carray_add(carray * array, void * data, unsigned int * index);
|
||||
|
||||
void * carray_get(carray * array, unsigned int indx);
|
||||
|
||||
void carray_set(carray * array, unsigned int indx, void * value);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_count()</B
|
||||
> returns the number of
|
||||
elements in the <B
|
||||
CLASS="COMMAND"
|
||||
>carray</B
|
||||
>.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_add()</B
|
||||
>adds an element at the end of
|
||||
the array. The <B
|
||||
CLASS="COMMAND"
|
||||
>index</B
|
||||
> of the element is
|
||||
returns in <B
|
||||
CLASS="COMMAND"
|
||||
>(* index)</B
|
||||
> if
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>index</B
|
||||
> is not <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
>. It
|
||||
returns <B
|
||||
CLASS="COMMAND"
|
||||
>0</B
|
||||
> in case of success,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>-1</B
|
||||
> in case of failure.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_get()</B
|
||||
> returns the elements contained
|
||||
at the given cell of the table.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_set()</B
|
||||
> replace the element at the
|
||||
given index of table table with the given value.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN66"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-3. carray access</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
#include <string.h>
|
||||
|
||||
#define SIZE 50
|
||||
|
||||
int main(void)
|
||||
{
|
||||
carray * a;
|
||||
int r;
|
||||
|
||||
a = carray_new(SIZE);
|
||||
if (a == NULL)
|
||||
goto err;
|
||||
|
||||
r = carray_add(a, "foo-bar-1", NULL);
|
||||
if (r < 0)
|
||||
goto free;
|
||||
|
||||
carray_add(a, "foo-bar-2", NULL);
|
||||
if (r < 0)
|
||||
goto free;
|
||||
|
||||
carray_add(a, "foo-bar-3", NULL);
|
||||
if (r < 0)
|
||||
goto free;
|
||||
|
||||
for(i = 0 ; i < carray_count(a) ; i ++) {
|
||||
char * str;
|
||||
|
||||
str = carray_get(a, i);
|
||||
if (strcmp("foo-bar-2", str) == 0)
|
||||
carray_set(a, i, "foo-bar-2-replacement");
|
||||
|
||||
printf("%s\n", str);
|
||||
}
|
||||
|
||||
carray_free(a);
|
||||
|
||||
exit(EXIT_SUCESS);
|
||||
|
||||
free:
|
||||
carray_free(a);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CARRAY-DELETE"
|
||||
>carray_delete</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int carray_delete(carray * array, uint32_t indx);
|
||||
|
||||
int carray_delete_slow(carray * array, uint32_t indx);
|
||||
|
||||
int carray_delete_fast(carray * array, uint32_t indx);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_delete()</B
|
||||
> removes an element of the
|
||||
table. Order will not be garanteed. The returned result can
|
||||
be ignored.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_delete_slow()</B
|
||||
> removes an element of
|
||||
the table. Order will be garanteed. The returned result can
|
||||
be ignored.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_delete_fast()</B
|
||||
> the element will just
|
||||
be replaced with <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
>. Order will be kept
|
||||
but the number of elements will remains the same. The
|
||||
returned result can be ignored.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN79"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-4. deletion in carray</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
#define SIZE 50
|
||||
|
||||
carray * build_array(void)
|
||||
{
|
||||
carray * a;
|
||||
|
||||
a = carray_new(SIZE);
|
||||
if (a == NULL)
|
||||
goto err;
|
||||
|
||||
r = carray_add(a, "foo-bar-1", NULL);
|
||||
if (r < 0)
|
||||
goto free;
|
||||
|
||||
carray_add(a, "foo-bar-2", NULL);
|
||||
if (r < 0)
|
||||
goto free;
|
||||
|
||||
carray_add(a, "foo-bar-3", NULL);
|
||||
if (r < 0)
|
||||
goto free;
|
||||
|
||||
return a;
|
||||
|
||||
free:
|
||||
carray_free(a);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void delete(carray * a)
|
||||
{
|
||||
/* deleting foo-bar-1 */
|
||||
carray_delete(a, 0);
|
||||
/* resulting size is 2, order of elements is undefined */
|
||||
}
|
||||
|
||||
void delete_slow(carray * a)
|
||||
{
|
||||
/* deleting foo-bar-1 */
|
||||
carray_delete_slow(a, 0);
|
||||
/* resulting size is 2, order of elements is the same */
|
||||
}
|
||||
|
||||
void delete_fast(carray * a)
|
||||
{
|
||||
/* deleting foo-bar-1 */
|
||||
carray_delete_slow(a, 0);
|
||||
/*
|
||||
resulting size is 3,
|
||||
order of elements is { NULL, foo-bar-2, foo-bar-3 }
|
||||
*/
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CARRAY-DATA"
|
||||
>carray_data</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>void ** carray_data(carray);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>carray_data</B
|
||||
>returns the table used for
|
||||
implementation :
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>(void **)</B
|
||||
>.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c13.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x88.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Introduction</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>List</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,271 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Storages, folders, messages</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Helper functions"
|
||||
HREF="x2946.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Error codes"
|
||||
HREF="x3011.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x2946.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x3011.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="AEN2988"
|
||||
></A
|
||||
>Chapter 5. Storages, folders, messages</H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="c2988.htm#AEN2990"
|
||||
>Introduction</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x3011.htm"
|
||||
>Error codes</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x3015.htm"
|
||||
>Storage</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x3082.htm"
|
||||
>Folder</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x3198.htm"
|
||||
>Message</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x3472.htm"
|
||||
>Session</A
|
||||
></DT
|
||||
></DL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN2990"
|
||||
>Introduction</A
|
||||
></H1
|
||||
><P
|
||||
> This part will give the definition of some objects.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN2993"
|
||||
>Message</A
|
||||
></H2
|
||||
><P
|
||||
> A message is the common e-mail message or news message you
|
||||
read or send.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN2996"
|
||||
>MIME part</A
|
||||
></H2
|
||||
><P
|
||||
> A message can have attachment such as images or other documents.
|
||||
The attachment are organized into a tree structure. Each
|
||||
node of this structure is a MIME part.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN2999"
|
||||
>Mailbox</A
|
||||
></H2
|
||||
><P
|
||||
> A mailbox will contain a given number of messages.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN3002"
|
||||
>Storage</A
|
||||
></H2
|
||||
><P
|
||||
> A storage is a "physical" localisation of your mailbox. This
|
||||
can be on a filesystem (local or remote disk, this is the
|
||||
case of MH, mbox and maildir), or this can be on a remote
|
||||
host (this is the case for POP3, IMAP or NNTP).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN3005"
|
||||
>Folder</A
|
||||
></H2
|
||||
><P
|
||||
> A storage, for the same user, can contain a given number of
|
||||
mailboxes, depending the storage capabilities, then, the
|
||||
storage driver capabilities. With etPan!, MH, IMAP and NNTP
|
||||
storages can have more than one mailbox. The mailboxes will
|
||||
be called folders. On storage where we only have one
|
||||
mailbox, the unique mailbox is the unique folder.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN3008"
|
||||
>Session</A
|
||||
></H2
|
||||
><P
|
||||
> The session is the network connection or the entity to which
|
||||
the commands of the drivers are given.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x2946.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x3011.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Helper functions</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Error codes</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,342 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Internet Message Format</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="strings"
|
||||
HREF="x312.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Data types"
|
||||
HREF="x425.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x312.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x425.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="IMF"
|
||||
></A
|
||||
>Chapter 3. Internet Message Format</H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="c385.htm#AEN397"
|
||||
>Quick start</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x425.htm"
|
||||
>Data types</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x1094.htm"
|
||||
>Parser functions</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x1381.htm"
|
||||
>Creation functions</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x1556.htm"
|
||||
>Rendering of messages</A
|
||||
></DT
|
||||
></DL
|
||||
></DIV
|
||||
><P
|
||||
> libEtPan! implements Internet Message parser. Currently, format
|
||||
is RFC 2822.
|
||||
This module also allows to generate messages.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="WARNING"
|
||||
><P
|
||||
></P
|
||||
><TABLE
|
||||
CLASS="WARNING"
|
||||
BORDER="1"
|
||||
WIDTH="100%"
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="CENTER"
|
||||
><B
|
||||
>Warning</B
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="LEFT"
|
||||
><P
|
||||
> All allocation functions will take as argument allocated data
|
||||
and will store these data in the structure they will allocate.
|
||||
Data should be persistant during all the use of the structure
|
||||
and will be freed by the free function of the structure
|
||||
</P
|
||||
><P
|
||||
> allocation functions will return <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> on failure
|
||||
|
||||
functions returning integer will be returning one of the
|
||||
following error code:
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_NO_ERROR</B
|
||||
>,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_PARSE</B
|
||||
>,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_MEMORY</B
|
||||
>,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_INVAL</B
|
||||
>,
|
||||
or <B
|
||||
CLASS="COMMAND"
|
||||
>MAILIMF_ERROR_FILE</B
|
||||
>.
|
||||
</P
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN397"
|
||||
>Quick start</A
|
||||
></H1
|
||||
><P
|
||||
> You will need this module when you want to parse headers
|
||||
of messages or when you want to build message headers
|
||||
conformant to standards.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN400"
|
||||
>Parse message headers</A
|
||||
></H2
|
||||
><P
|
||||
> You will use one of the four following functions, depending
|
||||
on your needs :
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_envelope_and_optional_fields_parse</B
|
||||
>
|
||||
(<A
|
||||
HREF="x1094.htm#MAILIMF-ENVELOPE-AND-OPTIONAL-FIELDS-PARSE"
|
||||
>the Section called <I
|
||||
>mailimf_envelope_and_optional_fields_parse</I
|
||||
></A
|
||||
>),
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_envelope_fields_parse</B
|
||||
>
|
||||
(<A
|
||||
HREF="x1094.htm#MAILIMF-ENVELOPE-FIELDS-PARSE"
|
||||
>the Section called <I
|
||||
>mailimf_envelope_fields_parse</I
|
||||
></A
|
||||
>),
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_optional_fields_parse</B
|
||||
>
|
||||
(<A
|
||||
HREF="x1094.htm#MAILIMF-OPTIONAL-FIELDS-PARSE"
|
||||
>the Section called <I
|
||||
>mailimf_optional_fields_parse</I
|
||||
></A
|
||||
>),
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_parse</B
|
||||
>
|
||||
(<A
|
||||
HREF="x1094.htm#MAILIMF-FIELDS-PARSE"
|
||||
>the Section called <I
|
||||
>mailimf_fields_parse</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN420"
|
||||
>Render the message headers</A
|
||||
></H2
|
||||
><P
|
||||
> Build your message headers, then use
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_write</B
|
||||
>
|
||||
(<A
|
||||
HREF="x1556.htm#MAILIMF-FIELDS-WRITE"
|
||||
>the Section called <I
|
||||
>Header fields</I
|
||||
></A
|
||||
>)
|
||||
to render the headers.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x312.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x425.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>strings</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Data types</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
File diff suppressed because it is too large
Load Diff
|
@ -1,955 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Creation functions</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Internet Message Format"
|
||||
HREF="c385.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Parser functions"
|
||||
HREF="x1094.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Rendering of messages"
|
||||
HREF="x1556.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x1094.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 3. Internet Message Format</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x1556.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN1381"
|
||||
>Creation functions</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILIMF-MAILBOX-LIST-ADD"
|
||||
>mailimf_mailbox_list</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailimf_mailbox_list *
|
||||
mailimf_mailbox_list_new_empty();
|
||||
|
||||
int mailimf_mailbox_list_add(struct mailimf_mailbox_list * mailbox_list,
|
||||
struct mailimf_mailbox * mb);
|
||||
|
||||
int mailimf_mailbox_list_add_parse(struct mailimf_mailbox_list * mailbox_list,
|
||||
char * mb_str);
|
||||
|
||||
int mailimf_mailbox_list_add_mb(struct mailimf_mailbox_list * mailbox_list,
|
||||
char * display_name, char * address);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_mailbox_list_new_empty()</B
|
||||
> creates a
|
||||
new empty list of mailboxes.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_mailbox_list_add</B
|
||||
> adds a mailbox
|
||||
to the list of mailboxes.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_mailbox_list_add_parse</B
|
||||
> adds a
|
||||
mailbox given in form of a string to the list of mailboxes.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_mailbox_list_add_mb</B
|
||||
> adds a
|
||||
mailbox given in form of a couple : display name, mailbox
|
||||
address.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailbox_list</B
|
||||
> is the list of mailboxes.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mb</B
|
||||
> is a mailbox
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-MAILBOX"
|
||||
>the Section called <I
|
||||
>mailimf_mailbox - mailbox</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mb_str</B
|
||||
> is a mailbox given in the form
|
||||
of a string.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>display_name</B
|
||||
> is the display name.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>address</B
|
||||
> is the mailbox address.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN1411"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 3-44. creating a list of mailboxes</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailimf_mailbox_list * mb_list;
|
||||
struct mailimf_mailbox * mb;
|
||||
|
||||
mb_list = mailimf_mailbox_list_new_empty();
|
||||
|
||||
mb = mailimf_mailbox_new(strdup("DINH Viet Hoa"),
|
||||
strdup("dinh.viet.hoa@free.fr"));
|
||||
mailimf_mailbox_list_add(mb_list, mb);
|
||||
|
||||
mailimf_mailbox_list_add_parse(mb_list, "foo bar <foo@bar.org>");
|
||||
|
||||
mailimf_mailbox_list_add_mb(mb_list, strdup("bar foo"), strdup("bar@foo.com"));
|
||||
|
||||
mailimf_mailbox_list_free(mb_list);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILIMF-ADDRESS-LIST-ADD"
|
||||
>mailimf_address_list</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailimf_address_list * mailimf_address_list_new_empty();
|
||||
|
||||
int mailimf_address_list_add(struct mailimf_address_list * address_list,
|
||||
struct mailimf_address * addr);
|
||||
|
||||
int mailimf_address_list_add_parse(struct mailimf_address_list * address_list,
|
||||
char * addr_str);
|
||||
|
||||
int mailimf_address_list_add_mb(struct mailimf_address_list * address_list,
|
||||
char * display_name, char * address);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_address_list_new_empty()</B
|
||||
> creates a
|
||||
new empty list of addresses.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_address_list_add</B
|
||||
> adds an address
|
||||
to the list of addresses.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_address_list_add_parse</B
|
||||
> adds an
|
||||
address given in form of a string to the list of addresses.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_address_list_add_mb</B
|
||||
> adds a
|
||||
mailbox given in form of a couple : display name, mailbox
|
||||
address.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>address_list</B
|
||||
> is the list of mailboxes.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>addr</B
|
||||
> is an address.
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-ADDRESS"
|
||||
>the Section called <I
|
||||
>mailimf_address - address</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>addr_str</B
|
||||
> is an address given in the form of a
|
||||
string.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>display_name</B
|
||||
> is the display name.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>address</B
|
||||
> is the mailbox address.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILIMF-FIELDS-ADD"
|
||||
>mailimf_fields</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailimf_fields *
|
||||
mailimf_fields_new_empty(void);
|
||||
|
||||
struct mailimf_field * mailimf_field_new_custom(char * name, char * value);
|
||||
|
||||
int mailimf_fields_add(struct mailimf_fields * fields,
|
||||
struct mailimf_field * field);
|
||||
|
||||
int mailimf_fields_add_data(struct mailimf_fields * fields,
|
||||
struct mailimf_date_time * date,
|
||||
struct mailimf_mailbox_list * from,
|
||||
struct mailimf_mailbox * sender,
|
||||
struct mailimf_address_list * reply_to,
|
||||
struct mailimf_address_list * to,
|
||||
struct mailimf_address_list * cc,
|
||||
struct mailimf_address_list * bcc,
|
||||
char * msg_id,
|
||||
clist * in_reply_to,
|
||||
clist * references,
|
||||
char * subject);
|
||||
|
||||
struct mailimf_fields *
|
||||
mailimf_fields_new_with_data_all(struct mailimf_date_time * date,
|
||||
struct mailimf_mailbox_list * from,
|
||||
struct mailimf_mailbox * sender,
|
||||
struct mailimf_address_list * reply_to,
|
||||
struct mailimf_address_list * to,
|
||||
struct mailimf_address_list * cc,
|
||||
struct mailimf_address_list * bcc,
|
||||
char * message_id,
|
||||
clist * in_reply_to,
|
||||
clist * references,
|
||||
char * subject);
|
||||
|
||||
struct mailimf_fields *
|
||||
mailimf_fields_new_with_data(struct mailimf_mailbox_list * from,
|
||||
struct mailimf_mailbox * sender,
|
||||
struct mailimf_address_list * reply_to,
|
||||
struct mailimf_address_list * to,
|
||||
struct mailimf_address_list * cc,
|
||||
struct mailimf_address_list * bcc,
|
||||
clist * in_reply_to,
|
||||
clist * references,
|
||||
char * subject);
|
||||
|
||||
char * mailimf_get_message_id(void);
|
||||
|
||||
struct mailimf_date_time * mailimf_get_current_date(void);
|
||||
|
||||
int
|
||||
mailimf_resent_fields_add_data(struct mailimf_fields * fields,
|
||||
struct mailimf_date_time * resent_date,
|
||||
struct mailimf_mailbox_list * resent_from,
|
||||
struct mailimf_mailbox * resent_sender,
|
||||
struct mailimf_address_list * resent_to,
|
||||
struct mailimf_address_list * resent_cc,
|
||||
struct mailimf_address_list * resent_bcc,
|
||||
char * resent_msg_id);
|
||||
|
||||
struct mailimf_fields *
|
||||
mailimf_resent_fields_new_with_data_all(struct mailimf_date_time *
|
||||
resent_date, struct mailimf_mailbox_list * resent_from,
|
||||
struct mailimf_mailbox * resent_sender,
|
||||
struct mailimf_address_list * resent_to,
|
||||
struct mailimf_address_list * resent_cc,
|
||||
struct mailimf_address_list * resent_bcc,
|
||||
char * resent_msg_id);
|
||||
|
||||
struct mailimf_fields *
|
||||
mailimf_resent_fields_new_with_data(struct mailimf_mailbox_list * from,
|
||||
struct mailimf_mailbox * resent_sender,
|
||||
struct mailimf_address_list * resent_to,
|
||||
struct mailimf_address_list * resent_cc,
|
||||
struct mailimf_address_list * resent_bcc);
|
||||
</PRE
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>from</B
|
||||
> is the parsed content of the
|
||||
From field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-FROM"
|
||||
>the Section called <I
|
||||
>mailimf_from - parsed content of From header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sender</B
|
||||
> is the parsed content of the
|
||||
Sender field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-SENDER"
|
||||
>the Section called <I
|
||||
>mailimf_sender - parsed content of Sender header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>reply_to</B
|
||||
> is the parsed content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>Reply-To</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-REPLY-TO"
|
||||
>the Section called <I
|
||||
>mailimf_reply_to - parsed content of Reply-To header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>to</B
|
||||
> is the parsed content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>To</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-TO"
|
||||
>the Section called <I
|
||||
>mailimf_to - parsed content of To header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>cc</B
|
||||
> is the parsed content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>Cc</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-CC"
|
||||
>the Section called <I
|
||||
>mailimf_cc - parsed content of Cc</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>bcc</B
|
||||
> is the parsed content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>Bcc</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-BCC"
|
||||
>the Section called <I
|
||||
>mailimf_bcc - parsed content of Bcc field</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>message_id</B
|
||||
> is the parsed content of
|
||||
the <B
|
||||
CLASS="COMMAND"
|
||||
>Message-ID</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-MESSAGE-ID"
|
||||
>the Section called <I
|
||||
>mailimf_message_id - parsed content of Message-ID header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>in_reply_to</B
|
||||
> is the parsed content of
|
||||
the <B
|
||||
CLASS="COMMAND"
|
||||
>In-Reply-To</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-IN-REPLY-TO"
|
||||
>the Section called <I
|
||||
>mailimf_in_reply_to - parsed content of In-Reply-To
|
||||
field</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>references</B
|
||||
> is the parsed content of
|
||||
the <B
|
||||
CLASS="COMMAND"
|
||||
>References</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-REFERENCES"
|
||||
>the Section called <I
|
||||
>mailimf_references - parsed content of References field</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>subject</B
|
||||
> is the content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>Subject</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-SUBJECT"
|
||||
>the Section called <I
|
||||
>mailimf_subject - parsed content of Subject field</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>resent_date</B
|
||||
> is the parsed content of
|
||||
the <B
|
||||
CLASS="COMMAND"
|
||||
>Resent-Date</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-ORIG-DATE"
|
||||
>the Section called <I
|
||||
>mailimf_orig_date - parsed content of date header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>resent_from</B
|
||||
> is the parsed content of
|
||||
the <B
|
||||
CLASS="COMMAND"
|
||||
>Resent-From</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-FROM"
|
||||
>the Section called <I
|
||||
>mailimf_from - parsed content of From header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>resent_sender</B
|
||||
> is the parsed content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>Resent-Sender</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-SENDER"
|
||||
>the Section called <I
|
||||
>mailimf_sender - parsed content of Sender header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>resent_to</B
|
||||
> is the parsed content of
|
||||
the <B
|
||||
CLASS="COMMAND"
|
||||
>Resent-To</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-TO"
|
||||
>the Section called <I
|
||||
>mailimf_to - parsed content of To header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>resent_cc</B
|
||||
> is the parsed content of
|
||||
the <B
|
||||
CLASS="COMMAND"
|
||||
>Resent-Cc</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-CC"
|
||||
>the Section called <I
|
||||
>mailimf_cc - parsed content of Cc</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>resent_bcc</B
|
||||
> is the parsed content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>Resent-Bcc</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-BCC"
|
||||
>the Section called <I
|
||||
>mailimf_bcc - parsed content of Bcc field</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>resent_msg_id</B
|
||||
> is the parsed content of the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>Resent-Message-ID</B
|
||||
> field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-MESSAGE-ID"
|
||||
>the Section called <I
|
||||
>mailimf_message_id - parsed content of Message-ID header</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_new_empty()</B
|
||||
> creates a new
|
||||
empty set of headers.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_field_new_custom()</B
|
||||
> creates a new
|
||||
custom header.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_add()</B
|
||||
> adds a header to the
|
||||
set of headers.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_add_data()</B
|
||||
> adds some headers
|
||||
to the set of headers.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_new_with_data_all()</B
|
||||
> creates
|
||||
a set of headers with some headers (including Date and
|
||||
Message-ID).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_new_with_data()</B
|
||||
> creates a
|
||||
set of headers with some headers (Date and Message-ID will
|
||||
be generated).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_get_message_id()</B
|
||||
> generates a
|
||||
Message-ID. The result must be freed using
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>free()</B
|
||||
>.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_get_current_date()</B
|
||||
> generates a
|
||||
Date. The result must be freed using
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_date_time_free</B
|
||||
>.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_resent_fields_add_data()</B
|
||||
> adds some
|
||||
resent headers to the set of headers.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_resent_fields_new_with_data_all()</B
|
||||
>
|
||||
creates a set of headers with some resent headers (including
|
||||
Resent-Date and Resent-Message-ID).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_resent_fields_new_with_data()</B
|
||||
>
|
||||
creates a set of headers with some resent headers
|
||||
(Resent-Date and Resent-Message-ID will be generated)
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN1553"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 3-45. creation of header fields</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailimf_fields * fields;
|
||||
struct mailimf_field * field;
|
||||
struct mailimf_date_time * date;
|
||||
char * msg_id;
|
||||
struct mailimf_mailbox_list * from;
|
||||
struct mailimf_address_list * to;
|
||||
|
||||
fields = mailimf_fields_new_empty();
|
||||
field = mailimf_field_new_custom(strdup("X-Mailer"), strdup("my-mailer"));
|
||||
mailimf_fields_add(fields, field);
|
||||
|
||||
from = mailimf_mailbox_list_new_empty();
|
||||
mailimf_mailbox_list_add_mb(from, strdup("DINH Viet Hoa"), strdup("dinh.viet.hoa@free.fr");
|
||||
date = mailimf_get_current_date();
|
||||
msg_id = mailimf_get_message_id();
|
||||
to = mailimf_address_list_new_empty();
|
||||
mailimf_address_list_add_mb(to, strdup("FOO Bar"), strdup("foo@bar.org");
|
||||
|
||||
mailimf_fields_add_data(fields, date, from, NULL, NULL, to, NULL, NULL,
|
||||
msg_id, NULL, NULL, strdup("hello"));
|
||||
|
||||
/* do the things */
|
||||
|
||||
mailimf_fields_free(fields);
|
||||
}
|
||||
|
||||
#include <libetpan/libetpan.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailimf_fields * fields;
|
||||
struct mailimf_mailbox_list * from;
|
||||
struct mailimf_address_list * to;
|
||||
struct mailimf_date_time * date;
|
||||
char * msg_id;
|
||||
|
||||
from = mailimf_mailbox_list_new_empty();
|
||||
mailimf_mailbox_list_add_mb(from, strdup("DINH Viet Hoa"), strdup("dinh.viet.hoa@free.fr");
|
||||
to = mailimf_address_list_new_empty();
|
||||
mailimf_address_list_add_mb(to, strdup("FOO Bar"), strdup("foo@bar.org");
|
||||
date = mailimf_get_current_date();
|
||||
msg_id = mailimf_get_message_id();
|
||||
|
||||
fields = mailimf_fields_new_with_all_data(date, from, NULL, NULL, to, NULL, NULL,
|
||||
msg_id, NULL, NULL, strdup("hello"));
|
||||
|
||||
/* do the things */
|
||||
|
||||
mailimf_fields_free(fields);
|
||||
}
|
||||
|
||||
#include <libetpan/libetpan.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailimf_fields * fields;
|
||||
struct mailimf_mailbox_list * from;
|
||||
struct mailimf_address_list * to;
|
||||
|
||||
from = mailimf_mailbox_list_new_empty();
|
||||
mailimf_mailbox_list_add_mb(from, strdup("DINH Viet Hoa"), strdup("dinh.viet.hoa@free.fr");
|
||||
to = mailimf_address_list_new_empty();
|
||||
mailimf_address_list_add_mb(to, strdup("FOO Bar"), strdup("foo@bar.org");
|
||||
|
||||
fields = mailimf_fields_new_with_data(from, NULL, NULL, to, NULL, NULL,
|
||||
NULL, NULL, strdup("hello"));
|
||||
|
||||
/* do the things */
|
||||
|
||||
mailimf_fields_free(fields);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x1094.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x1556.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Parser functions</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c385.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Rendering of messages</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,295 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Rendering of messages</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Internet Message Format"
|
||||
HREF="c385.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Creation functions"
|
||||
HREF="x1381.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="MIME"
|
||||
HREF="c1586.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x1381.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 3. Internet Message Format</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c1586.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN1556"
|
||||
>Rendering of messages</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILIMF-FIELDS-WRITE"
|
||||
>Header fields</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailimf_fields_write(FILE * f, int * col,
|
||||
struct mailimf_fields * fields);
|
||||
|
||||
int mailimf_envelope_fields_write(FILE * f, int * col,
|
||||
struct mailimf_fields * fields);
|
||||
|
||||
int mailimf_field_write(FILE * f, int * col,
|
||||
struct mailimf_field * field);
|
||||
</PRE
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>col</B
|
||||
> current column is given for wrapping
|
||||
purpose in <B
|
||||
CLASS="COMMAND"
|
||||
>(* col)</B
|
||||
>,
|
||||
the resulting columns will be returned..
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>f</B
|
||||
> is the file descriptor. It can be
|
||||
stdout for example.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fields</B
|
||||
> is the header fields
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-FIELDS"
|
||||
>the Section called <I
|
||||
>mailimf_fields - list of header fields</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>field</B
|
||||
> is a field
|
||||
(see <A
|
||||
HREF="x425.htm#MAILIMF-FIELD"
|
||||
>the Section called <I
|
||||
>mailimf_field - header field</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_fields_write</B
|
||||
> outputs the set of
|
||||
header fields.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_envelope_fields_write</B
|
||||
> outputs the
|
||||
set of header fields except the optional fields.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailimf_field_write</B
|
||||
> outputs a header.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN1583"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 3-46. rendering of fields</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailimf_fields * fields;
|
||||
int col;
|
||||
|
||||
/* look at the example in mailimf_fields to see how to
|
||||
build a mailimf_fields */
|
||||
fields = build_imf_fields();
|
||||
|
||||
col = 0;
|
||||
mailimf_fields_write(stdout, &col, fields);
|
||||
|
||||
mailimf_fields_free(fields);
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailimf_fields * fields;
|
||||
int col;
|
||||
|
||||
/* look at the example in mailimf_fields to see how to
|
||||
build a mailimf_fields */
|
||||
fields = build_imf_fields();
|
||||
|
||||
col = 0;
|
||||
mailimf_envelope_fields_write(stdout, &col, fields);
|
||||
|
||||
mailimf_fields_free(fields);
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailimf_field * field;
|
||||
int col;
|
||||
|
||||
field = mailimf_field_new_custom(strdup("X-Mailer"), strdup("my mailer"));
|
||||
|
||||
col = 0;
|
||||
mailimf_field_write(stdout, &col, field);
|
||||
|
||||
mailimf_field_free(field);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x1381.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c1586.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Creation functions</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c385.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>MIME</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,557 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Hash table</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Tools and datatypes"
|
||||
HREF="c16.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="List"
|
||||
HREF="x88.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Buffered I/O"
|
||||
HREF="x229.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x88.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 2. Tools and datatypes</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x229.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN161"
|
||||
>Hash table</A
|
||||
></H1
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
typedef struct chash chash;
|
||||
|
||||
typedef struct chashcell chashiter;
|
||||
|
||||
typedef struct {
|
||||
char * data;
|
||||
int len;
|
||||
} chashdatum;
|
||||
</PRE
|
||||
><P
|
||||
>
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>chash</B
|
||||
> is a hash table.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>chashiter</B
|
||||
> is a pointer to an element of the
|
||||
hash table.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>chashdatum</B
|
||||
> is an element to be placed in
|
||||
the hash table as a key or a value. It consists in
|
||||
data and a corresponding length.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CHASH-NEW"
|
||||
>chash_new and chash_free</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#define CHASH_COPYNONE 0
|
||||
#define CHASH_COPYKEY 1
|
||||
#define CHASH_COPYVALUE 2
|
||||
#define CHASH_COPYALL (CHASH_COPYKEY | CHASH_COPYVALUE)
|
||||
|
||||
chash * chash_new(int size, int flags);
|
||||
|
||||
void chash_free(chash * hash);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_new()</B
|
||||
> returns a new empty hash table
|
||||
or <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> if this
|
||||
failed. <B
|
||||
CLASS="COMMAND"
|
||||
>size</B
|
||||
> is the initial size of the
|
||||
table used for implementation. <B
|
||||
CLASS="COMMAND"
|
||||
>flags</B
|
||||
> can
|
||||
be a combinaison of <B
|
||||
CLASS="COMMAND"
|
||||
>CHASH_COPYKEY</B
|
||||
> and
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>CHASH_COPYVALUE</B
|
||||
>.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>CHASH_COPYKEY</B
|
||||
> enables copy of key, so
|
||||
that the initial value used for <B
|
||||
CLASS="COMMAND"
|
||||
>chash_set()</B
|
||||
>
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_free()</B
|
||||
> releases memory used by the
|
||||
hash table.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CHASH-GET"
|
||||
>chash_set and chash_get</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int chash_set(chash * hash,
|
||||
chashdatum * key, chashdatum * value, chashdatum * oldvalue);
|
||||
|
||||
int chash_get(chash * hash,
|
||||
chashdatum * key, chashdatum * result);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_set()</B
|
||||
> adds a new element into the
|
||||
hash table. If a previous element had the same key, it is
|
||||
returns into oldvalue if <B
|
||||
CLASS="COMMAND"
|
||||
>oldvalue</B
|
||||
> is
|
||||
different of NULL.
|
||||
Medium complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> returns -1 if it fails, 0 on success.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_get()</B
|
||||
>returns the corresponding value
|
||||
of the given key. If there is no corresponding value, -1 is
|
||||
returned. 0 on success.
|
||||
Medium complexity is O(1).
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN191"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-9. chash insert and lookup</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int main(void)
|
||||
{
|
||||
chash * hash;
|
||||
int r;
|
||||
chashdatum key;
|
||||
chashdatum value;
|
||||
char * str1 = "my-data";
|
||||
char * str2 = "my-data";
|
||||
|
||||
hash = chash_new(CHASH_DEFAULTSIZE, CHASH_COPYNONE);
|
||||
|
||||
key.data = "foo";
|
||||
key.len = strlen("foo");
|
||||
value.data = str1;
|
||||
value.data = strlen(str1) + 1;
|
||||
/* + 1 is needed to get the terminal zero in the returned string */
|
||||
r = chash_set(hash, &key, &value, NULL);
|
||||
if (r < 0)
|
||||
goto free_hash;
|
||||
|
||||
key.data = "bar";
|
||||
key.len = strlen("bar");
|
||||
value.data = str2;
|
||||
value.data = strlen(str2) + 1;
|
||||
if (r < 0)
|
||||
goto free_hash;
|
||||
|
||||
key.data = "foo";
|
||||
key.len = strlen("foo");
|
||||
r = chash_get(hash, &key, &value);
|
||||
if (r < 0) {
|
||||
printf("element not found\n");
|
||||
}
|
||||
else {
|
||||
char * str;
|
||||
|
||||
str = value.data;
|
||||
printf("found : %s", str);
|
||||
}
|
||||
|
||||
chash_free(hash);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
free_hash:
|
||||
chash_free(hash);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CHASH-DELETE"
|
||||
>chash_delete</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int chash_delete(chash * hash,
|
||||
chashdatum * key, chashdatum * oldvalue);
|
||||
</PRE
|
||||
><P
|
||||
> deletes the key/value pair given the corresponding key.
|
||||
The value is returned in old_value.
|
||||
If there is no corresponding value, -1 is returned. 0 on success.
|
||||
Medium complexity is O(1).
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN198"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-10. key deletion in a chash</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int main(void)
|
||||
{
|
||||
chash * hash;
|
||||
int r;
|
||||
chashdatum key;
|
||||
chashdatum value;
|
||||
char * str1 = "my-data";
|
||||
char * str2 = "my-data";
|
||||
|
||||
hash = build_hash();
|
||||
|
||||
key.data = "foo";
|
||||
key.len = strlen("foo");
|
||||
chash_delete(hash, &key, &value);
|
||||
|
||||
/* it will never be possible to lookup "foo" */
|
||||
key.data = "foo";
|
||||
key.len = strlen("foo");
|
||||
r = chash_get(hash, &key, &value);
|
||||
if (r < 0) {
|
||||
printf("element not found\n");
|
||||
}
|
||||
else {
|
||||
char * str;
|
||||
|
||||
str = value.data;
|
||||
printf("found : %s", str);
|
||||
}
|
||||
|
||||
chash_free(hash);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
free_hash:
|
||||
chash_free(hash);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CHASH-RESIZE"
|
||||
>chash_resize</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int chash_resize(chash * hash, int size);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_resize()</B
|
||||
> changes the size of the
|
||||
table used for implementation of the hash table.
|
||||
returns 0 on success, -1 on failure.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CHASH-BEGIN"
|
||||
>running through the chash</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>chashiter * chash_begin(chash * hash);
|
||||
|
||||
chashiter * chash_next(chash * hash, chashiter * iter);
|
||||
|
||||
void chash_key(chashiter * iter, chashdatum * result);
|
||||
|
||||
void chash_value(chashiter iter, chashdatum * result);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_begin()</B
|
||||
> returns a pointer to the
|
||||
first element of the hash table. Returns
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> if there is no elements in the hash
|
||||
table.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_next()</B
|
||||
> returns a pointer to the next
|
||||
element of the hash table. Returns <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
>
|
||||
if there is no next element.
|
||||
Complexity is O(n) but n calls to chash_next() also has
|
||||
a complexity of O(n).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_key()</B
|
||||
> returns the key of the given
|
||||
element of the hash table.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_value</B
|
||||
> returns the value of the
|
||||
given element of the hash table.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN219"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-11. running through a chash</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int main(void)
|
||||
{
|
||||
chash * hash;
|
||||
int r;
|
||||
chashiter * iter;
|
||||
|
||||
hash = build_hash();
|
||||
|
||||
/* this will display all the values stored in the hash */
|
||||
for(iter = chash_begin(hash) ; iter != NULL ; iter =
|
||||
chash_next(hash, iter)) {
|
||||
chashdatum key;
|
||||
chashdatum value;
|
||||
char * str;
|
||||
|
||||
chash_value(iter, &value);
|
||||
str = value.data;
|
||||
printf("%s\n", str);
|
||||
}
|
||||
|
||||
chash_free(hash);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CHASH-COUNT"
|
||||
>chash_size and chash_count</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int chash_size(chash * hash);
|
||||
|
||||
int chash_count(chash * hash);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_size()</B
|
||||
> returns the size of the table
|
||||
used for implementation of the hash table.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>chash_count()</B
|
||||
> returns the number of
|
||||
elements in the hash table.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x88.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x229.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>List</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Buffered I/O</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,407 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Buffered I/O</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Tools and datatypes"
|
||||
HREF="c16.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Hash table"
|
||||
HREF="x161.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="non-buffered I/O"
|
||||
HREF="x289.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x161.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 2. Tools and datatypes</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x289.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN229"
|
||||
>Buffered I/O</A
|
||||
></H1
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
#include <libetpan/libetpan.h>
|
||||
|
||||
typedef struct _mailstream mailstream;
|
||||
</PRE
|
||||
><P
|
||||
> streams are objects where we can read data from and write data
|
||||
to. They are not seekable. That can be for example a pipe or a
|
||||
network stream.
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>mailstream * mailstream_new(mailstream_low * low, size_t buffer_size);
|
||||
|
||||
int mailstream_close(mailstream * s);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_new()</B
|
||||
> creates a new stream
|
||||
stream with the low-level (see <A
|
||||
HREF="x289.htm"
|
||||
>the Section called <I
|
||||
>non-buffered I/O</I
|
||||
></A
|
||||
>)
|
||||
stream and a given buffer size.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_close()</B
|
||||
> closes the stream.
|
||||
This function will be in charge to free the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_low</B
|
||||
> structure.
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
ssize_t mailstream_write(mailstream * s, void * buf, size_t count);
|
||||
|
||||
int mailstream_flush(mailstream * s);
|
||||
|
||||
ssize_t mailstream_read(mailstream * s, void * buf, size_t count);
|
||||
|
||||
ssize_t mailstream_feed_read_buffer(mailstream * s);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_write()</B
|
||||
> writes a buffer to the
|
||||
given stream. This write operation will be buffered.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_flush()</B
|
||||
> will force a write of
|
||||
all buffered data for a given stream.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_read()</B
|
||||
> reads data from the
|
||||
stream to the given buffer.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_feed_read_buffer()</B
|
||||
> this function
|
||||
will just fill the buffer for reading.
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
mailstream_low * mailstream_get_low(mailstream * s);
|
||||
|
||||
void mailstream_set_low(mailstream * s, mailstream_low * low);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_get_low()</B
|
||||
> returns the low-level
|
||||
stream of the given stream.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_set_low()</B
|
||||
> changes the low-level
|
||||
of the given stream. Useful, for
|
||||
example, when a stream change from clear stream to SSL
|
||||
stream.
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>char * mailstream_read_line(mailstream * stream, MMAPString * line);
|
||||
|
||||
char * mailstream_read_line_append(mailstream * stream, MMAPString * line);
|
||||
|
||||
char * mailstream_read_line_remove_eol(mailstream * stream, MMAPString * line);
|
||||
|
||||
char * mailstream_read_multiline(mailstream * s, size_t size,
|
||||
MMAPString * stream_buffer,
|
||||
MMAPString * multiline_buffer,
|
||||
size_t progr_rate,
|
||||
progress_function * progr_fun);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_read_line()</B
|
||||
> reads an entire line
|
||||
from the buffer and store it into the
|
||||
given string. returns <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> on error, the
|
||||
corresponding array
|
||||
of <B
|
||||
CLASS="COMMAND"
|
||||
>char</B
|
||||
> is returned otherwise.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_read_line_append()</B
|
||||
> reads an entire
|
||||
line from the buffer and appends it to the
|
||||
given string. returns <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> on error, the
|
||||
array of char corresponding to the entire buffer is returned
|
||||
otherwise.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_read_line_remove_eol()</B
|
||||
> reads an
|
||||
entire line from the buffer and store it into the
|
||||
given string. All CR LF are removed.
|
||||
returns <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> on error, the corresponding
|
||||
array of <B
|
||||
CLASS="COMMAND"
|
||||
>char</B
|
||||
> is returned otherwise.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_read_multiline()</B
|
||||
> reads a
|
||||
multiline data (several lines, the data are ended with
|
||||
a single period '.')
|
||||
from the given stream and store it into the given
|
||||
multiline buffer (multiline_buffer). progr_rate should be 0
|
||||
and progr_fun <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> (deprecated things).
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>stream_buffer</B
|
||||
> is a buffer used for internal
|
||||
work of the function.
|
||||
size should be 0 (deprecated things).
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
int mailstream_is_end_multiline(char * line);
|
||||
</PRE
|
||||
><P
|
||||
> returns 1 if the line is an end of multiline data (a single
|
||||
period '.', eventually with CR and/or LF). 0 is returned
|
||||
otherwise.
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
int mailstream_send_data(mailstream * s, char * message,
|
||||
size_t size,
|
||||
size_t progr_rate,
|
||||
progress_function * progr_fun);
|
||||
</PRE
|
||||
><P
|
||||
> sends multiline data to the given stream.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>size</B
|
||||
> is the size of the data.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>progr_rate</B
|
||||
> and <B
|
||||
CLASS="COMMAND"
|
||||
>progr_fun</B
|
||||
>
|
||||
are deprecated. <B
|
||||
CLASS="COMMAND"
|
||||
>progr_rate</B
|
||||
> must be 0,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>progr_fun</B
|
||||
> must be NULL.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILSTREAM-SOCKET"
|
||||
>socket stream</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>mailstream * mailstream_socket_open(int fd);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_socket_open()</B
|
||||
> will open a
|
||||
clear-text socket.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILSTREAM-SSL"
|
||||
>TLS stream</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>mailstream * mailstream_ssl_open(int fd);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_ssl_open()</B
|
||||
> will open a
|
||||
TLS/SSL socket.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x161.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x289.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Hash table</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>non-buffered I/O</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,529 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Rendering of MIME parts</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="MIME"
|
||||
HREF="c1586.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Parser functions"
|
||||
HREF="x2180.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Creation functions"
|
||||
HREF="x2669.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x2180.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 4. MIME</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x2669.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN2583"
|
||||
>Rendering of MIME parts</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILMIME-FIELDS-WRITE"
|
||||
>mailmime_fields_write, mailmime_content_write and
|
||||
mailmime_content_type_write</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailmime_fields_write(FILE * f, int * col,
|
||||
struct mailmime_fields * fields);
|
||||
|
||||
int mailmime_content_write(FILE * f, int * col,
|
||||
struct mailmime_content * content);
|
||||
|
||||
int mailmime_content_type_write(FILE * f, int * col,
|
||||
struct mailmime_content * content);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_fields_write</B
|
||||
> render the MIME
|
||||
header fields.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_content_write</B
|
||||
> render the MIME
|
||||
content type header field.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_content_write</B
|
||||
> render the
|
||||
content of the MIME content type header field.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>col</B
|
||||
> current column is given for wrapping
|
||||
purpose in <B
|
||||
CLASS="COMMAND"
|
||||
>(* col)</B
|
||||
>,
|
||||
the resulting columns will be returned..
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>f</B
|
||||
> is the file descriptor. It can be
|
||||
stdout for example.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fields</B
|
||||
> is the header fields
|
||||
(see <A
|
||||
HREF="x1614.htm#MAILMIME-FIELDS"
|
||||
>the Section called <I
|
||||
>mailmime_fields - header fields</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>content</B
|
||||
> is the header fields
|
||||
(see <A
|
||||
HREF="x1614.htm#MAILMIME-CONTENT"
|
||||
>the Section called <I
|
||||
>mailmime_content - MIME content type (Content-Type)</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN2610"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 4-33. rendering MIME header fields</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailmime_mime * mime_fields;
|
||||
int col;
|
||||
|
||||
/* look at the example in mailmime_fields to see how to
|
||||
build a mailmime_fields */
|
||||
mime_fields = build_mime_fields();
|
||||
|
||||
col = 0;
|
||||
mailmime_fields_write(stdout, &col, mime_fields);
|
||||
|
||||
mailmime_fields_free(mime_fields);
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailmime_content * content;
|
||||
int col;
|
||||
|
||||
/* look at the example in mailmime_content to see how to
|
||||
build a mailmime_fields */
|
||||
content = build_mime_content();
|
||||
|
||||
col = 0;
|
||||
mailmime_content_write(stdout, &col, mime_fields);
|
||||
|
||||
mailmime_content_free(content);
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
struct mailmime_content * content;
|
||||
int col;
|
||||
|
||||
/* look at the example in mailmime_content to see how to
|
||||
build a mailmime_fields */
|
||||
content = build_mime_content();
|
||||
|
||||
col = 0;
|
||||
mailmime_content_type_write(stdout, &col, mime_fields);
|
||||
|
||||
mailmime_content_free(content);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILMIME-WRITE"
|
||||
>mailmime_write</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailmime_write(FILE * f, int * col,
|
||||
struct mailmime * build_info);
|
||||
</PRE
|
||||
><P
|
||||
> This function will render a MIME message.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>col</B
|
||||
> current column is given for wrapping
|
||||
purpose in <B
|
||||
CLASS="COMMAND"
|
||||
>(* col)</B
|
||||
>,
|
||||
the resulting columns will be returned..
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>f</B
|
||||
> is the file descriptor. It can be
|
||||
stdout for example.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>build_info</B
|
||||
> is the MIME message to
|
||||
render.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILMIME-QUOTED-PRINTABLE-WRITE"
|
||||
>mailmime_quoted_printable_write
|
||||
and mailmime_base64_write</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailmime_quoted_printable_write(FILE * f, int * col, int istext,
|
||||
const char * text, size_t size);
|
||||
|
||||
int mailmime_base64_write(FILE * f, int * col,
|
||||
const char * text, size_t size);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_quoted_printable_write()</B
|
||||
> will
|
||||
render a string to quoted printable.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_base64_write()</B
|
||||
> will
|
||||
render a string to base64.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>col</B
|
||||
> current column is given for wrapping
|
||||
purpose in <B
|
||||
CLASS="COMMAND"
|
||||
>(* col)</B
|
||||
>,
|
||||
the resulting columns will be returned..
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>f</B
|
||||
> is the file descriptor. It can be
|
||||
stdout for example.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>text</B
|
||||
> is the string to render.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>size</B
|
||||
> is the size of the string to
|
||||
render.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN2649"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 4-34. render base64 or quoted printable</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
int col;
|
||||
|
||||
col = 0;
|
||||
mailmime_quoted_printable_write(stdout, &col,
|
||||
"this is a test", 14);
|
||||
}
|
||||
|
||||
#include <libetpan/libetpan.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
int col;
|
||||
|
||||
col = 0;
|
||||
mailmime_base64_write(stdout, &col, "this is a test", 14);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILMIME-DATA-WRITE"
|
||||
>mailmime_data_write</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailmime_data_write(FILE * f, int * col,
|
||||
struct mailmime_data * data,
|
||||
int istext);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_data_write</B
|
||||
> will
|
||||
render MIME data.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>col</B
|
||||
> current column is given for wrapping
|
||||
purpose in <B
|
||||
CLASS="COMMAND"
|
||||
>(* col)</B
|
||||
>,
|
||||
the resulting columns will be returned..
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>f</B
|
||||
> is the file descriptor. It can be
|
||||
stdout for example.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>data</B
|
||||
> is the data to render
|
||||
(see <A
|
||||
HREF="x1614.htm#MAILMIME-DATA"
|
||||
>the Section called <I
|
||||
>mailmime_data - Content of MIME part</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x2180.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x2669.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Parser functions</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c1586.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Creation functions</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
File diff suppressed because it is too large
Load Diff
|
@ -1,245 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>non-buffered I/O</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Tools and datatypes"
|
||||
HREF="c16.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Buffered I/O"
|
||||
HREF="x229.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="strings"
|
||||
HREF="x312.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x229.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 2. Tools and datatypes</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x312.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="MAILSTREAM-LOW"
|
||||
>non-buffered I/O</A
|
||||
></H1
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailstream_low_driver {
|
||||
ssize_t (* mailstream_read)(mailstream_low *, void *, size_t);
|
||||
ssize_t (* mailstream_write)(mailstream_low *, void *, size_t);
|
||||
int (* mailstream_close)(mailstream_low *);
|
||||
int (* mailstream_get_fd)(mailstream_low *);
|
||||
void (* mailstream_free)(mailstream_low *);
|
||||
};
|
||||
|
||||
typedef struct mailstream_low_driver mailstream_low_driver;
|
||||
|
||||
struct _mailstream_low {
|
||||
void * data;
|
||||
mailstream_low_driver * driver;
|
||||
};
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_low</B
|
||||
> is a non-buffered stream.
|
||||
</P
|
||||
><P
|
||||
> The <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_low_driver</B
|
||||
> is a set of
|
||||
functions used to access the stream.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_read/write/close()</B
|
||||
> is the same
|
||||
interface as <B
|
||||
CLASS="COMMAND"
|
||||
>read/write/close()</B
|
||||
>
|
||||
system calls, except that the file descriptor is replaced with the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_low</B
|
||||
> structure.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_get_fd()</B
|
||||
> returns the file
|
||||
descriptor used for this non-buffered stream.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstream_free()</B
|
||||
> is in charge to free
|
||||
the internal structure of the mailstream_low and the
|
||||
mailstream_low itself.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
mailstream_low * mailstream_low_new(void * data,
|
||||
mailstream_low_driver * driver);
|
||||
</PRE
|
||||
><P
|
||||
> mailstream_low_new() creates a low-level mailstream with the
|
||||
given internal structure (data) and using the given set of
|
||||
functions (driver).
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
ssize_t mailstream_low_write(mailstream_low * s, void * buf, size_t count);
|
||||
|
||||
ssize_t mailstream_low_read(mailstream_low * s, void * buf, size_t count);
|
||||
|
||||
int mailstream_low_close(mailstream_low * s);
|
||||
|
||||
int mailstream_low_get_fd(mailstream_low * s);
|
||||
|
||||
void mailstream_low_free(mailstream_low * s);
|
||||
</PRE
|
||||
><P
|
||||
> Each of these calls will call the corresponding function defined
|
||||
in the driver.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x229.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x312.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Buffered I/O</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>strings</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,431 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Helper functions</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="MIME"
|
||||
HREF="c1586.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Creation functions"
|
||||
HREF="x2669.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Storages, folders, messages"
|
||||
HREF="c2988.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x2669.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 4. MIME</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c2988.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN2946"
|
||||
>Helper functions</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILMIME-TRANSFER-ENCODING-GET"
|
||||
>mailmime_transfer_encoding_get</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailmime_transfer_encoding_get(struct mailmime_fields * fields);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_transfer_encoding_get()</B
|
||||
> will
|
||||
return the standard MIME encoding mechanism.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fields</B
|
||||
> is the list of MIME header
|
||||
fields.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> An integer representing the MIME encoding mechanism will
|
||||
be returned
|
||||
(see <A
|
||||
HREF="x1614.htm#MAILMIME-MECHANISM"
|
||||
>the Section called <I
|
||||
>mailmime_mechanism - MIME transfer encoding mechanism (Content-Transfer-Encoding)</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN2960"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 4-46. extracting MIME encoding mechanism</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
int fd;
|
||||
int r;
|
||||
|
||||
status = EXIT_FAILURE;
|
||||
|
||||
fd = open("message.rfc2822", O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
void * mem;
|
||||
struct stat stat_info;
|
||||
|
||||
r = fstat(fd, &stat_info);
|
||||
if (r >= 0) {
|
||||
mem = mmap(NULL, stat_info.st_size, PROT_READ, MAP_PRIVATE);
|
||||
if (mem != MAP_FAILED) {
|
||||
struct mailimf_fields * f;
|
||||
size_t current_index;
|
||||
|
||||
current_index = 0;
|
||||
r = mailimf_fields_parse(mem, stat_info.st_size,
|
||||
&current_index, &f);
|
||||
if (r == MAILIMF_NO_ERROR) {
|
||||
struct mailmime_fields * mime_fields;
|
||||
|
||||
r = mailmime_fields_parse(f, &mime_fields);
|
||||
if (r == MAILIMF_NO_ERROR) {
|
||||
int encoding;
|
||||
|
||||
encoding = mailmime_transfer_encoding_get(mime_fields);
|
||||
|
||||
/* do the things */
|
||||
|
||||
mailmime_fields_free(mime_fields);
|
||||
status = EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
mailimf_fields_free(f);
|
||||
}
|
||||
}
|
||||
munmap(mem, stat_info.st_size);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
exit(status);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILMIME-CONTENT-CHARSET-GET"
|
||||
>mailmime_content_charset_get and
|
||||
mailmime_content_param_get</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
char * mailmime_content_charset_get(struct mailmime_content * content);
|
||||
|
||||
char * mailmime_content_param_get(struct mailmime_content * content,
|
||||
char * name);
|
||||
|
||||
char * mailmime_extract_boundary(struct mailmime_content * content_type);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_content_charset_get()</B
|
||||
> will
|
||||
return the <B
|
||||
CLASS="COMMAND"
|
||||
>charset</B
|
||||
> parameter of
|
||||
MIME content type.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_content_param_get()</B
|
||||
> will
|
||||
return the value of a given parameter of
|
||||
MIME content type.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_extract_boundary()</B
|
||||
> will
|
||||
return the <B
|
||||
CLASS="COMMAND"
|
||||
>charset</B
|
||||
> parameter of
|
||||
MIME content type.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
>
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>content</B
|
||||
> is the MIME content type.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>name</B
|
||||
> is the name of the parameter to
|
||||
extract.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> With <B
|
||||
CLASS="COMMAND"
|
||||
>mailmime_extract_boundary()</B
|
||||
>, the
|
||||
returned value must be freed with
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>free()</B
|
||||
>.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN2985"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 4-47. extracting information from MIME content type</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
int fd;
|
||||
int r;
|
||||
|
||||
status = EXIT_FAILURE;
|
||||
|
||||
fd = open("message.rfc2822", O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
void * mem;
|
||||
struct stat stat_info;
|
||||
|
||||
r = fstat(fd, &stat_info);
|
||||
if (r >= 0) {
|
||||
mem = mmap(NULL, stat_info.st_size, PROT_READ, MAP_PRIVATE);
|
||||
if (mem != MAP_FAILED) {
|
||||
struct mailimf_fields * f;
|
||||
size_t current_index;
|
||||
|
||||
current_index = 0;
|
||||
r = mailimf_fields_parse(mem, stat_info.st_size,
|
||||
&current_index, &f);
|
||||
if (r == MAILIMF_NO_ERROR) {
|
||||
clistiter * cur;
|
||||
|
||||
for(cur = clist_begin(f->fld_list) ; cur != NULL ; cur =
|
||||
clist_next(cur)) {
|
||||
struct mailmime_field * mime_field;
|
||||
struct mailimf_field * field;
|
||||
|
||||
field = clist_content(cur);
|
||||
|
||||
if (field->fld_type == MAILIMF_FIELD_OPTIONAL_FIELD) {
|
||||
if (strcasecmp(field->fld_data.fld_optional_field->fld_name,
|
||||
"Content-Type") == 0) {
|
||||
struct mailmime_content * content_type;
|
||||
size_t current_index;
|
||||
|
||||
current_index = 0;
|
||||
r = mailmime_content_parse(field->fld_data.fld_optional_field->fld_value,
|
||||
strlen(field->fld_data.fld_optional_field->fld_value),
|
||||
&current_index, &content_type);
|
||||
if (r == MAILIMF_NO_ERROR) {
|
||||
char * charset;
|
||||
char * name;
|
||||
char * boundary;
|
||||
|
||||
charset = mailmime_content_charset_get(content_type);
|
||||
name = mailmime_content_param_get(content_type, "name");
|
||||
boundary = mailmime_extract_boundary(content_type);
|
||||
|
||||
/* do the things */
|
||||
|
||||
free(boundary);
|
||||
|
||||
status = EXIT_SUCCESS;
|
||||
mailmime_content_free(content_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mailimf_fields_free(f);
|
||||
}
|
||||
}
|
||||
munmap(mem, stat_info.st_size);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
exit(status);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x2669.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c2988.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Creation functions</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c1586.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Storages, folders, messages</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,208 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Error codes</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Storages, folders, messages"
|
||||
HREF="c2988.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Storages, folders, messages"
|
||||
HREF="c2988.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Storage"
|
||||
HREF="x3015.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c2988.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 5. Storages, folders, messages</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x3015.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN3011"
|
||||
>Error codes</A
|
||||
></H1
|
||||
><P
|
||||
> Error codes returned as integers can be one of the following :
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>enum {
|
||||
MAIL_NO_ERROR = 0,
|
||||
MAIL_NO_ERROR_AUTHENTICATED,
|
||||
MAIL_NO_ERROR_NON_AUTHENTICATED,
|
||||
MAIL_ERROR_NOT_IMPLEMENTED,
|
||||
MAIL_ERROR_UNKNOWN,
|
||||
MAIL_ERROR_CONNECT,
|
||||
MAIL_ERROR_BAD_STATE,
|
||||
MAIL_ERROR_FILE,
|
||||
MAIL_ERROR_STREAM,
|
||||
MAIL_ERROR_LOGIN,
|
||||
MAIL_ERROR_CREATE, /* 10 */
|
||||
MAIL_ERROR_DELETE,
|
||||
MAIL_ERROR_LOGOUT,
|
||||
MAIL_ERROR_NOOP,
|
||||
MAIL_ERROR_RENAME,
|
||||
MAIL_ERROR_CHECK,
|
||||
MAIL_ERROR_EXAMINE,
|
||||
MAIL_ERROR_SELECT,
|
||||
MAIL_ERROR_MEMORY,
|
||||
MAIL_ERROR_STATUS,
|
||||
MAIL_ERROR_SUBSCRIBE, /* 20 */
|
||||
MAIL_ERROR_UNSUBSCRIBE,
|
||||
MAIL_ERROR_LIST,
|
||||
MAIL_ERROR_LSUB,
|
||||
MAIL_ERROR_APPEND,
|
||||
MAIL_ERROR_COPY,
|
||||
MAIL_ERROR_FETCH,
|
||||
MAIL_ERROR_STORE,
|
||||
MAIL_ERROR_SEARCH,
|
||||
MAIL_ERROR_DISKSPACE,
|
||||
MAIL_ERROR_MSG_NOT_FOUND, /* 30 */
|
||||
MAIL_ERROR_PARSE,
|
||||
MAIL_ERROR_INVAL,
|
||||
MAIL_ERROR_PART_NOT_FOUND,
|
||||
MAIL_ERROR_REMOVE,
|
||||
MAIL_ERROR_FOLDER_NOT_FOUND,
|
||||
MAIL_ERROR_MOVE,
|
||||
MAIL_ERROR_STARTTLS,
|
||||
MAIL_ERROR_CACHE_MISS,
|
||||
MAIL_ERROR_NO_TLS,
|
||||
MAIL_ERROR_EXPUNGE,
|
||||
/* misc errors */
|
||||
MAIL_ERROR_MISC,
|
||||
MAIL_ERROR_PROTOCOL,
|
||||
MAIL_ERROR_CAPABILITY,
|
||||
MAIL_ERROR_CLOSE,
|
||||
MAIL_ERROR_FATAL,
|
||||
MAIL_ERROR_READONLY,
|
||||
MAIL_ERROR_NO_APOP,
|
||||
MAIL_ERROR_COMMAND_NOT_SUPPORTED,
|
||||
MAIL_ERROR_NO_PERMISSION,
|
||||
MAIL_ERROR_PROGRAM_ERROR,
|
||||
MAIL_ERROR_SUBJECT_NOT_FOUND,
|
||||
MAIL_ERROR_CHAR_ENCODING_FAILED,
|
||||
MAIL_ERROR_SEND,
|
||||
MAIL_ERROR_COMMAND,
|
||||
};
|
||||
</PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c2988.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x3015.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Storages, folders, messages</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c2988.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Storage</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,433 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Storage</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Storages, folders, messages"
|
||||
HREF="c2988.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Error codes"
|
||||
HREF="x3011.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Folder"
|
||||
HREF="x3082.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x3011.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 5. Storages, folders, messages</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x3082.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN3015"
|
||||
>Storage</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILSTORAGE-DRIVER"
|
||||
>Storage driver</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
typedef struct mailstorage_driver mailstorage_driver;
|
||||
|
||||
struct mailstorage_driver {
|
||||
char * sto_name;
|
||||
int (* sto_connect)(struct mailstorage * storage);
|
||||
int (* sto_get_folder_session)(struct mailstorage * storage,
|
||||
char * pathname, mailsession ** result);
|
||||
void (* sto_uninitialize)(struct mailstorage * storage);
|
||||
};
|
||||
</PRE
|
||||
><P
|
||||
> This is the driver for a storage.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_name</B
|
||||
> is the name of the driver.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_connect()</B
|
||||
> connects the storage to
|
||||
the remote access or to the path in the local filesystem.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_get_folder_session()</B
|
||||
> can have two
|
||||
kinds of behaviour. Either it creates a new session and
|
||||
independant from the session used by the storage and
|
||||
select the given mailbox or it selects the given mailbox
|
||||
in the current session. It depends on the efficiency of
|
||||
the mail access.
|
||||
</P
|
||||
><P
|
||||
> <SPAN
|
||||
CLASS="emphasis"
|
||||
><I
|
||||
CLASS="EMPHASIS"
|
||||
>XXX - in the future, this will be moved to the
|
||||
folder driver</I
|
||||
></SPAN
|
||||
>
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_uninitialize()</B
|
||||
> frees the data
|
||||
created with mailstorage constructor.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILSTORAGE"
|
||||
>Storage</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailstorage {
|
||||
char * sto_id;
|
||||
void * sto_data;
|
||||
mailsession * sto_session;
|
||||
mailstorage_driver * sto_driver;
|
||||
clist * sto_shared_folders; /* list of (struct mailfolder *) */
|
||||
|
||||
void * sto_user_data;
|
||||
};
|
||||
</PRE
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_id</B
|
||||
> is an identifier for the
|
||||
storage. This can be <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
>.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_data</B
|
||||
> is the internal data
|
||||
of the storage. This can only be changed by the driver.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_session</B
|
||||
> is the session used by
|
||||
the storage. The session can be used to send commands.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_driver</B
|
||||
> is the driver of the
|
||||
storage.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_shared_folders</B
|
||||
> is the list of
|
||||
folders that share the session with the storage.
|
||||
This is used internally.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>sto_user_data</B
|
||||
> is a field for free
|
||||
use. The user can store any data in that field.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILSTORAGE-NEW"
|
||||
>mailstorage_new and mailstorage_free</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailstorage * mailstorage_new(char * sto_id);
|
||||
|
||||
void mailstorage_free(struct mailstorage * storage);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstorage_new()</B
|
||||
> initializes a storage
|
||||
structure with an identifier (<B
|
||||
CLASS="COMMAND"
|
||||
>sto_id</B
|
||||
>) and
|
||||
with no driver.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstorage_free()</B
|
||||
> free the memory used
|
||||
by a storage.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILSTORAGE-CONNECT"
|
||||
>mailstorage_connect and mailstorage_disconnect</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailstorage_connect(struct mailstorage * storage);
|
||||
|
||||
void mailstorage_disconnect(struct mailstorage * storage);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstorage_connect()</B
|
||||
> connects the storage.
|
||||
This function can also be used to confirm that a storage
|
||||
connection is valid when the storage is already connected.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailstorage_disconnect()</B
|
||||
> disconnects the
|
||||
storage.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN3074"
|
||||
>IMAP storage</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int imap_mailstorage_init(struct mailstorage * storage,
|
||||
char * imap_servername, uint16_t imap_port,
|
||||
char * imap_command,
|
||||
int imap_connection_type, int imap_auth_type,
|
||||
char * imap_login, char * imap_password,
|
||||
int imap_cached, char * imap_cache_directory);
|
||||
</PRE
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN3077"
|
||||
>Example</A
|
||||
></H2
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN3079"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 5-1. use of storage</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int main(void)
|
||||
{
|
||||
struct mailstorage * storage;
|
||||
int r;
|
||||
|
||||
storage = mailstorage_new(NULL);
|
||||
|
||||
imap_mailstorage_init(storage, "imap.my-servers.org", 0,
|
||||
NULL, CONNECTION_TYPE_TRY_STARTTLS, IMAP_AUTH_TYPE_PLAIN,
|
||||
"my-login", "my-password", 1, "/home/login/.libetpan/cache");
|
||||
|
||||
r = mailstorage_connect(storage);
|
||||
if (r == MAIL_NO_ERROR) {
|
||||
mailstorage_disconnect(storage);
|
||||
}
|
||||
|
||||
mailstorage_free(storage);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x3011.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x3082.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Error codes</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c2988.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Folder</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,691 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Folder</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Storages, folders, messages"
|
||||
HREF="c2988.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Storage"
|
||||
HREF="x3015.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Message"
|
||||
HREF="x3198.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x3015.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 5. Storages, folders, messages</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x3198.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN3082"
|
||||
>Folder</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-DRIVER"
|
||||
>Folder driver</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
typedef struct mailfolder_driver mailfolder_driver;
|
||||
|
||||
struct mailfolder_driver {
|
||||
int (* fld_get_session)(struct mailfolder * folder,
|
||||
mailsession ** result);
|
||||
|
||||
int (* fld_noop)(struct mailfolder * folder);
|
||||
|
||||
int (* fld_check)(struct mailfolder * folder);
|
||||
|
||||
int (* fld_expunge)(struct mailfolder * folder);
|
||||
|
||||
int (* fld_status)(struct mailfolder * folder,
|
||||
uint32_t * result_messages, uint32_t * result_recent,
|
||||
uint32_t * result_unseen);
|
||||
|
||||
int (* fld_append_message)(struct mailfolder * folder,
|
||||
char * message, size_t size);
|
||||
|
||||
int (* fld_get_messages_list)(struct mailfolder * folder,
|
||||
struct mailmessage_list ** result);
|
||||
|
||||
int (* fld_get_envelopes_list)(struct mailfolder * folder,
|
||||
struct mailmessage_list * result);
|
||||
|
||||
int (* fld_get_message)(struct mailfolder * folder,
|
||||
uint32_t num, mailmessage ** result);
|
||||
|
||||
int (* fld_get_message_by_uid)(struct mailfolder * folder,
|
||||
const char * uid, mailmessage ** result);
|
||||
}
|
||||
</PRE
|
||||
><P
|
||||
> XXX - this will be implemented in the future.
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_get_session()</B
|
||||
> will return the session
|
||||
this folder should use.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> For other method, you should see <A
|
||||
HREF="x3472.htm#MAILSESSION-DRIVER"
|
||||
>the Section called <I
|
||||
>Session driver</I
|
||||
></A
|
||||
>.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN3095"
|
||||
>Folder</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailfolder {
|
||||
char * fld_pathname;
|
||||
char * fld_virtual_name;
|
||||
|
||||
struct mailstorage * fld_storage;
|
||||
|
||||
mailsession * fld_session;
|
||||
int fld_shared_session;
|
||||
clistiter * fld_pos;
|
||||
|
||||
struct mailfolder * fld_parent;
|
||||
unsigned int fld_sibling_index;
|
||||
carray * fld_children; /* array of (struct mailfolder *) */
|
||||
|
||||
void * fld_user_data;
|
||||
};
|
||||
</PRE
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_pathname</B
|
||||
> is the pathname specific to
|
||||
the driver.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_virtual_name</B
|
||||
> is the identifier of
|
||||
this folder. This can be <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
>.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_storage</B
|
||||
> is the storage used for this
|
||||
folder (see <A
|
||||
HREF="x3015.htm#MAILSTORAGE"
|
||||
>the Section called <I
|
||||
>Storage</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_session</B
|
||||
> is the session used for this
|
||||
folder.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_shared_session</B
|
||||
> is set to 1 if the
|
||||
folder use the same session as the storage. This is used
|
||||
internally.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_pos</B
|
||||
> is the
|
||||
position in the list of folders of the storage.
|
||||
This is used internally.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> use of <B
|
||||
CLASS="COMMAND"
|
||||
>fld_parent</B
|
||||
>,
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>fld_sibling_index</B
|
||||
> and
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>fld_children</B
|
||||
> is deprecated.
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>fld_user_data</B
|
||||
> is a field for free
|
||||
use. The user can store any data in that field.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-NEW"
|
||||
>mailfolder_new and mail_folder_free</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
struct mailfolder * mailfolder_new(struct mailstorage * fld_storage,
|
||||
char * fld_pathname, char * fld_virtual_name);
|
||||
|
||||
void mailfolder_free(struct mailfolder * folder);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailfolder_new()</B
|
||||
> initializes a folder
|
||||
structure with an identifier
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>fld_virtual_name</B
|
||||
>) with path name
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>fld_pathname</B
|
||||
>). The folder will be owned
|
||||
by the given storage (<B
|
||||
CLASS="COMMAND"
|
||||
>fld_storage</B
|
||||
>).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailfolder_free()</B
|
||||
> free the memory used
|
||||
by the folder.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-CONNECT"
|
||||
>mailfolder_connect and mailfolder_disconnect</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailfolder_connect(struct mailfolder * folder);
|
||||
|
||||
void mailfolder_disconnect(struct mailfolder * folder);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailfolder_connect()</B
|
||||
> connects the folder.
|
||||
This function can also be used to confirm that a folder
|
||||
connection is valid when the folder is already connected.
|
||||
When doing operations with several folders, you have to be
|
||||
sure that this function has been called before making calls
|
||||
on folder.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mailfolder_disconnect()</B
|
||||
> disconnects the
|
||||
folder.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-NOOP"
|
||||
>mailfolder_noop</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailfolder_noop(struct mailfolder * folder);
|
||||
</PRE
|
||||
><P
|
||||
> This function will only send noop to the mail access.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-CHECK"
|
||||
>mailfolder_check</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailfolder_check(struct mailfolder * folder);
|
||||
</PRE
|
||||
><P
|
||||
> A call to this function will save to disk the internal state
|
||||
of the selected mailbox (such as flags).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-EXPUNGE"
|
||||
>mailfolder_expunge</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int mailfolder_expunge(struct mailfolder * folder);
|
||||
</PRE
|
||||
><P
|
||||
> A call to this function will delete all messages marked for
|
||||
deletion.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-STATUS"
|
||||
>mailfolder_status</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int mailfolder_status(struct mailfolder * folder,
|
||||
uint32_t * result_messages, uint32_t * result_recent,
|
||||
uint32_t * result_unseen);
|
||||
</PRE
|
||||
><P
|
||||
> A call to this function will return some counts of messages
|
||||
in the mailbox.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-APPEND-MESSAGE"
|
||||
>mailfolder_append_message</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int mailfolder_append_message(struct mailfolder * folder,
|
||||
char * message, size_t size);
|
||||
</PRE
|
||||
><P
|
||||
> This function will store a new message in the given folder.
|
||||
The message is given by a string in memory
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>message</B
|
||||
>) and a size
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>size</B
|
||||
>).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-GET-MESSAGES-LIST"
|
||||
>mailfolder_get_messages_list</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int mailfolder_get_messages_list(struct mailfolder * folder,
|
||||
struct mailmessage_list ** result);
|
||||
</PRE
|
||||
><P
|
||||
> This function will return the list of messages in the given
|
||||
folder (see <A
|
||||
HREF="x3198.htm#MAILMESSAGE-LIST"
|
||||
>the Section called <I
|
||||
>Message list</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-GET-ENVELOPES-LIST"
|
||||
>mailfolder_get_envelopes_list</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int mailfolder_get_envelopes_list(struct mailfolder * folder,
|
||||
struct mailmessage_list * result);
|
||||
</PRE
|
||||
><P
|
||||
> This function will fill the list of parsed header fields
|
||||
structure in the <B
|
||||
CLASS="COMMAND"
|
||||
>mailmessage</B
|
||||
> structures
|
||||
of the given list of messages (<B
|
||||
CLASS="COMMAND"
|
||||
>result</B
|
||||
>).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-GET-MESSAGE"
|
||||
>mailfolder_get_message</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int mailfolder_get_message(struct mailfolder * folder,
|
||||
uint32_t num, mailmessage ** result);
|
||||
</PRE
|
||||
><P
|
||||
> This function will return the message identified by a
|
||||
message index (<B
|
||||
CLASS="COMMAND"
|
||||
>num</B
|
||||
>)
|
||||
This will return a <B
|
||||
CLASS="COMMAND"
|
||||
>mailmessage</B
|
||||
> structure
|
||||
in <B
|
||||
CLASS="COMMAND"
|
||||
>(* result)</B
|
||||
> (see <A
|
||||
HREF="x3198.htm#MAILMESSAGE"
|
||||
>the Section called <I
|
||||
>Message</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAILFOLDER-GET-MESSAGE-BY-UID"
|
||||
>mailfolder_get_message_by_uid</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int mailfolder_get_message_by_uid(struct mailfolder * folder,
|
||||
const char * uid, mailmessage ** result);
|
||||
</PRE
|
||||
><P
|
||||
> This function will return the message identified by a
|
||||
unique identifier (<B
|
||||
CLASS="COMMAND"
|
||||
>uid</B
|
||||
>)
|
||||
This will return a <B
|
||||
CLASS="COMMAND"
|
||||
>mailmessage</B
|
||||
> structure
|
||||
in <B
|
||||
CLASS="COMMAND"
|
||||
>(* result)</B
|
||||
> (see <A
|
||||
HREF="x3198.htm#MAILMESSAGE"
|
||||
>the Section called <I
|
||||
>Message</I
|
||||
></A
|
||||
>).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="AEN3193"
|
||||
>Example</A
|
||||
></H2
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN3195"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 5-2. use of folder</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int main(void)
|
||||
{
|
||||
struct mailstorage * storage;
|
||||
int r;
|
||||
|
||||
storage = mailstorage_new(NULL);
|
||||
|
||||
imap_mailstorage_init(storage, "imap.my-servers.org", 0,
|
||||
NULL, CONNECTION_TYPE_TRY_STARTTLS, IMAP_AUTH_TYPE_PLAIN,
|
||||
"my-login", "my-password", 1, "/home/login/.libetpan/cache");
|
||||
|
||||
r = mailstorage_connect(storage);
|
||||
if (r == MAIL_NO_ERROR) {
|
||||
struct mailfolder * folder;
|
||||
|
||||
folder = mailfolder_new(storage, "INBOX", NULL);
|
||||
|
||||
r = mailfolder_connect(folder);
|
||||
if (r == MAIL_NO_ERROR) {
|
||||
struct mailmessage_list * msg_list;
|
||||
|
||||
mailfolder_get_messages_list(folder, &msg_list);
|
||||
|
||||
/* do the things */
|
||||
|
||||
mailmessage_list_free(msg_list);
|
||||
|
||||
mailfolder_disconnect(folder);
|
||||
}
|
||||
|
||||
mailstorage_disconnect(storage);
|
||||
}
|
||||
|
||||
mailstorage_free(storage);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x3015.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x3198.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Storage</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c2988.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Message</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,477 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>strings</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Tools and datatypes"
|
||||
HREF="c16.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="non-buffered I/O"
|
||||
HREF="x289.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Internet Message Format"
|
||||
HREF="c385.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x289.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 2. Tools and datatypes</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c385.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AEN312"
|
||||
>strings</A
|
||||
></H1
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>
|
||||
#include <libetpan/libetpan.h>
|
||||
|
||||
struct _MMAPString
|
||||
{
|
||||
char * str;
|
||||
size_t len;
|
||||
size_t allocated_len;
|
||||
int fd;
|
||||
size_t mmapped_size;
|
||||
};
|
||||
|
||||
typedef struct _MMAPString MMAPString;
|
||||
</PRE
|
||||
><P
|
||||
> MMAPString is a string which size that can increase automatically.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MMAP-STRING-NEW"
|
||||
>constructor and destructor</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>MMAPString * mmap_string_new(const char * init);
|
||||
|
||||
MMAPString * mmap_string_new_len(const char * init, size_t len);
|
||||
|
||||
MMAPString * mmap_string_sized_new(size_t dfl_size);
|
||||
|
||||
void mmap_string_free(MMAPString * string);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_new()</B
|
||||
> allocates a new
|
||||
string. init is the intial value of the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_new_len()</B
|
||||
> allocates a new
|
||||
string. init is the intial value of the
|
||||
string, len is the length of the initial string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_sized_new()</B
|
||||
> allocates a new
|
||||
string. dfl_size is the initial allocation of
|
||||
the string. <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_free()</B
|
||||
> release the memory used
|
||||
by the string.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MMAP-STRING-ASSIGN"
|
||||
>string value modification</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>MMAPString * mmap_string_assign(MMAPString * string, const char * rval);
|
||||
|
||||
MMAPString * mmap_string_truncate(MMAPString *string, size_t len);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_assign()</B
|
||||
> sets a new value for
|
||||
the given string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_truncate()</B
|
||||
> sets a length for
|
||||
the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>MMAPString * mmap_string_set_size (MMAPString * string, size_t len);
|
||||
</PRE
|
||||
><P
|
||||
> sets the allocation of the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MMAP-STRING-APPEND"
|
||||
>insertion in string, deletion in string</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>MMAPString * mmap_string_insert_len(MMAPString * string, size_t pos,
|
||||
const char * val, size_t len);
|
||||
|
||||
MMAPString * mmap_string_append(MMAPString * string, const char * val);
|
||||
|
||||
MMAPString * mmap_string_append_len(MMAPString * string,
|
||||
const char * val, size_t len);
|
||||
|
||||
MMAPString * mmap_string_append_c(MMAPString * string, char c);
|
||||
|
||||
MMAPString * mmap_string_prepend(MMAPString * string, const char * val);
|
||||
|
||||
MMAPString * mmap_string_prepend_c(MMAPString * string, char c);
|
||||
|
||||
MMAPString * mmap_string_prepend_len(MMAPString * string, const char * val,
|
||||
size_t len);
|
||||
|
||||
MMAPString * mmap_string_insert(MMAPString * string, size_t pos,
|
||||
const char * val);
|
||||
|
||||
MMAPString * mmap_string_insert_c(MMAPString *string, size_t pos,
|
||||
char c);
|
||||
|
||||
MMAPString * mmap_string_erase(MMAPString * string, size_t pos,
|
||||
size_t len);
|
||||
</PRE
|
||||
><P
|
||||
> For complexity here, n is the size of the given MMAPString,
|
||||
and len is the size of the string to insert.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_insert_len()</B
|
||||
> inserts the given
|
||||
string value of given length in the string at the given
|
||||
position. <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(n + len).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_append()</B
|
||||
> appends the given
|
||||
string value at the end of the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(len).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_append_len()</B
|
||||
> appends the
|
||||
given string value of given length at the end of the
|
||||
string. <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(len).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_append_c()</B
|
||||
> appends the given
|
||||
character at the end of the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_prepend()</B
|
||||
> insert the given
|
||||
string value at the beginning of the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(n + len).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_prepend_c()</B
|
||||
> insert the given
|
||||
character at the beginning of the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_prepend_len()</B
|
||||
> insert the given
|
||||
string value of given length at the beginning of the string.
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(n + len).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_insert()</B
|
||||
> inserts the given
|
||||
string value in the string at the given position.
|
||||
NULL will be returned on error.
|
||||
Complexity is O(n + len).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_insert_c()</B
|
||||
> inserts the given
|
||||
character in the string at the given position.
|
||||
NULL will be returned on error.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_erase()</B
|
||||
> removes the given
|
||||
count of characters (len) at the given position of the
|
||||
string. <B
|
||||
CLASS="COMMAND"
|
||||
>NULL</B
|
||||
> will be returned on error.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MMAP-STRING-REF"
|
||||
>referencing string</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int mmap_string_ref(MMAPString * string);
|
||||
|
||||
int mmap_string_unref(char * str);
|
||||
</PRE
|
||||
><P
|
||||
> MMAPString provides a mechanism that let you use MMAPString
|
||||
like normal strings. You have first to use
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_ref()</B
|
||||
>, so that you notify
|
||||
that the string will be used as a normal string, then, you
|
||||
use <B
|
||||
CLASS="COMMAND"
|
||||
>mmapstr->str</B
|
||||
> to refer to the
|
||||
string. When you have finished and you want to free a string
|
||||
corresponding to a <B
|
||||
CLASS="COMMAND"
|
||||
>MMAPString</B
|
||||
>, you will
|
||||
use <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_unref</B
|
||||
>.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_ref()</B
|
||||
> references the string
|
||||
so that the array of characters can be used as a normal
|
||||
string then released with
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mmap_string_unref()</B
|
||||
>.
|
||||
The array of characters will be obtained with string->str.
|
||||
returns -1 on error, 0 on success.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x289.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c385.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>non-buffered I/O</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Internet Message Format</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,600 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>List</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan! API"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Tools and datatypes"
|
||||
HREF="c16.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Tools and datatypes"
|
||||
HREF="c16.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Hash table"
|
||||
HREF="x161.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan! API</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 2. Tools and datatypes</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x161.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="CLIST"
|
||||
>List</A
|
||||
></H1
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
typedef struct clist_s clist;
|
||||
|
||||
typedef clistcell clistiter;
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist()</B
|
||||
> is a list of cells.
|
||||
Each cell of the list contains one element. This element is a
|
||||
pointer. An iterator (<B
|
||||
CLASS="COMMAND"
|
||||
>clistiter</B
|
||||
>) is a
|
||||
pointer to an element of the list. With an iterator, we can
|
||||
get the previous element of the list, the next element of the
|
||||
list and the content of the element.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CLIST-NEW"
|
||||
>clist_new and clist_free</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>clist * clist_new(void);
|
||||
|
||||
void clist_free(clist *);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_new()</B
|
||||
> allocates a new empty list and
|
||||
returns it.
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_free()</B
|
||||
> frees the entire list with
|
||||
its cells.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN101"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-5. clist creation</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
clist * list;
|
||||
|
||||
list = clist_new();
|
||||
if (list == NULL)
|
||||
goto err;
|
||||
|
||||
r = clist_append(list, "foo-bar");
|
||||
if (r < 0)
|
||||
|
||||
clist_free(list);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
free:
|
||||
clist_free(list);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CLIST-COUNT"
|
||||
>clist_isempty and clist_count</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int clist_isempty(clist *);
|
||||
|
||||
int clist_count(clist *);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_isempty()</B
|
||||
> returns 1 if the list is
|
||||
empty, else it is 0.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_count()</B
|
||||
> returns the number of
|
||||
elements in the list.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CLIST-BEGIN"
|
||||
>running through clist</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>clistiter * clist_begin(clist *);
|
||||
|
||||
clistiter * clist_end(clist *);
|
||||
|
||||
clistiter * clist_next(clistiter *);
|
||||
|
||||
clistiter * clist_previous(clistiter *);
|
||||
|
||||
void * clist_content(clistiter *);
|
||||
|
||||
void * clist_nth_data(clist * lst, int index);
|
||||
|
||||
clistiter * clist_nth(clist * lst, int index);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_begin()</B
|
||||
> returns an iterator to the
|
||||
first element of the list.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_end()</B
|
||||
> returns an iterator to the last
|
||||
element of the list.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_next()</B
|
||||
> returns an iterator to the
|
||||
next element of the list.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_previous()</B
|
||||
> returns an iterator to the
|
||||
previous element of the list.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_content()</B
|
||||
> returns the element
|
||||
contained in the cell pointed by the iterator in the list.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_nth()</B
|
||||
> returns an iterator on the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>index</B
|
||||
>-th element of the list.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_nth_data()</B
|
||||
> returns the index-th
|
||||
element of the list.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN129"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-6. displaying content of clist</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
clist * list;
|
||||
clistiter * iter;
|
||||
|
||||
list = build_string_list();
|
||||
if (list == NULL)
|
||||
goto err;
|
||||
|
||||
for(iter = clist_begin(list) ; iter != NULL ; iter =
|
||||
clist_next(iter)) {
|
||||
char * str;
|
||||
|
||||
str = clist_content(iter);
|
||||
printf("%s\n", str);
|
||||
}
|
||||
|
||||
clist_free(list);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
free:
|
||||
clist_free(list);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CLIST-APPEND"
|
||||
>clist modification</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>int clist_prepend(clist *, void *);
|
||||
|
||||
int clist_append(clist *, void *);
|
||||
|
||||
int clist_insert_before(clist *, clistiter *, void *);
|
||||
|
||||
int clist_insert_after(clist *, clistiter *, void *);
|
||||
|
||||
clistiter * clist_delete(clist *, clistiter *);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_prepend()</B
|
||||
> adds an element at the
|
||||
beginning of the list. Returns 0 on sucess, -1 on error.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_append()</B
|
||||
> adds an element at the end
|
||||
of the list. Returns 0 on sucess, -1 on error.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_insert_before()</B
|
||||
> adds an element
|
||||
before the element pointed by the given iterator in the
|
||||
list. Returns 0 on sucess, -1 on error.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_insert_after()</B
|
||||
> adds an element after
|
||||
the element pointed by the given iterator in the list.
|
||||
Returns 0 on sucess, -1 on error.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_delete()</B
|
||||
> the elements pointed by
|
||||
the given iterator in the list and returns an iterator to
|
||||
the next element of the list.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN145"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-7. deleting elements in a clist</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
voir print_content(void * content, void * user_data)
|
||||
{
|
||||
char * str;
|
||||
|
||||
str = content;
|
||||
|
||||
printf("%s\n", str);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
clist * list;
|
||||
clistiter * iter;
|
||||
|
||||
list = build_string_list();
|
||||
if (list == NULL)
|
||||
goto err;
|
||||
|
||||
iter = = clist_begin(list);
|
||||
while (iter != NULL)
|
||||
char * str;
|
||||
|
||||
str = clist_content(iter);
|
||||
if (strcmp(str, "foo-bar") == 0)
|
||||
iter = clist_delete(list, cur);
|
||||
else
|
||||
iter = clist_next(iter);
|
||||
}
|
||||
|
||||
clist_foreach(list, print_content, NULL);
|
||||
printf("\n");
|
||||
|
||||
clist_free(list);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
free:
|
||||
clist_free(list);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CLIST-FOREACH"
|
||||
>clist_foreach</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>typedef void (* clist_func)(void *, void *);
|
||||
|
||||
void clist_foreach(clist * lst, clist_func func, void * data);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_foreach()</B
|
||||
> apply a fonction to each
|
||||
element of the list.
|
||||
Complexity is O(n).
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CLIST-CONCAT"
|
||||
>clist_concat</A
|
||||
></H2
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>void clist_concat(clist * dest, clist * src);
|
||||
</PRE
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>clist_concat()</B
|
||||
> adds all the elements of src
|
||||
at the end of dest. Elements are added in the same
|
||||
order. src is an empty list when the operation is finished.
|
||||
Complexity is O(1).
|
||||
</P
|
||||
><DIV
|
||||
CLASS="EXAMPLE"
|
||||
><A
|
||||
NAME="AEN158"
|
||||
></A
|
||||
><P
|
||||
><B
|
||||
>Example 2-8. merging two clists</B
|
||||
></P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>#include <libetpan/libetpan.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
clist * list;
|
||||
clist * list_2;
|
||||
clistiter * iter;
|
||||
|
||||
list = build_string_list();
|
||||
if (list == NULL)
|
||||
goto err;
|
||||
|
||||
list_2 = build_string_list_2();
|
||||
if (list == NULL)
|
||||
goto free_list;
|
||||
|
||||
clist_concat(list, list_2);
|
||||
clist_free(list_2);
|
||||
|
||||
for(iter = clist_begin(list) ; iter != NULL ; iter =
|
||||
clist_next(iter)) {
|
||||
char * str;
|
||||
|
||||
str = clist_content(iter);
|
||||
printf("%s\n", str);
|
||||
}
|
||||
|
||||
clist_free(list);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
free_list:
|
||||
clist_free(list);
|
||||
err:
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x161.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Tools and datatypes</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c16.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Hash table</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,654 +0,0 @@
|
|||
1/ Introduction
|
||||
---------------
|
||||
|
||||
libEtPan! is mainly a library that will handle all kind of mailbox access.
|
||||
For example: IMAPrev4, POP3, NNTP, mbox, MH.
|
||||
|
||||
You have two kinds of mailbox access, either using low-level functions
|
||||
with a different interface for each kind of access or using higher-level
|
||||
functions, using a driver to wrap the higher-level API.
|
||||
|
||||
|
||||
2/ Low-level
|
||||
------------
|
||||
|
||||
2.1/ IMAP4rev1 - Internet Message Access Protocol - Version 4rev1
|
||||
-----------------------------------------------------------------
|
||||
|
||||
Each command of the IMAP4rev1 Standard (RFC 2060) is implemented in
|
||||
the IMAP4rev1 module. Directory imap/.
|
||||
|
||||
2.1.1/ References
|
||||
|
||||
- RFC 2060 - INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1
|
||||
- draft-crispin-imapv-15.txt
|
||||
|
||||
Not yet implemented :
|
||||
|
||||
- draft-crispin-imapv-20.txt
|
||||
|
||||
2.1.2/ Dependencies
|
||||
|
||||
- tools/
|
||||
|
||||
2.1.3/ Files descriptions
|
||||
|
||||
description of header files :
|
||||
mailimap.[ch] -- functions that implements each IMAP4rev1 command
|
||||
mailimap_helper.[ch] -- helper interface for the previous functions
|
||||
mailimap_types.[ch] -- definition of types and constructors for these
|
||||
types
|
||||
mailimap_types_helper.[ch] -- contains function definitions that will help
|
||||
to create data necessary to use IMAP4rev1 module
|
||||
mailimap_socket.[ch] -- provides a function to connect to an
|
||||
IMAP4rev1 server over TCP
|
||||
mailimap_ssl.[ch] -- provides a function to connect to an
|
||||
IMAP4rev1 server over TLS layer
|
||||
|
||||
2.1.4/ Interface
|
||||
|
||||
Include for this module is mailimap.h and includes all other headers.
|
||||
|
||||
|
||||
The interface of IMAP4rev1 is documented in the following files :
|
||||
|
||||
mailimap.h
|
||||
mailimap_types.h
|
||||
mailimap_types_helper.h
|
||||
|
||||
|
||||
2.2/ POP3 - Post Office Protocol - Version 3
|
||||
--------------------------------------------
|
||||
|
||||
Each command of the POP3 Standard (RFC 1939 and RFC 2449) is implemented
|
||||
in the POP3 module. Directory pop3/.
|
||||
|
||||
2.1.1/ References
|
||||
|
||||
- RFC 1939 - Post Office Protocol - Version 3
|
||||
- RFC 2449 - POP3 Extension Mechanism (CAPA)
|
||||
|
||||
Not yet implemented :
|
||||
|
||||
- RFC 1734 - POP3 AUTHentication command
|
||||
|
||||
2.1.2/ Dependencies
|
||||
|
||||
- tools/
|
||||
|
||||
2.2.3/ Files descriptions
|
||||
|
||||
mailpop3.[ch] -- functions that implements each POP3 command
|
||||
mailpop3_helper.[ch] -- helper interface for the previous functions
|
||||
mailpop3_socket.[ch] -- provides a function to connect to a
|
||||
POP3 server over TCP
|
||||
mailpop3_ssl.[ch] -- provides a function to connect to a
|
||||
POP3 server over TLS layer
|
||||
|
||||
2.2.4/ Interface
|
||||
|
||||
Include for this module is mailpop3.h and includes all other headers.
|
||||
|
||||
There is not yet documentation for POP3 module.
|
||||
|
||||
|
||||
2.3/ NNTP - Network News Transfer Protocol
|
||||
------------------------------------------
|
||||
|
||||
Each command of the NNTP Standard (RFC 977 and RFC 2980) is implemented
|
||||
in the NNTP module. Directory nntp/.
|
||||
|
||||
2.3.1/ References
|
||||
|
||||
- RFC 977 - Network News Transfer Protocol
|
||||
- RFC 2980 - Common NNTP Extensions
|
||||
|
||||
Not yet implemented :
|
||||
|
||||
- RFC 1036 - Standard for Interchange of USENET Messages
|
||||
- son of RFC 1036 : FTP://zoo.toronto.edu/pub/news.txt.Z
|
||||
|
||||
2.3.2/ Dependencies
|
||||
|
||||
- tools/
|
||||
|
||||
2.3.3/ Files descriptions
|
||||
|
||||
newsnntp.[ch] -- functions that implements each NNTP command
|
||||
newsnntp_socket.[ch] -- provides a function to connect to a
|
||||
NNTP server over TCP
|
||||
newsnntp_ssl.[ch] -- provides a function to connect to a
|
||||
POP3 server over TLS layer
|
||||
|
||||
2.3.4/ Interface
|
||||
|
||||
Include for this module is newsnntp.h and includes all other headers.
|
||||
|
||||
There is not yet documentation for NNTP module.
|
||||
|
||||
|
||||
2.4/ mbox
|
||||
---------
|
||||
|
||||
The mbox module provides a set of functions to manipulate mbox mailboxes.
|
||||
These functions make a safe lock on the mailbox they work with.
|
||||
This module will assign to each message a unique message identifier
|
||||
so that we can work with message numbers in mbox files without other
|
||||
programs interfer.
|
||||
Directory mbox/.
|
||||
|
||||
2.4.1/ References
|
||||
|
||||
- http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html
|
||||
- http://www.qmail.org/qmail-manual-html/man5/mbox.html
|
||||
|
||||
2.4.2/ Dependencies
|
||||
|
||||
- tools/
|
||||
- imf/
|
||||
|
||||
2.5.3/ Specific to libEtPan!
|
||||
|
||||
- "X-LibEtPan-UID" header
|
||||
|
||||
2.5.4/ Files descriptions
|
||||
|
||||
mailmbox.[ch] -- functions to manipulate mbox mailboxes.
|
||||
mailmbox_parse.[ch] -- this module is in charge of parsing the
|
||||
mbox file content
|
||||
mailmbox_types.[ch] -- definition of types and constructors for these
|
||||
types
|
||||
|
||||
2.4.5/ Interface
|
||||
|
||||
Include for this module is mailmbox.h and includes all other headers.
|
||||
|
||||
There is not yet documentation for mbox module.
|
||||
|
||||
|
||||
2.5/ MH
|
||||
-------
|
||||
|
||||
The MH module provides a set of functions to manipulate MH mailboxes.
|
||||
Directory mh/.
|
||||
|
||||
2.5.1/ References
|
||||
|
||||
- almost none
|
||||
|
||||
2.5.2/ Dependencies
|
||||
|
||||
- tools/
|
||||
|
||||
2.5.3/ Files descriptions
|
||||
|
||||
mailmh.[ch] -- functions to manipulate MH mailboxes.
|
||||
|
||||
|
||||
2.5.4/ Interface
|
||||
|
||||
Include for this module is mailmh.h.
|
||||
|
||||
There is not yet documentation for MH module.
|
||||
|
||||
|
||||
2.6/ IMF - Internet Message Format
|
||||
----------------------------------
|
||||
|
||||
The IMF module provides functions to parse data given in RFC 2822
|
||||
format (Internet Message Format).
|
||||
Directory imf/.
|
||||
|
||||
2.6.1/ References
|
||||
|
||||
- RFC 2822 - Internet Message Format (Not entirely implemented)
|
||||
- RFC 2076 - Common Internet Message Headers
|
||||
|
||||
Not yet implemented :
|
||||
|
||||
- RFC 2298 - An Extensible Message Format
|
||||
for Message Disposition Notifications
|
||||
|
||||
2.6.2/ Dependencies
|
||||
|
||||
- tools/
|
||||
|
||||
2.6.3/ Files descriptions
|
||||
|
||||
mailimf.[ch] -- functions to parse RFC 2822 messages.
|
||||
mailimf_types.[ch] -- definition of types and constructors for these
|
||||
types
|
||||
mailimf_types_helper.[ch] -- contains function definitions that will help
|
||||
to create data necessary to use IMF module.
|
||||
mailimf_write.[ch] -- functions that output RFC 2822 messages or
|
||||
sub-part of the messages in a (FILE *).
|
||||
|
||||
2.6.4/ Interface
|
||||
|
||||
Include for this module is mailimf.h and includes all other headers.
|
||||
|
||||
The interface of IMAP4rev1 is documented in the following files :
|
||||
|
||||
mailimf.h
|
||||
mailimf_types.h
|
||||
mailimf_types_helper.h
|
||||
mailimf_write.h
|
||||
|
||||
|
||||
2.7/ MIME - Multipurpose Internet Mail Extensions
|
||||
-------------------------------------------------
|
||||
|
||||
The MIME module provides functions to parse structure of MIME messages.
|
||||
Directory mime/.
|
||||
|
||||
2.7.1/ References
|
||||
|
||||
- RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of
|
||||
Internet Message Bodies.
|
||||
- RFC 2047 - MIME (Multipurpose Internet Mail Extensions) Part Three: Message
|
||||
Header Extensions for Non-ASCII Text.
|
||||
- RFC 2183 - Communicating Presentation Information in Internet Messages:
|
||||
The Content-Disposition Header Field
|
||||
|
||||
Not implemented :
|
||||
|
||||
- RFC 2046 - Multipurpose Internet Mail Extensions (MIME) Part Two: Media
|
||||
Types.
|
||||
|
||||
2.7.2/ Dependencies
|
||||
|
||||
- tools/
|
||||
- imf/
|
||||
|
||||
2.7.3/ Files descriptions
|
||||
|
||||
mailmime.[ch] -- functions to parse the MIME fields (RFC 2045).
|
||||
mailmime_content.[ch] -- functions to parse the MIME message. You get
|
||||
the different parts and you can decode them.
|
||||
mailmime_decode.[ch] -- functions to parse the MIME-encoded fields.
|
||||
mailmime_disposition.[ch] -- functions to parse the Content-Disposition field
|
||||
(RFC 2183)
|
||||
mailmime_types.[ch] -- definition of types and constructors for these
|
||||
types
|
||||
mailmime_types_helper.[ch] -- contains function definitions that will help
|
||||
to create data necessary to use MIME module.
|
||||
mailmime_write.[ch] -- functions that output MIME messages or
|
||||
sub-part of the messages in a (FILE *).
|
||||
|
||||
2.7.4/ Interface
|
||||
|
||||
Include for this module is mailmime.h and includes all other headers.
|
||||
|
||||
There is not yet documentation for MIME module.
|
||||
|
||||
|
||||
2.8/ SMTP - Simple Mail Transfer Protocol
|
||||
-----------------------------------------
|
||||
|
||||
Each command of the SMTP Standard (RFC 2821 and RFC 1891) is implemented
|
||||
in the SMTP module. Directory smtp/.
|
||||
|
||||
2.8.1/ References
|
||||
|
||||
- RFC 2821 - Simple Mail Transfer Protocol (Not entirely implemented)
|
||||
- RFC 1891 - SMTP Service Extension for Delivery Status Notifications
|
||||
|
||||
2.8.2/ Depencencies
|
||||
|
||||
- tools/
|
||||
|
||||
2.8.3/ Files descriptions
|
||||
|
||||
mailsmtp.[ch] -- functions that implements each SMTP command
|
||||
mailsmtp_helper.[ch] -- functions to get an easier use of SMTP module
|
||||
mailsmtp_socket.[ch] -- provides a function to connect to a
|
||||
SMTP server over TCP
|
||||
mailsmtp_ssl.[ch] -- provides a function to connect to a
|
||||
SMTP server over TLS layer
|
||||
mailsmtp_types.h -- definition of types
|
||||
|
||||
2.8.4/ Interface
|
||||
|
||||
Include for this module is mailsmtp.h and includes all other headers.
|
||||
|
||||
There is not yet documentation for MIME module.
|
||||
|
||||
|
||||
2.9/ Miscellaneous
|
||||
|
||||
2.9.1/ References
|
||||
|
||||
- RFC 2234 - Augmented BNF for Syntax Specifications: ABNF
|
||||
- RFC 2595 - Using TLS with IMAP, POP3 and ACAP
|
||||
|
||||
2.9.2/ Tools
|
||||
|
||||
tools/ directory contains some tools functions and useful data structures.
|
||||
|
||||
alloc.h -- a wrapper on malloc()
|
||||
carray.[ch] -- an array, that grows automatically when elements
|
||||
are added.
|
||||
charconv.[ch] -- character set converter. For example, it will
|
||||
translate an iso-8859-1 string to an utf-8 string.
|
||||
chash.[ch] -- a hash table which keys can be anything
|
||||
cinthash.[ch] -- a hash table which keys are integers
|
||||
(should be removed and replaced with chash)
|
||||
clist.[ch] -- a double-linked list
|
||||
connect.[ch] -- easy interface to connect a TCP server
|
||||
hmac_md5.h
|
||||
md5.[ch]
|
||||
md5global.h -- MD5 calculation
|
||||
mail.h -- some constants
|
||||
maildb_helper.[ch] -- wrappers to DB 2.x 3.x or 4.x
|
||||
maillock.[ch] -- safely lock a given file
|
||||
mailstream.[ch] -- stream interface - buffered reading and writing
|
||||
on files/socket/SSL connection
|
||||
mailstream_helper.[ch] -- useful functions for stream
|
||||
(for example: read a line)
|
||||
mailstream_low.[ch] -- driver interface for a stream
|
||||
mailstream_socket.[ch] -- stream driver for file descriptors (includes socket)
|
||||
mailstream_ssl.[ch] -- stream driver for SSL connection
|
||||
mailstream_types.h -- data structure definition
|
||||
mapping.[ch] -- map parts of files in memory (no more used)
|
||||
mmapstring.[ch] -- a string, that grows automatically when data
|
||||
are added.
|
||||
|
||||
|
||||
3/ Higher-level
|
||||
---------------
|
||||
|
||||
The higher level will allow us to query folder informations or to get
|
||||
messages information or content.
|
||||
|
||||
There is four kinds of identities :
|
||||
- storage
|
||||
- folders
|
||||
- session
|
||||
- messages
|
||||
|
||||
In the higher-level interface, you manipulate data types from IMF and
|
||||
MIME module, plus additionnal data types of higher-level.
|
||||
|
||||
|
||||
3.1/ Objects
|
||||
------------
|
||||
|
||||
3.1.1/ Storage
|
||||
|
||||
A storage (struct mail_storage) represents whether a server or
|
||||
a main path, It can be an IMAP server, the root path of a MH or a mbox file.
|
||||
|
||||
|
||||
3.1.2/ Folders
|
||||
|
||||
A folder can be created from a storage.
|
||||
Folders (struct mail_folder) are the mailboxes we can choose in the
|
||||
server or as sub-folder of the main path.
|
||||
|
||||
Folders for IMAP are the IMAP mailboxes, for MH this is one of the
|
||||
folder of the MH storage, for mbox, there is only one folder, the
|
||||
mbox file content;
|
||||
|
||||
|
||||
3.1.3/ Session
|
||||
|
||||
Storage and folders communicate with the lower-layer through the
|
||||
mail session data structure.
|
||||
|
||||
A mail session (struct mailsession) is a mail access to a server
|
||||
or a mail access in the local file system. It allow us to send commands
|
||||
to the mail access.
|
||||
|
||||
A mail storage is using a mail session to communicate.
|
||||
A folder folder also uses a mail session to get information or to send
|
||||
information. It can be the same session or not, depdending of the
|
||||
implementation.
|
||||
|
||||
|
||||
3.1.4/ Messages
|
||||
|
||||
From a session, we can get a message (struct mailmessage) to read.
|
||||
|
||||
|
||||
3.2/ Drivers
|
||||
------------
|
||||
|
||||
For a mail access, three drivers exist.
|
||||
One for storage, one for session, one for message.
|
||||
Note that the folder access rely only on session driver.
|
||||
|
||||
|
||||
3.2.1/ storage driver interface
|
||||
|
||||
mail_storage_driver is the driver structure for mail storage
|
||||
|
||||
- name is the name of the driver
|
||||
|
||||
- connect() connects the storage to the remote access or to
|
||||
the path in the local filesystem.
|
||||
|
||||
- get_folder() can have two kinds of behaviour.
|
||||
Either it creates a new session and independant from the session
|
||||
used by the storage and select the given mailbox or
|
||||
it selects the given mailbox in the current session.
|
||||
It depends on the efficiency of the mail driver.
|
||||
|
||||
- free_data() frees the data created with mail_storage constructor.
|
||||
|
||||
a constructor for each kind of access has to be implemented.
|
||||
|
||||
|
||||
3.2.2/ session driver interface
|
||||
|
||||
maildriver is the driver structure for mail sessions
|
||||
|
||||
- name is the name of the driver
|
||||
|
||||
- initialize() is the function that will initializes a data structure
|
||||
specific to the driver, it returns a value that will be stored
|
||||
in the field data of the session.
|
||||
The field data of the session is the state of the session,
|
||||
the internal data structure used by the driver.
|
||||
It is called when creating the mailsession structure with
|
||||
mailsession_new().
|
||||
|
||||
- uninitialize() frees the structure created with initialize()
|
||||
|
||||
- parameters() implements functions specific to the given mail access
|
||||
|
||||
- connect_stream() connects a stream to the session
|
||||
|
||||
- connect_path() notify a main path to the session
|
||||
|
||||
- starttls() changes the current stream to a TLS stream
|
||||
|
||||
- login() notifies the user and the password to authenticate to the
|
||||
session
|
||||
|
||||
- logout() exits the session and closes the stream
|
||||
|
||||
- noop() does no operation on the session, but it can be
|
||||
used to poll for the status of the connection.
|
||||
|
||||
- check_folder() makes a checkpoint of the session
|
||||
|
||||
- select_folder() selects a mailbox
|
||||
|
||||
- expunge_folder() deletes all messages marked \Deleted
|
||||
|
||||
- status_folder() queries the status of the folder
|
||||
(number of messages, number of recent messages, number of
|
||||
unseen messages)
|
||||
|
||||
- append_message() adds a RFC 2822 message to the current
|
||||
given mailbox
|
||||
|
||||
- get_messages_list() returns the list of message numbers
|
||||
of the current mailbox.
|
||||
|
||||
- get_envelopes_list() fills the parsed fields in the
|
||||
mailmessage structures of the mail_envelopes_list.
|
||||
|
||||
- remove_message() removes the given message from the mailbox.
|
||||
The message is permanently deleted.
|
||||
|
||||
- get_message returns a mailmessage structure that corresponds
|
||||
to the given message number.
|
||||
|
||||
|
||||
3.2.3/ message driver interface
|
||||
|
||||
mailmessage_driver is the driver structure to get information from messages.
|
||||
|
||||
- name is the name of the driver
|
||||
|
||||
- initialize() is the function that will initializes a data structure
|
||||
specific to the driver, it returns a value that will be stored
|
||||
in the field data of the mailsession.
|
||||
The field data of the session is the state of the session,
|
||||
the internal data structure used by the driver.
|
||||
It is called when initializing the mailmessage structure with
|
||||
mailmessage_init().
|
||||
|
||||
- uninitialize() frees the structure created with initialize().
|
||||
It will be called by mailmessage_free().
|
||||
|
||||
- flush() will free from memory all temporary structures of the message
|
||||
(for example, the MIME structure of the message).
|
||||
|
||||
- fetch_result_free() will free all strings resulted by fetch() or
|
||||
any fetch_xxx() functions that returns a string.
|
||||
|
||||
- fetch() returns the content of the message (headers and text).
|
||||
|
||||
- fetch_header() returns the content of the headers.
|
||||
|
||||
- fetch_body() returns the message text (message content without headers)
|
||||
|
||||
- fetch_size() returns the size of the message content.
|
||||
|
||||
- get_bodystructure() returns the MIME structure of the message.
|
||||
|
||||
- fetch_section() returns the content of a given MIME part
|
||||
|
||||
- fetch_section_header() returns the header of the message
|
||||
contained by the given MIME part.
|
||||
|
||||
- fetch_section_mime() returns the MIME headers of the
|
||||
given MIME part.
|
||||
|
||||
- fetch_section_body() returns the text (if this is a message, this is the
|
||||
message content without headers) of the given MIME part.
|
||||
|
||||
- fetch_envelope() returns a mailimf_fields structure, with a list of
|
||||
fields chosen by the driver.
|
||||
|
||||
- get_flags() returns a the flags related to the message.
|
||||
When you want to get flags of a message, you have to make sure to
|
||||
call get_flags() at least once before using directly message->flags.
|
||||
|
||||
|
||||
3.3/ Higher level interface
|
||||
---------------------------
|
||||
|
||||
3.3.1/ Files descriptions
|
||||
|
||||
generic_cache.[ch] -- functions that implements cache and
|
||||
flags storing mechanism
|
||||
imapdriver.[ch] -- IMAP driver for session
|
||||
imapdriver_cached.[ch] -- IMAP driver for session, using cache,
|
||||
IMAP already has flags.
|
||||
imapdriver_cached_message.[ch] -- IMAP driver for message, using cache
|
||||
IMAP already has flags.
|
||||
imapdriver_message.[ch] -- IMAP driver for message
|
||||
imapdriver_types.[ch] -- tools function for IMAP driver (types
|
||||
conversion from IMAP module).
|
||||
imapstorage.[ch] -- IMAP driver for storage
|
||||
imfcache.[ch] -- implements cache for parsed fields
|
||||
libetpan.h -- includes all necessary header files to
|
||||
use libEtPan!
|
||||
maildriver.[ch] -- wrappers to calls to the session driver
|
||||
maildriver_tools.[ch] -- default implementation for drivers,
|
||||
when the driver does not parse the
|
||||
messages.
|
||||
maildriver_types.[ch] -- data types declaration and constructors
|
||||
maildriver_types_helper.[ch] -- easy data creation
|
||||
mailmessage.[ch] -- wrappers to calls to the message driver
|
||||
mailstorage.[ch] -- storage creation, calls to the storage
|
||||
driver and implementation of folders.
|
||||
mailstorage_tools.[ch] -- tools for storage (connection)
|
||||
mailthread.[ch] -- threading: collection of the mails
|
||||
into a treee
|
||||
mboxdriver.[ch] -- mbox driver for session
|
||||
mboxdriver_cached.[ch] -- mbox driver for session, using flags
|
||||
and cache
|
||||
mboxdriver_cached_message.[ch] -- mbox driver for message, using flags
|
||||
and cache
|
||||
mboxdriver_message.[ch] -- mbox driver for message
|
||||
mboxdriver_tools.[ch] -- mbox driver common functions
|
||||
mboxstorage.[ch] -- mbox driver for storage
|
||||
mhdriver.[ch] -- MH driver for session
|
||||
mhdriver_cached.[ch] -- MH driver for session, using flags
|
||||
and cache
|
||||
mhdriver_cached_message.[ch] -- MH driver for message, using flags
|
||||
and cache.
|
||||
mhdriver_message.[ch] -- MH driver for message
|
||||
mhdriver_tools.[ch] -- MH driver common functions
|
||||
mhstorage.[ch] -- MH driver for storage
|
||||
nntpdriver.[ch] -- NNTP driver for session
|
||||
nntpdriver_cached.[ch] -- NNTP driver for session, using flags
|
||||
and cache
|
||||
nntpdriver_cached_message.[ch] -- NNTP driver for message, using flags
|
||||
and cache
|
||||
nntpdriver_message.[ch] -- NNTP driver for message
|
||||
nntpdriver_tools.[ch] -- NNTP driver common functions
|
||||
nntpstorage.[ch] -- NNTP driver for storage
|
||||
pop3driver.[ch] -- POP3 driver for session
|
||||
pop3driver_cached.[ch] -- POP3 driver for session, using flags
|
||||
and cache
|
||||
pop3driver_cached_message.[ch] -- POP3 driver for message, using flags
|
||||
and cache
|
||||
pop3driver_message.[ch] -- POP3 driver for message
|
||||
pop3driver_tools.[ch] -- POP3 driver common functions
|
||||
pop3storage.[ch] -- POP3 driver for storage
|
||||
|
||||
|
||||
3.3.2/ Interfaces
|
||||
|
||||
Include for this module is libetpan.h and includes all other headers.
|
||||
|
||||
|
||||
The interface of higher layer is documented in the following files :
|
||||
|
||||
maildriver.h
|
||||
maildriver_types.h
|
||||
maildriver_types_helper.h
|
||||
mailmessage.h
|
||||
mailstorage.h
|
||||
mailstorage_types.[h]
|
||||
mailthread.h
|
||||
|
||||
|
||||
4/ Architecture
|
||||
---------------
|
||||
|
||||
(see layer.fig)
|
||||
|
||||
|
||||
5/ Example of use
|
||||
-----------------
|
||||
|
||||
You can find some example in tests/
|
||||
|
||||
|
||||
6/ Constraints
|
||||
--------------
|
||||
|
||||
- libEtPan! must run on a system where mmap() is available.
|
||||
|
||||
- for mbox particularly, libEtPan! make assumption on the fact that a
|
||||
file can be entirely mapped into memory. But if you don't read
|
||||
mailboxes of 1 Go, it should be fine.
|
||||
|
||||
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# DSL = /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl
|
||||
DSL = /usr/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl
|
||||
JADE = jade
|
||||
HTML_RENDER = lynx -force_html -nolist -dump
|
||||
|
||||
SOURCES = API README
|
||||
|
||||
all:
|
||||
@for i in $(SOURCES); do \
|
||||
echo $$i - building html; \
|
||||
$(JADE) -t sgml -V nochunks -d $(DSL) $$i.sgml > $$i.html; \
|
||||
\
|
||||
echo $$i - building txt; \
|
||||
$(HTML_RENDER) $$i.html > $$i.txt; \
|
||||
\
|
||||
echo $$i - building multipage HTML; \
|
||||
mkdir -p $$i; \
|
||||
cd $$i; \
|
||||
$(JADE) -t sgml -d $(DSL) ../$$i.sgml; \
|
||||
cd ..; \
|
||||
done
|
|
@ -1,780 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>libEtPan!</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD
|
||||
><BODY
|
||||
CLASS="BOOK"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="BOOK"
|
||||
><A
|
||||
NAME="LIBETPAN-README"
|
||||
></A
|
||||
><DIV
|
||||
CLASS="TITLEPAGE"
|
||||
><H1
|
||||
CLASS="TITLE"
|
||||
><A
|
||||
NAME="AEN2"
|
||||
>libEtPan!</A
|
||||
></H1
|
||||
><H3
|
||||
CLASS="AUTHOR"
|
||||
><A
|
||||
NAME="AEN6"
|
||||
></A
|
||||
>Viet Hoa DINH</H3
|
||||
><P
|
||||
CLASS="COPYRIGHT"
|
||||
>Copyright © 2003 DINH Viet Hoa</P
|
||||
><HR></DIV
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
>1. <A
|
||||
HREF="#INTRODUCTION"
|
||||
>Introduction</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="#DESCRIPTION"
|
||||
>Description</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#AUTHOR"
|
||||
>Author</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="#MAIN-AUTH"
|
||||
>Main author</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#CONTRIB"
|
||||
>Contributors</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
>2. <A
|
||||
HREF="#INSTALLATION"
|
||||
>Installation</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="#DEPENDENCIES"
|
||||
>Dependencies</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="#DEPEND-USERS"
|
||||
>Dependencies for users</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#DEPEND-DEVELOPERS"
|
||||
>Dependencies for developers</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
><A
|
||||
HREF="#PACKAGES"
|
||||
>Existing packages</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="#PACKAGE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#PACKAGE-DEBIAN"
|
||||
>Debian</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#PACKAGE-MANDRAKE"
|
||||
>Mandrake Linux</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
><A
|
||||
HREF="#COMPILATION"
|
||||
>Compilation</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="#COMPILE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#COMPILE-MACOSX"
|
||||
>Mac OS X</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#LINUX"
|
||||
>Linux</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#CONFIGURE"
|
||||
>configure</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="#INSTALL"
|
||||
>Compile and install</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
>3. <A
|
||||
HREF="#USE"
|
||||
>Use of libEtPan!</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="#HOTMAIL"
|
||||
>How to open an Hotmail mailbox</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
></DL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><HR><H1
|
||||
><A
|
||||
NAME="INTRODUCTION"
|
||||
></A
|
||||
>Chapter 1. Introduction</H1
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H2
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="DESCRIPTION"
|
||||
>Description</A
|
||||
></H2
|
||||
><P
|
||||
> The purpose of this mail library is to provide a portable,
|
||||
efficient middleware for different kinds of mail access
|
||||
(IMAPrev4, POP3, NNTP, mbox, MH, Maildir).
|
||||
</P
|
||||
><P
|
||||
> You have two kinds of mailbox access, either using low-level
|
||||
functions with a different interface for each kind of access
|
||||
or using higher-level functions, using a driver to wrap the
|
||||
higher-level API. The API will be the same for each kind of
|
||||
mail access using the higher-level API.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><HR><H2
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AUTHOR"
|
||||
>Author</A
|
||||
></H2
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAIN-AUTH"
|
||||
>Main author</A
|
||||
></H3
|
||||
><P
|
||||
> DINH Viet Hoa <CODE
|
||||
CLASS="EMAIL"
|
||||
><<A
|
||||
HREF="mailto:hoa@users.sourceforge.net"
|
||||
>hoa@users.sourceforge.net</A
|
||||
>></CODE
|
||||
>
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CONTRIB"
|
||||
>Contributors</A
|
||||
></H3
|
||||
><P
|
||||
> <P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> Wim Delvaux
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Melvin Hadasht
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> David Woodhouse
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Juergen Graf
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Zsolt VARGA
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Gael Roualland
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Toni Willberg
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Rajko Albrecht
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Nikita V. Youshchenko
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Frederic Devernay
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Michael Leupold
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Colin Leroy
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
>
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><HR><H1
|
||||
><A
|
||||
NAME="INSTALLATION"
|
||||
></A
|
||||
>Chapter 2. Installation</H1
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H2
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="DEPENDENCIES"
|
||||
>Dependencies</A
|
||||
></H2
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="DEPEND-USERS"
|
||||
>Dependencies for users</A
|
||||
></H3
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.openssl.org"
|
||||
TARGET="_top"
|
||||
>OpenSSL</A
|
||||
>
|
||||
(optional but recommended)
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.sleepycat.com"
|
||||
TARGET="_top"
|
||||
>Berkeley
|
||||
DB</A
|
||||
> (optional but recommended)
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> POSIX Thread (required)
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="DEPEND-DEVELOPERS"
|
||||
>Dependencies for developers</A
|
||||
></H3
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.gnu.org/software/autoconf"
|
||||
TARGET="_top"
|
||||
> autoconf
|
||||
</A
|
||||
>
|
||||
2.13
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.gnu.org/software/automake"
|
||||
TARGET="_top"
|
||||
> automake
|
||||
</A
|
||||
>
|
||||
1.4
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.gnu.org/software/libtool/libtool.html"
|
||||
TARGET="_top"
|
||||
> libtool
|
||||
</A
|
||||
>
|
||||
1.4.3
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> jade and some SGML tools will be required
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><HR><H2
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="PACKAGES"
|
||||
>Existing packages</A
|
||||
></H2
|
||||
><P
|
||||
> Before you try to compile it, you have to know that packages
|
||||
exist for some systems.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="PACKAGE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></H3
|
||||
><P
|
||||
> you can find it in ports/mail/libetpan.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="PACKAGE-DEBIAN"
|
||||
>Debian</A
|
||||
></H3
|
||||
><P
|
||||
> This is in the package collection.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="PACKAGE-MANDRAKE"
|
||||
>Mandrake Linux</A
|
||||
></H3
|
||||
><P
|
||||
> This is in the package collection.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><HR><H2
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="COMPILATION"
|
||||
>Compilation</A
|
||||
></H2
|
||||
><P
|
||||
> Generic installation instructions are in the
|
||||
<TT
|
||||
CLASS="FILENAME"
|
||||
>INSTALL</TT
|
||||
> file
|
||||
You can pass the following extra options to configure :
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="COMPILE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></H3
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> make sure libiconv is installed from the ports collection (see
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>pkg_info</B
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> issue configure with the following parameter:
|
||||
<PRE
|
||||
CLASS="SCREEN"
|
||||
><SAMP
|
||||
CLASS="PROMPT"
|
||||
>$</SAMP
|
||||
> <KBD
|
||||
CLASS="USERINPUT"
|
||||
>./configure --with-libiconv-prefix=/usr/local</KBD
|
||||
>
|
||||
</PRE
|
||||
>
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="COMPILE-MACOSX"
|
||||
>Mac OS X</A
|
||||
></H3
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> in tests/option-parser.c, change the inclusion
|
||||
of <TT
|
||||
CLASS="FILENAME"
|
||||
>getopt.h</TT
|
||||
> to
|
||||
<TT
|
||||
CLASS="FILENAME"
|
||||
>gnugetopt/getopt.h</TT
|
||||
>
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> in <TT
|
||||
CLASS="FILENAME"
|
||||
>tests/Makefile</TT
|
||||
>, add
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>-I/sw/include</B
|
||||
> for the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>CFLAGS</B
|
||||
> and
|
||||
-L/sw/lib -lgnugetopt for the LDFLAGS.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="LINUX"
|
||||
>Linux</A
|
||||
></H3
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><DIV
|
||||
CLASS="WARNING"
|
||||
><P
|
||||
></P
|
||||
><TABLE
|
||||
CLASS="WARNING"
|
||||
BORDER="1"
|
||||
WIDTH="90%"
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="CENTER"
|
||||
><B
|
||||
>Warning</B
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="LEFT"
|
||||
><P
|
||||
> Since libEtPan! is making high usage of
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mmap()</B
|
||||
> even for
|
||||
writing, when your mailboxes are on
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NFS</B
|
||||
> filesystem with
|
||||
a Linux server, it is advised to use option
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>no_subtree_check</B
|
||||
> in
|
||||
<TT
|
||||
CLASS="FILENAME"
|
||||
>/etc/exports</TT
|
||||
>.
|
||||
This should avoid corruption of data.
|
||||
</P
|
||||
><P
|
||||
> The problem exist in Linux 2.4.22 and earlier versions.
|
||||
</P
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> On RedHat systems, you have to configure using the
|
||||
following command line :
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>./configure --with-openssl=/usr/kerberos</B
|
||||
>
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> On Debian systems, if the <B
|
||||
CLASS="COMMAND"
|
||||
>./autogen</B
|
||||
>
|
||||
script fails on missing <B
|
||||
CLASS="COMMAND"
|
||||
>AM_ICONV</B
|
||||
>, you
|
||||
have to install <B
|
||||
CLASS="COMMAND"
|
||||
>gettext</B
|
||||
> package.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CONFIGURE"
|
||||
>configure</A
|
||||
></H3
|
||||
><P
|
||||
> You can use the following options :
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>--enable-debug</B
|
||||
> Compiles with
|
||||
debugging turned on
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>--enable-optim</B
|
||||
> Turns on some
|
||||
optimizations flags for gcc
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>--without-openssl</B
|
||||
> Disables OpenSSL (do
|
||||
not look for it)
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><HR><H3
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="INSTALL"
|
||||
>Compile and install</A
|
||||
></H3
|
||||
><P
|
||||
> Download the package and do the following :
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>$ tar xzvf libetpan-XX.XX.tar.gz # to decompress the package
|
||||
|
||||
$ cd libetpan-XX.XX
|
||||
|
||||
$ ./configure --help # to get options of configure
|
||||
|
||||
$ ./configure # you can specify your own options
|
||||
|
||||
$ make # to compile the package
|
||||
|
||||
$ su
|
||||
|
||||
# make install
|
||||
|
||||
# logout
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><HR><H1
|
||||
><A
|
||||
NAME="USE"
|
||||
></A
|
||||
>Chapter 3. Use of libEtPan!</H1
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H2
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="HOTMAIL"
|
||||
>How to open an Hotmail mailbox</A
|
||||
></H2
|
||||
><P
|
||||
> If you wish to access hotmail using libEtPan!, you can, by
|
||||
using <A
|
||||
HREF="http://hotwayd.sf.net"
|
||||
TARGET="_top"
|
||||
>hotwayd</A
|
||||
>.
|
||||
Then, create a POP3 storage with the given parameters :
|
||||
command as clear text for connection type
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>CONNECTION_TYPE_COMMAND</B
|
||||
>),
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>"/usr/bin/hotwayd"</B
|
||||
>
|
||||
as command, plain text authentication
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>ePOP3_AUTH_TYPE_PLAIN</B
|
||||
>),
|
||||
full hotmail address as login
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>foobar@hotmail.com</B
|
||||
> or
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>foobar@hotmail.com/mailbox_name</B
|
||||
> if you want
|
||||
to access a specific mailbox) and give your password.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,388 +0,0 @@
|
|||
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN">
|
||||
|
||||
<book id="libetpan-readme">
|
||||
<bookinfo>
|
||||
<date>2003-12-03</date>
|
||||
<title>libEtPan!</title>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Viet Hoa</firstname>
|
||||
<surname>DINH</surname>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<copyright>
|
||||
<year>2003</year>
|
||||
<holder>DINH Viet Hoa</holder>
|
||||
</copyright>
|
||||
</bookinfo>
|
||||
<toc></toc>
|
||||
|
||||
<chapter id="introduction">
|
||||
<title>Introduction</title>
|
||||
|
||||
<!-- description -->
|
||||
<sect1 id="description">
|
||||
<title>Description</title>
|
||||
<para>
|
||||
The purpose of this mail library is to provide a portable,
|
||||
efficient middleware for different kinds of mail access
|
||||
(IMAPrev4, POP3, NNTP, mbox, MH, Maildir).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You have two kinds of mailbox access, either using low-level
|
||||
functions with a different interface for each kind of access
|
||||
or using higher-level functions, using a driver to wrap the
|
||||
higher-level API. The API will be the same for each kind of
|
||||
mail access using the higher-level API.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- authors -->
|
||||
<sect1 id="author">
|
||||
<title>Author</title>
|
||||
<sect2 id="main-auth">
|
||||
<title>Main author</title>
|
||||
<para>
|
||||
DINH Viet Hoa <email>hoa@users.sourceforge.net</email>
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="contrib">
|
||||
<title>Contributors</title>
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Wim Delvaux <!-- wim.delvaux.adaptiveplanet.com -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Melvin Hadasht <!-- melvin.hadasht@free.fr -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
David Woodhouse <!-- dwmw2@infradead.org -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Juergen Graf <!-- libetpan@codeguy.org -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Zsolt VARGA <!-- redax@redax.hu -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Gael Roualland <!-- gael.roualland@dial.oleane.com -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Toni Willberg <!-- toniw@iki.fi -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Rajko Albrecht <!-- ral@alwins-world.de -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Nikita V. Youshchenko <!-- yoush@cs.msu.su -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Frederic Devernay <!-- Frederic.Devernay@inrialpes.fr -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Michael Leupold <!-- leupold@leunet.de -->
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Colin Leroy <!-- colin@colino.net -->
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<!-- installation -->
|
||||
<chapter id="installation">
|
||||
<title>Installation</title>
|
||||
|
||||
<sect1 id="dependencies">
|
||||
<title>Dependencies</title>
|
||||
|
||||
<!-- dependencies for users -->
|
||||
<sect2 id="depend-users">
|
||||
<title>Dependencies for users</title>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="http://www.openssl.org">OpenSSL</ulink>
|
||||
(optional but recommended)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="http://www.sleepycat.com">Berkeley
|
||||
DB</ulink> (optional but recommended)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
POSIX Thread (required)
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
<!-- dependencies for developers -->
|
||||
<sect2 id="depend-developers">
|
||||
<title>Dependencies for developers</title>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="http://www.gnu.org/software/autoconf">
|
||||
autoconf
|
||||
</ulink>
|
||||
2.13
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink url="http://www.gnu.org/software/automake">
|
||||
automake
|
||||
</ulink>
|
||||
1.4
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink
|
||||
url="http://www.gnu.org/software/libtool/libtool.html">
|
||||
libtool
|
||||
</ulink>
|
||||
1.4.3
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
jade and some SGML tools will be required
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<!-- packages -->
|
||||
<sect1 id="packages">
|
||||
<title>Existing packages</title>
|
||||
|
||||
<para>
|
||||
Before you try to compile it, you have to know that packages
|
||||
exist for some systems.
|
||||
</para>
|
||||
|
||||
<!-- FreeBSD -->
|
||||
<sect2 id="package-freebsd">
|
||||
<title>FreeBSD</title>
|
||||
<para>
|
||||
you can find it in ports/mail/libetpan.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<!-- Debian -->
|
||||
<sect2 id="package-debian">
|
||||
<title>Debian</title>
|
||||
<para>
|
||||
This is in the package collection.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<!-- Mandrake -->
|
||||
<sect2 id="package-mandrake">
|
||||
<title>Mandrake Linux</title>
|
||||
<para>
|
||||
This is in the package collection.
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<!-- compilation -->
|
||||
<sect1 id="compilation">
|
||||
<title>Compilation</title>
|
||||
|
||||
<para>
|
||||
Generic installation instructions are in the
|
||||
<filename>INSTALL</filename> file
|
||||
You can pass the following extra options to configure :
|
||||
</para>
|
||||
|
||||
<!-- FreeBSD -->
|
||||
<sect2 id="compile-freebsd">
|
||||
<title>FreeBSD</title>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
make sure libiconv is installed from the ports collection (see
|
||||
<command>pkg_info</command>).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
issue configure with the following parameter:
|
||||
<screen>
|
||||
<prompt>$</prompt> <userinput>./configure --with-libiconv-prefix=/usr/local</userinput>
|
||||
</screen>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
|
||||
<!-- MacOS X -->
|
||||
<sect2 id="compile-macosx">
|
||||
<title>Mac OS X</title>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
in tests/option-parser.c, change the inclusion
|
||||
of <filename>getopt.h</filename> to
|
||||
<filename>gnugetopt/getopt.h</filename>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
in <filename>tests/Makefile</filename>, add
|
||||
<command>-I/sw/include</command> for the
|
||||
<command>CFLAGS</command> and
|
||||
-L/sw/lib -lgnugetopt for the LDFLAGS.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
|
||||
<!-- Linux -->
|
||||
<sect2 id="linux">
|
||||
<title>Linux</title>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<warning>
|
||||
<para>
|
||||
Since libEtPan! is making high usage of
|
||||
<command>mmap()</command> even for
|
||||
writing, when your mailboxes are on
|
||||
<command>NFS</command> filesystem with
|
||||
a Linux server, it is advised to use option
|
||||
<command>no_subtree_check</command> in
|
||||
<filename>/etc/exports</filename>.
|
||||
This should avoid corruption of data.
|
||||
</para>
|
||||
<para>
|
||||
The problem exist in Linux 2.4.22 and earlier versions.
|
||||
</para>
|
||||
</warning>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
On RedHat systems, you have to configure using the
|
||||
following command line :
|
||||
<command>./configure --with-openssl=/usr/kerberos</command>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
On Debian systems, if the <command>./autogen</command>
|
||||
script fails on missing <command>AM_ICONV</command>, you
|
||||
have to install <command>gettext</command> package.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
|
||||
<!-- configure -->
|
||||
<sect2 id="configure">
|
||||
<title>configure</title>
|
||||
<para>
|
||||
You can use the following options :
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<command>--enable-debug</command> Compiles with
|
||||
debugging turned on
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<command>--enable-optim</command> Turns on some
|
||||
optimizations flags for gcc
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<command>--without-openssl</command> Disables OpenSSL (do
|
||||
not look for it)
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</sect2>
|
||||
<sect2 id="install">
|
||||
<title>Compile and install</title>
|
||||
<para>
|
||||
Download the package and do the following :
|
||||
</para>
|
||||
<programlisting>
|
||||
$ tar xzvf libetpan-XX.XX.tar.gz # to decompress the package
|
||||
|
||||
$ cd libetpan-XX.XX
|
||||
|
||||
$ ./configure --help # to get options of configure
|
||||
|
||||
$ ./configure # you can specify your own options
|
||||
|
||||
$ make # to compile the package
|
||||
|
||||
$ su
|
||||
|
||||
# make install
|
||||
|
||||
# logout
|
||||
</programlisting>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<chapter id="use">
|
||||
<title>Use of libEtPan!</title>
|
||||
|
||||
<sect1 id="hotmail">
|
||||
<title>How to open an Hotmail mailbox</title>
|
||||
<para>
|
||||
If you wish to access hotmail using libEtPan!, you can, by
|
||||
using <ulink url="http://hotwayd.sf.net">hotwayd</ulink>.
|
||||
Then, create a POP3 storage with the given parameters :
|
||||
command as clear text for connection type
|
||||
(<command>CONNECTION_TYPE_COMMAND</command>),
|
||||
<command>"/usr/bin/hotwayd"</command>
|
||||
as command, plain text authentication
|
||||
(<command>ePOP3_AUTH_TYPE_PLAIN</command>),
|
||||
full hotmail address as login
|
||||
(<command>foobar@hotmail.com</command> or
|
||||
<command>foobar@hotmail.com/mailbox_name</command> if you want
|
||||
to access a specific mailbox) and give your password.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
</book>
|
|
@ -1,200 +0,0 @@
|
|||
|
||||
libEtPan!
|
||||
|
||||
Viet Hoa DINH
|
||||
|
||||
Copyright © 2003 DINH Viet Hoa
|
||||
_________________________________________________________________
|
||||
|
||||
Table of Contents
|
||||
1. Introduction
|
||||
|
||||
Description
|
||||
Author
|
||||
|
||||
Main author
|
||||
Contributors
|
||||
|
||||
2. Installation
|
||||
|
||||
Dependencies
|
||||
|
||||
Dependencies for users
|
||||
Dependencies for developers
|
||||
|
||||
Existing packages
|
||||
|
||||
FreeBSD
|
||||
Debian
|
||||
Mandrake Linux
|
||||
|
||||
Compilation
|
||||
|
||||
FreeBSD
|
||||
Mac OS X
|
||||
Linux
|
||||
configure
|
||||
Compile and install
|
||||
|
||||
3. Use of libEtPan!
|
||||
|
||||
How to open an Hotmail mailbox
|
||||
_________________________________________________________________
|
||||
|
||||
Chapter 1. Introduction
|
||||
|
||||
Description
|
||||
|
||||
The purpose of this mail library is to provide a portable, efficient
|
||||
middleware for different kinds of mail access (IMAPrev4, POP3, NNTP,
|
||||
mbox, MH, Maildir).
|
||||
|
||||
You have two kinds of mailbox access, either using low-level functions
|
||||
with a different interface for each kind of access or using
|
||||
higher-level functions, using a driver to wrap the higher-level API.
|
||||
The API will be the same for each kind of mail access using the
|
||||
higher-level API.
|
||||
_________________________________________________________________
|
||||
|
||||
Author
|
||||
|
||||
Main author
|
||||
|
||||
DINH Viet Hoa <hoa@users.sourceforge.net>
|
||||
_________________________________________________________________
|
||||
|
||||
Contributors
|
||||
|
||||
* Wim Delvaux
|
||||
* Melvin Hadasht
|
||||
* David Woodhouse
|
||||
* Juergen Graf
|
||||
* Zsolt VARGA
|
||||
* Gael Roualland
|
||||
* Toni Willberg
|
||||
* Rajko Albrecht
|
||||
* Nikita V. Youshchenko
|
||||
* Frederic Devernay
|
||||
* Michael Leupold
|
||||
* Colin Leroy
|
||||
_________________________________________________________________
|
||||
|
||||
Chapter 2. Installation
|
||||
|
||||
Dependencies
|
||||
|
||||
Dependencies for users
|
||||
|
||||
* OpenSSL (optional but recommended)
|
||||
* Berkeley DB (optional but recommended)
|
||||
* POSIX Thread (required)
|
||||
_________________________________________________________________
|
||||
|
||||
Dependencies for developers
|
||||
|
||||
* autoconf 2.13
|
||||
* automake 1.4
|
||||
* libtool 1.4.3
|
||||
* jade and some SGML tools will be required
|
||||
_________________________________________________________________
|
||||
|
||||
Existing packages
|
||||
|
||||
Before you try to compile it, you have to know that packages exist for
|
||||
some systems.
|
||||
_________________________________________________________________
|
||||
|
||||
FreeBSD
|
||||
|
||||
you can find it in ports/mail/libetpan.
|
||||
_________________________________________________________________
|
||||
|
||||
Debian
|
||||
|
||||
This is in the package collection.
|
||||
_________________________________________________________________
|
||||
|
||||
Mandrake Linux
|
||||
|
||||
This is in the package collection.
|
||||
_________________________________________________________________
|
||||
|
||||
Compilation
|
||||
|
||||
Generic installation instructions are in the INSTALL file You can pass
|
||||
the following extra options to configure :
|
||||
_________________________________________________________________
|
||||
|
||||
FreeBSD
|
||||
|
||||
* make sure libiconv is installed from the ports collection (see
|
||||
pkg_info).
|
||||
* issue configure with the following parameter:
|
||||
$ ./configure --with-libiconv-prefix=/usr/local
|
||||
_________________________________________________________________
|
||||
|
||||
Mac OS X
|
||||
|
||||
* in tests/option-parser.c, change the inclusion of getopt.h to
|
||||
gnugetopt/getopt.h
|
||||
* in tests/Makefile, add -I/sw/include for the CFLAGS and -L/sw/lib
|
||||
-lgnugetopt for the LDFLAGS.
|
||||
_________________________________________________________________
|
||||
|
||||
Linux
|
||||
|
||||
*
|
||||
|
||||
Warning
|
||||
Since libEtPan! is making high usage of mmap() even for writing, when
|
||||
your mailboxes are on NFS filesystem with a Linux server, it is
|
||||
advised to use option no_subtree_check in /etc/exports. This should
|
||||
avoid corruption of data.
|
||||
The problem exist in Linux 2.4.22 and earlier versions.
|
||||
* On RedHat systems, you have to configure using the following
|
||||
command line : ./configure --with-openssl=/usr/kerberos
|
||||
* On Debian systems, if the ./autogen script fails on missing
|
||||
AM_ICONV, you have to install gettext package.
|
||||
_________________________________________________________________
|
||||
|
||||
configure
|
||||
|
||||
You can use the following options :
|
||||
|
||||
* --enable-debug Compiles with debugging turned on
|
||||
* --enable-optim Turns on some optimizations flags for gcc
|
||||
* --without-openssl Disables OpenSSL (do not look for it)
|
||||
_________________________________________________________________
|
||||
|
||||
Compile and install
|
||||
|
||||
Download the package and do the following :
|
||||
$ tar xzvf libetpan-XX.XX.tar.gz # to decompress the package
|
||||
|
||||
$ cd libetpan-XX.XX
|
||||
|
||||
$ ./configure --help # to get options of configure
|
||||
|
||||
$ ./configure # you can specify your own options
|
||||
|
||||
$ make # to compile the package
|
||||
|
||||
$ su
|
||||
|
||||
# make install
|
||||
|
||||
# logout
|
||||
|
||||
_________________________________________________________________
|
||||
|
||||
Chapter 3. Use of libEtPan!
|
||||
|
||||
How to open an Hotmail mailbox
|
||||
|
||||
If you wish to access hotmail using libEtPan!, you can, by using
|
||||
hotwayd. Then, create a POP3 storage with the given parameters :
|
||||
command as clear text for connection type (CONNECTION_TYPE_COMMAND),
|
||||
"/usr/bin/hotwayd" as command, plain text authentication
|
||||
(ePOP3_AUTH_TYPE_PLAIN), full hotmail address as login
|
||||
(foobar@hotmail.com or foobar@hotmail.com/mailbox_name if you want to
|
||||
access a specific mailbox) and give your password.
|
|
@ -1,237 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>libEtPan!</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Introduction"
|
||||
HREF="c13.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="BOOK"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="BOOK"
|
||||
><A
|
||||
NAME="LIBETPAN-README"
|
||||
></A
|
||||
><DIV
|
||||
CLASS="TITLEPAGE"
|
||||
><H1
|
||||
CLASS="TITLE"
|
||||
><A
|
||||
NAME="AEN2"
|
||||
>libEtPan!</A
|
||||
></H1
|
||||
><H3
|
||||
CLASS="AUTHOR"
|
||||
><A
|
||||
NAME="AEN6"
|
||||
></A
|
||||
>Viet Hoa DINH</H3
|
||||
><P
|
||||
CLASS="COPYRIGHT"
|
||||
>Copyright © 2003 DINH Viet Hoa</P
|
||||
><HR></DIV
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
>1. <A
|
||||
HREF="c13.htm"
|
||||
>Introduction</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="c13.htm#DESCRIPTION"
|
||||
>Description</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x19.htm"
|
||||
>Author</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="x19.htm#MAIN-AUTH"
|
||||
>Main author</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x19.htm#CONTRIB"
|
||||
>Contributors</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
>2. <A
|
||||
HREF="c53.htm"
|
||||
>Installation</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="c53.htm#DEPENDENCIES"
|
||||
>Dependencies</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="c53.htm#DEPEND-USERS"
|
||||
>Dependencies for users</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="c53.htm#DEPEND-DEVELOPERS"
|
||||
>Dependencies for developers</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
><A
|
||||
HREF="x82.htm"
|
||||
>Existing packages</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="x82.htm#PACKAGE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x82.htm#PACKAGE-DEBIAN"
|
||||
>Debian</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x82.htm#PACKAGE-MANDRAKE"
|
||||
>Mandrake Linux</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
><A
|
||||
HREF="x94.htm"
|
||||
>Compilation</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="x94.htm#COMPILE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x94.htm#COMPILE-MACOSX"
|
||||
>Mac OS X</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x94.htm#LINUX"
|
||||
>Linux</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x94.htm#CONFIGURE"
|
||||
>configure</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x94.htm#INSTALL"
|
||||
>Compile and install</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
></DL
|
||||
></DD
|
||||
><DT
|
||||
>3. <A
|
||||
HREF="c157.htm"
|
||||
>Use of libEtPan!</A
|
||||
></DT
|
||||
><DD
|
||||
><DL
|
||||
><DT
|
||||
><A
|
||||
HREF="c157.htm#HOTMAIL"
|
||||
>How to open an Hotmail mailbox</A
|
||||
></DT
|
||||
></DL
|
||||
></DD
|
||||
></DL
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c13.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Introduction</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,176 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Introduction</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan!"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="libEtPan!"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Author"
|
||||
HREF="x19.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan!</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x19.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="INTRODUCTION"
|
||||
></A
|
||||
>Chapter 1. Introduction</H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="c13.htm#DESCRIPTION"
|
||||
>Description</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x19.htm"
|
||||
>Author</A
|
||||
></DT
|
||||
></DL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="DESCRIPTION"
|
||||
>Description</A
|
||||
></H1
|
||||
><P
|
||||
> The purpose of this mail library is to provide a portable,
|
||||
efficient middleware for different kinds of mail access
|
||||
(IMAPrev4, POP3, NNTP, mbox, MH, Maildir).
|
||||
</P
|
||||
><P
|
||||
> You have two kinds of mailbox access, either using low-level
|
||||
functions with a different interface for each kind of access
|
||||
or using higher-level functions, using a driver to wrap the
|
||||
higher-level API. The API will be the same for each kind of
|
||||
mail access using the higher-level API.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x19.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>libEtPan!</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Author</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,167 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Use of libEtPan!</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan!"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Compilation"
|
||||
HREF="x94.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan!</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x94.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
> </TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="USE"
|
||||
></A
|
||||
>Chapter 3. Use of libEtPan!</H1
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="HOTMAIL"
|
||||
>How to open an Hotmail mailbox</A
|
||||
></H1
|
||||
><P
|
||||
> If you wish to access hotmail using libEtPan!, you can, by
|
||||
using <A
|
||||
HREF="http://hotwayd.sf.net"
|
||||
TARGET="_top"
|
||||
>hotwayd</A
|
||||
>.
|
||||
Then, create a POP3 storage with the given parameters :
|
||||
command as clear text for connection type
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>CONNECTION_TYPE_COMMAND</B
|
||||
>),
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>"/usr/bin/hotwayd"</B
|
||||
>
|
||||
as command, plain text authentication
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>ePOP3_AUTH_TYPE_PLAIN</B
|
||||
>),
|
||||
full hotmail address as login
|
||||
(<B
|
||||
CLASS="COMMAND"
|
||||
>foobar@hotmail.com</B
|
||||
> or
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>foobar@hotmail.com/mailbox_name</B
|
||||
> if you want
|
||||
to access a specific mailbox) and give your password.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x94.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Compilation</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,258 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Installation</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan!"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Author"
|
||||
HREF="x19.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Existing packages"
|
||||
HREF="x82.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="CHAPTER"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan!</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x19.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x82.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="CHAPTER"
|
||||
><H1
|
||||
><A
|
||||
NAME="INSTALLATION"
|
||||
></A
|
||||
>Chapter 2. Installation</H1
|
||||
><DIV
|
||||
CLASS="TOC"
|
||||
><DL
|
||||
><DT
|
||||
><B
|
||||
>Table of Contents</B
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="c53.htm#DEPENDENCIES"
|
||||
>Dependencies</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x82.htm"
|
||||
>Existing packages</A
|
||||
></DT
|
||||
><DT
|
||||
><A
|
||||
HREF="x94.htm"
|
||||
>Compilation</A
|
||||
></DT
|
||||
></DL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="DEPENDENCIES"
|
||||
>Dependencies</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="DEPEND-USERS"
|
||||
>Dependencies for users</A
|
||||
></H2
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.openssl.org"
|
||||
TARGET="_top"
|
||||
>OpenSSL</A
|
||||
>
|
||||
(optional but recommended)
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.sleepycat.com"
|
||||
TARGET="_top"
|
||||
>Berkeley
|
||||
DB</A
|
||||
> (optional but recommended)
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> POSIX Thread (required)
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="DEPEND-DEVELOPERS"
|
||||
>Dependencies for developers</A
|
||||
></H2
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.gnu.org/software/autoconf"
|
||||
TARGET="_top"
|
||||
> autoconf
|
||||
</A
|
||||
>
|
||||
2.13
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.gnu.org/software/automake"
|
||||
TARGET="_top"
|
||||
> automake
|
||||
</A
|
||||
>
|
||||
1.4
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <A
|
||||
HREF="http://www.gnu.org/software/libtool/libtool.html"
|
||||
TARGET="_top"
|
||||
> libtool
|
||||
</A
|
||||
>
|
||||
1.4.3
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> jade and some SGML tools will be required
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x19.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x82.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Author</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
> </TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Existing packages</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,238 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Author</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan!"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Introduction"
|
||||
HREF="c13.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Introduction"
|
||||
HREF="c13.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Installation"
|
||||
HREF="c53.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan!</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c13.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 1. Introduction</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c53.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="AUTHOR"
|
||||
>Author</A
|
||||
></H1
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="MAIN-AUTH"
|
||||
>Main author</A
|
||||
></H2
|
||||
><P
|
||||
> DINH Viet Hoa <CODE
|
||||
CLASS="EMAIL"
|
||||
><<A
|
||||
HREF="mailto:hoa@users.sourceforge.net"
|
||||
>hoa@users.sourceforge.net</A
|
||||
>></CODE
|
||||
>
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CONTRIB"
|
||||
>Contributors</A
|
||||
></H2
|
||||
><P
|
||||
> <P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> Wim Delvaux
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Melvin Hadasht
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> David Woodhouse
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Juergen Graf
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Zsolt VARGA
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Gael Roualland
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Toni Willberg
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Rajko Albrecht
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Nikita V. Youshchenko
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Frederic Devernay
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Michael Leupold
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> Colin Leroy
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
>
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c13.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c53.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Introduction</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c13.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Installation</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,184 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Existing packages</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan!"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Installation"
|
||||
HREF="c53.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Installation"
|
||||
HREF="c53.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Compilation"
|
||||
HREF="x94.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan!</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c53.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 2. Installation</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x94.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="PACKAGES"
|
||||
>Existing packages</A
|
||||
></H1
|
||||
><P
|
||||
> Before you try to compile it, you have to know that packages
|
||||
exist for some systems.
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="PACKAGE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></H2
|
||||
><P
|
||||
> you can find it in ports/mail/libetpan.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="PACKAGE-DEBIAN"
|
||||
>Debian</A
|
||||
></H2
|
||||
><P
|
||||
> This is in the package collection.
|
||||
</P
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="PACKAGE-MANDRAKE"
|
||||
>Mandrake Linux</A
|
||||
></H2
|
||||
><P
|
||||
> This is in the package collection.
|
||||
</P
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c53.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x94.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Installation</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c53.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Compilation</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,394 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML
|
||||
><HEAD
|
||||
><TITLE
|
||||
>Compilation</TITLE
|
||||
><META
|
||||
NAME="GENERATOR"
|
||||
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
|
||||
REL="HOME"
|
||||
TITLE="libEtPan!"
|
||||
HREF="book1.htm"><LINK
|
||||
REL="UP"
|
||||
TITLE="Installation"
|
||||
HREF="c53.htm"><LINK
|
||||
REL="PREVIOUS"
|
||||
TITLE="Existing packages"
|
||||
HREF="x82.htm"><LINK
|
||||
REL="NEXT"
|
||||
TITLE="Use of libEtPan!"
|
||||
HREF="c157.htm"></HEAD
|
||||
><BODY
|
||||
CLASS="SECT1"
|
||||
BGCOLOR="#FFFFFF"
|
||||
TEXT="#000000"
|
||||
LINK="#0000FF"
|
||||
VLINK="#840084"
|
||||
ALINK="#0000FF"
|
||||
><DIV
|
||||
CLASS="NAVHEADER"
|
||||
><TABLE
|
||||
SUMMARY="Header navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TH
|
||||
COLSPAN="3"
|
||||
ALIGN="center"
|
||||
>libEtPan!</TH
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="left"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="x82.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="80%"
|
||||
ALIGN="center"
|
||||
VALIGN="bottom"
|
||||
>Chapter 2. Installation</TD
|
||||
><TD
|
||||
WIDTH="10%"
|
||||
ALIGN="right"
|
||||
VALIGN="bottom"
|
||||
><A
|
||||
HREF="c157.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"></DIV
|
||||
><DIV
|
||||
CLASS="SECT1"
|
||||
><H1
|
||||
CLASS="SECT1"
|
||||
><A
|
||||
NAME="COMPILATION"
|
||||
>Compilation</A
|
||||
></H1
|
||||
><P
|
||||
> Generic installation instructions are in the
|
||||
<TT
|
||||
CLASS="FILENAME"
|
||||
>INSTALL</TT
|
||||
> file
|
||||
You can pass the following extra options to configure :
|
||||
</P
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="COMPILE-FREEBSD"
|
||||
>FreeBSD</A
|
||||
></H2
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> make sure libiconv is installed from the ports collection (see
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>pkg_info</B
|
||||
>).
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> issue configure with the following parameter:
|
||||
<PRE
|
||||
CLASS="SCREEN"
|
||||
><SAMP
|
||||
CLASS="PROMPT"
|
||||
>$</SAMP
|
||||
> <KBD
|
||||
CLASS="USERINPUT"
|
||||
>./configure --with-libiconv-prefix=/usr/local</KBD
|
||||
>
|
||||
</PRE
|
||||
>
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="COMPILE-MACOSX"
|
||||
>Mac OS X</A
|
||||
></H2
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> in tests/option-parser.c, change the inclusion
|
||||
of <TT
|
||||
CLASS="FILENAME"
|
||||
>getopt.h</TT
|
||||
> to
|
||||
<TT
|
||||
CLASS="FILENAME"
|
||||
>gnugetopt/getopt.h</TT
|
||||
>
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> in <TT
|
||||
CLASS="FILENAME"
|
||||
>tests/Makefile</TT
|
||||
>, add
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>-I/sw/include</B
|
||||
> for the
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>CFLAGS</B
|
||||
> and
|
||||
-L/sw/lib -lgnugetopt for the LDFLAGS.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="LINUX"
|
||||
>Linux</A
|
||||
></H2
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><DIV
|
||||
CLASS="WARNING"
|
||||
><P
|
||||
></P
|
||||
><TABLE
|
||||
CLASS="WARNING"
|
||||
BORDER="1"
|
||||
WIDTH="90%"
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="CENTER"
|
||||
><B
|
||||
>Warning</B
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
ALIGN="LEFT"
|
||||
><P
|
||||
> Since libEtPan! is making high usage of
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>mmap()</B
|
||||
> even for
|
||||
writing, when your mailboxes are on
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>NFS</B
|
||||
> filesystem with
|
||||
a Linux server, it is advised to use option
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>no_subtree_check</B
|
||||
> in
|
||||
<TT
|
||||
CLASS="FILENAME"
|
||||
>/etc/exports</TT
|
||||
>.
|
||||
This should avoid corruption of data.
|
||||
</P
|
||||
><P
|
||||
> The problem exist in Linux 2.4.22 and earlier versions.
|
||||
</P
|
||||
></TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> On RedHat systems, you have to configure using the
|
||||
following command line :
|
||||
<B
|
||||
CLASS="COMMAND"
|
||||
>./configure --with-openssl=/usr/kerberos</B
|
||||
>
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> On Debian systems, if the <B
|
||||
CLASS="COMMAND"
|
||||
>./autogen</B
|
||||
>
|
||||
script fails on missing <B
|
||||
CLASS="COMMAND"
|
||||
>AM_ICONV</B
|
||||
>, you
|
||||
have to install <B
|
||||
CLASS="COMMAND"
|
||||
>gettext</B
|
||||
> package.
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="CONFIGURE"
|
||||
>configure</A
|
||||
></H2
|
||||
><P
|
||||
> You can use the following options :
|
||||
</P
|
||||
><P
|
||||
></P
|
||||
><UL
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>--enable-debug</B
|
||||
> Compiles with
|
||||
debugging turned on
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>--enable-optim</B
|
||||
> Turns on some
|
||||
optimizations flags for gcc
|
||||
</P
|
||||
></LI
|
||||
><LI
|
||||
><P
|
||||
> <B
|
||||
CLASS="COMMAND"
|
||||
>--without-openssl</B
|
||||
> Disables OpenSSL (do
|
||||
not look for it)
|
||||
</P
|
||||
></LI
|
||||
></UL
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="SECT2"
|
||||
><H2
|
||||
CLASS="SECT2"
|
||||
><A
|
||||
NAME="INSTALL"
|
||||
>Compile and install</A
|
||||
></H2
|
||||
><P
|
||||
> Download the package and do the following :
|
||||
</P
|
||||
><PRE
|
||||
CLASS="PROGRAMLISTING"
|
||||
>$ tar xzvf libetpan-XX.XX.tar.gz # to decompress the package
|
||||
|
||||
$ cd libetpan-XX.XX
|
||||
|
||||
$ ./configure --help # to get options of configure
|
||||
|
||||
$ ./configure # you can specify your own options
|
||||
|
||||
$ make # to compile the package
|
||||
|
||||
$ su
|
||||
|
||||
# make install
|
||||
|
||||
# logout
|
||||
</PRE
|
||||
></DIV
|
||||
></DIV
|
||||
><DIV
|
||||
CLASS="NAVFOOTER"
|
||||
><HR
|
||||
ALIGN="LEFT"
|
||||
WIDTH="100%"><TABLE
|
||||
SUMMARY="Footer navigation table"
|
||||
WIDTH="100%"
|
||||
BORDER="0"
|
||||
CELLPADDING="0"
|
||||
CELLSPACING="0"
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="x82.htm"
|
||||
ACCESSKEY="P"
|
||||
>Prev</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="book1.htm"
|
||||
ACCESSKEY="H"
|
||||
>Home</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c157.htm"
|
||||
ACCESSKEY="N"
|
||||
>Next</A
|
||||
></TD
|
||||
></TR
|
||||
><TR
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="left"
|
||||
VALIGN="top"
|
||||
>Existing packages</TD
|
||||
><TD
|
||||
WIDTH="34%"
|
||||
ALIGN="center"
|
||||
VALIGN="top"
|
||||
><A
|
||||
HREF="c53.htm"
|
||||
ACCESSKEY="U"
|
||||
>Up</A
|
||||
></TD
|
||||
><TD
|
||||
WIDTH="33%"
|
||||
ALIGN="right"
|
||||
VALIGN="top"
|
||||
>Use of libEtPan!</TD
|
||||
></TR
|
||||
></TABLE
|
||||
></DIV
|
||||
></BODY
|
||||
></HTML
|
||||
>
|
|
@ -1,54 +0,0 @@
|
|||
digraph "etPan! library" {
|
||||
mime -> imf;
|
||||
|
||||
"session/message" -> imf;
|
||||
"session/message" -> mime;
|
||||
|
||||
"storage/folder" -> "session/message";
|
||||
}
|
||||
|
||||
digraph "imap driver" {
|
||||
"imap driver" -> imap;
|
||||
"imap driver" -> imf;
|
||||
"imap driver" -> mime;
|
||||
"imap driver" -> "session/message";
|
||||
|
||||
mime -> imf;
|
||||
}
|
||||
|
||||
digraph "mbox driver" {
|
||||
"mbox driver" -> mbox;
|
||||
"mbox driver" -> imf;
|
||||
"mbox driver" -> mime;
|
||||
"mbox driver" -> "session/message";
|
||||
"mbox" -> imf;
|
||||
|
||||
mime -> imf;
|
||||
}
|
||||
|
||||
digraph "mh driver" {
|
||||
"mh driver" -> mh;
|
||||
"mh driver" -> imf;
|
||||
"mh driver" -> mime;
|
||||
"mh driver" -> "session/message";
|
||||
|
||||
mime -> imf;
|
||||
}
|
||||
|
||||
digraph "pop3 driver" {
|
||||
"pop3 driver" -> pop3;
|
||||
"pop3 driver" -> imf;
|
||||
"pop3 driver" -> mime;
|
||||
"pop3 driver" -> "session/message";
|
||||
|
||||
mime -> imf;
|
||||
}
|
||||
|
||||
digraph "nntp driver" {
|
||||
"nntp driver" -> nntp;
|
||||
"nntp driver" -> imf;
|
||||
"nntp driver" -> mime;
|
||||
"nntp driver" -> "session/message";
|
||||
|
||||
mime -> imf;
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
#FIG 3.2
|
||||
Landscape
|
||||
Center
|
||||
Metric
|
||||
A4
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
1200 2
|
||||
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
|
||||
900 3150 12150 3150 12150 3825 900 3825 900 3150
|
||||
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
|
||||
900 3825 12150 3825 12150 4500 900 4500 900 3825
|
||||
2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
|
||||
3150 3150 3150 3825
|
||||
2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
|
||||
5400 3150 5400 3825
|
||||
2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
|
||||
7650 3150 7650 3825
|
||||
2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2
|
||||
9900 3150 9900 3825
|
||||
2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 7
|
||||
12150 3150 900 3150 900 2475 12825 2475 12825 4500 12150 4500
|
||||
12150 3150
|
||||
2 3 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 7
|
||||
900 2475 900 1800 13500 1800 13500 4500 12825 4500 12825 2475
|
||||
900 2475
|
||||
2 3 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 8
|
||||
900 4500 225 4500 225 1125 13500 1125 13500 1800 900 1800
|
||||
900 4500 900 4500
|
||||
4 0 0 50 0 16 20 0.0000 4 210 1410 1305 3600 IMAP4rev1\001
|
||||
4 0 0 50 0 16 20 0.0000 4 210 450 10800 3600 MH\001
|
||||
4 0 0 50 0 16 20 0.0000 4 210 720 8370 3555 mbox\001
|
||||
4 0 0 50 0 16 20 0.0000 4 210 795 6120 3600 NNTP\001
|
||||
4 0 0 50 0 16 20 0.0000 4 210 765 3870 3600 POP3\001
|
||||
4 0 0 50 0 16 20 0.0000 4 270 1620 5670 2880 session layer\001
|
||||
4 0 0 50 0 16 20 0.0000 4 270 2730 5085 2250 storage / folders layer\001
|
||||
4 0 0 50 0 16 20 0.0000 4 210 1500 5760 4275 IMF / MIME\001
|
||||
4 0 0 50 0 16 20 0.0000 4 270 1395 5670 1575 application\001
|
|
@ -1,442 +0,0 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2006-05-11.20
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
posix_glob=
|
||||
posix_mkdir=
|
||||
|
||||
# Symbolic mode for testing mkdir with directories.
|
||||
# It is the same as 755, but also tests that "u+" works.
|
||||
test_mode=u=rwx,g=rx,o=rx,u+wx
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Desired mode of newly created intermediate directories.
|
||||
# It is empty if not known yet.
|
||||
intermediate_mode=
|
||||
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
posix_mkdir=false
|
||||
if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
|
||||
posix_mkdir=true
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && {
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, create it using the same intermediate mode that
|
||||
# mkdir -p would use when creating intermediate directories.
|
||||
# POSIX says that this mode is "$(umask -S),u+wx", so use that
|
||||
# if umask -S works.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=$mode
|
||||
else
|
||||
case $intermediate_mode in
|
||||
'')
|
||||
if umask_S=`(umask -S) 2>/dev/null`; then
|
||||
intermediate_mode=$umask_S,u+wx
|
||||
else
|
||||
intermediate_mode=$test_mode
|
||||
fi ;;
|
||||
esac
|
||||
mkdir_mode=$intermediate_mode
|
||||
fi
|
||||
|
||||
$mkdirprog -m "$mkdir_mode" -p -- "$dstdir"
|
||||
}
|
||||
then :
|
||||
else
|
||||
|
||||
# mkdir does not conform to POSIX, or it failed possibly due to
|
||||
# a race condition. Create the directory the slow way, step by
|
||||
# step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix=/ ;;
|
||||
-*) prefix=./ ;;
|
||||
*) prefix= ;;
|
||||
esac
|
||||
|
||||
case $posix_glob in
|
||||
'')
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=true
|
||||
else
|
||||
posix_glob=false
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob && set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob && set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
$mkdirprog -m "$mkdir_mode" -p -- "$dstdir" && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
eval "\$mkdirprog $prefixes" || test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
$doit $cpprog "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dst"; then
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null \
|
||||
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
|
||||
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
} || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -1,38 +0,0 @@
|
|||
@ifndef LIBETPAN_CONFIG_H
|
||||
|
||||
@define LIBETPAN_CONFIG_H
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
@ifdef _MSC_VER
|
||||
@ define MMAP_UNAVAILABLE
|
||||
@ define inline __inline
|
||||
@endif
|
||||
#ifdef HAVE_LIMITS_H
|
||||
@include <limits.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
/* support for ARM platforms with a 2.95.3 arm-gcc suite */
|
||||
@include <sys/param.h>
|
||||
#endif
|
||||
#if HAVE_INTTYPES_H
|
||||
@include <inttypes.h>
|
||||
#endif
|
||||
|
||||
@define MAIL_DIR_SEPARATOR '/'
|
||||
|
||||
@define MAIL_DIR_SEPARATOR_S "/"
|
||||
|
||||
@ifdef _MSC_VER
|
||||
@ ifdef LIBETPAN_DLL
|
||||
@ define LIBETPAN_EXPORT __declspec(dllexport)
|
||||
@ else
|
||||
@ define LIBETPAN_EXPORT __declspec(dllimport)
|
||||
@ endif
|
||||
@else
|
||||
@ define LIBETPAN_EXPORT
|
||||
@endif
|
||||
|
||||
@endif
|
|
@ -1,60 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
exec_prefix_set=no
|
||||
|
||||
usage="\
|
||||
Usage: libetpan-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
--prefix=*)
|
||||
prefix=$optarg
|
||||
if test $exec_prefix_set = no ; then
|
||||
exec_prefix=$optarg
|
||||
fi
|
||||
;;
|
||||
--prefix)
|
||||
echo $prefix
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix=$optarg
|
||||
exec_prefix_set=yes
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo $exec_prefix
|
||||
;;
|
||||
--version)
|
||||
echo @VERSION@
|
||||
;;
|
||||
--cflags)
|
||||
if test "@includedir@" = "/usr/include" ; then
|
||||
includedir=""
|
||||
else
|
||||
includedir=-I@includedir@
|
||||
fi
|
||||
echo $includedir
|
||||
;;
|
||||
--libs)
|
||||
libdir=-L@libdir@
|
||||
echo $libdir -letpan@LIBSUFFIX@ @LDFLAGS@ @SSLLIBS@ @GNUTLSLIB@ @LIBICONV@ @DBLIB@ @LIBS@ @SASLLIBS@
|
||||
;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.libs
|
||||
Makefile
|
||||
*.la
|
|
@ -1,68 +0,0 @@
|
|||
top_builddir = ..
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
libdir = @libdir@
|
||||
includedir = @includedir@
|
||||
mandir = @mandir@
|
||||
bindir = @bindir@
|
||||
SHELL = /bin/sh
|
||||
RM = rm -fr
|
||||
INSTALL = @INSTALL@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
@SET_MAKE@
|
||||
|
||||
TARGET = libetpan@LIBSUFFIX@.la
|
||||
|
||||
VERSINFO = @API_VERSION@
|
||||
CC = @CC@
|
||||
LDFLAGS = @LDFLAGS@ @LIBS@ @SSLLIBS@ @LIBICONV@ @DBLIB@ @GNUTLSLIB@ @SASLLIBS@
|
||||
|
||||
SUBLIBS = data-types/libdata-types.la \
|
||||
low-level/liblow-level.la \
|
||||
driver/libdriver.la \
|
||||
main/libmain.la \
|
||||
engine/libengine.la
|
||||
|
||||
|
||||
SUBDIRS = data-types \
|
||||
low-level \
|
||||
driver \
|
||||
main \
|
||||
engine
|
||||
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): Makefile $(SUBLIBS)
|
||||
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(SUBLIBS) \
|
||||
-rpath $(libdir) -version-info $(VERSINFO)
|
||||
|
||||
$(SUBLIBS): all-recursive
|
||||
|
||||
install: all install-dirs install-recursive
|
||||
$(LIBTOOL) --mode=install $(INSTALL) -m 644 $(TARGET) $(DESTDIR)$(libdir)
|
||||
|
||||
install-dirs:
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(libdir)
|
||||
|
||||
clean: clean-recursive
|
||||
$(RM) -fr $(TARGET) .libs
|
||||
|
||||
prepare: prepare-recursive
|
||||
|
||||
all-recursive install-recursive clean-recursive \
|
||||
distclean-recursive prepare-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
|
||||
Makefile: Makefile.in ../config.status
|
||||
cd ${top_builddir} && CONFIG_FILES=src/Makefile CONFIG_HEADERS= ./config.status
|
||||
|
||||
distclean: clean
|
||||
rm -rf Makefile
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
/* $NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1987, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
Modified by Sebastien Marinier for windows OS
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define _getprogname() nargv[0]
|
||||
#else
|
||||
# include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD: /repoman/r/ncvs/src/lib/libc/stdlib/getopt.c,v 1.7 2004/03/06 17:05:45 ache Exp $");
|
||||
|
||||
#include "namespace.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "un-namespace.h"
|
||||
|
||||
#include "libc_private.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int opterr = 1, /* if error message should be printed */
|
||||
optind = 1, /* index into parent argv vector */
|
||||
optopt, /* character checked for validity */
|
||||
optreset; /* reset getopt */
|
||||
char *optarg; /* argument associated with option */
|
||||
|
||||
#define BADCH (int)'?'
|
||||
#define BADARG (int)':'
|
||||
#define EMSG ""
|
||||
|
||||
/*
|
||||
* getopt --
|
||||
* Parse argc/argv argument vector.
|
||||
*/
|
||||
int
|
||||
getopt(nargc, nargv, ostr)
|
||||
int nargc;
|
||||
char * const nargv[];
|
||||
const char *ostr;
|
||||
{
|
||||
static char *place = EMSG; /* option letter processing */
|
||||
char *oli; /* option letter list index */
|
||||
|
||||
if (optreset || *place == 0) { /* update scanning pointer */
|
||||
optreset = 0;
|
||||
place = nargv[optind];
|
||||
if (optind >= nargc || *place++ != '-') {
|
||||
/* Argument is absent or is not an option */
|
||||
place = EMSG;
|
||||
return (-1);
|
||||
}
|
||||
optopt = *place++;
|
||||
if (optopt == '-' && *place == 0) {
|
||||
/* "--" => end of options */
|
||||
++optind;
|
||||
place = EMSG;
|
||||
return (-1);
|
||||
}
|
||||
if (optopt == 0) {
|
||||
/* Solitary '-', treat as a '-' option
|
||||
if the program (eg su) is looking for it. */
|
||||
place = EMSG;
|
||||
if (strchr(ostr, '-') == NULL)
|
||||
return (-1);
|
||||
optopt = '-';
|
||||
}
|
||||
} else
|
||||
optopt = *place++;
|
||||
|
||||
/* See if option letter is one the caller wanted... */
|
||||
if (optopt == ':' || (oli = strchr(ostr, optopt)) == NULL) {
|
||||
if (*place == 0)
|
||||
++optind;
|
||||
if (opterr && *ostr != ':')
|
||||
(void)fprintf(stderr,
|
||||
"%s: illegal option -- %c\n", _getprogname(),
|
||||
optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
|
||||
/* Does this option need an argument? */
|
||||
if (oli[1] != ':') {
|
||||
/* don't need argument */
|
||||
optarg = NULL;
|
||||
if (*place == 0)
|
||||
++optind;
|
||||
} else {
|
||||
/* Option-argument is either the rest of this argument or the
|
||||
entire next argument. */
|
||||
if (*place)
|
||||
optarg = place;
|
||||
else if (nargc > ++optind)
|
||||
optarg = nargv[optind];
|
||||
else {
|
||||
/* option-argument absent */
|
||||
place = EMSG;
|
||||
if (*ostr == ':')
|
||||
return (BADARG);
|
||||
if (opterr)
|
||||
(void)fprintf(stderr,
|
||||
"%s: option requires an argument -- %c\n",
|
||||
_getprogname(), optopt);
|
||||
return (BADCH);
|
||||
}
|
||||
place = EMSG;
|
||||
++optind;
|
||||
}
|
||||
return (optopt); /* return option letter */
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
|
||||
/* $FreeBSD: /repoman/r/ncvs/src/include/getopt.h,v 1.6 2004/02/24 08:09:20 ache Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Dieter Baron and Thomas Klausner.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
Modified by Sebastien Marinier for windows OS
|
||||
*/
|
||||
|
||||
#ifndef _GETOPT_H_
|
||||
#define _GETOPT_H_
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define __BEGIN_DECLS
|
||||
# define __END_DECLS
|
||||
#else
|
||||
# include <sys/cdefs.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension.
|
||||
* getopt() is declared here too for GNU programs.
|
||||
*/
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
struct option {
|
||||
/* name of long option */
|
||||
const char *name;
|
||||
/*
|
||||
* one of no_argument, required_argument, and optional_argument:
|
||||
* whether option takes an argument
|
||||
*/
|
||||
int has_arg;
|
||||
/* if not NULL, set *flag to val when option found */
|
||||
int *flag;
|
||||
/* if flag not NULL, value to set *flag to; else return value */
|
||||
int val;
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
int getopt_long(int, char * const *, const char *,
|
||||
const struct option *, int *);
|
||||
int getopt_long_only(int, char * const *, const char *,
|
||||
const struct option *, int *);
|
||||
#ifndef _GETOPT_DECLARED
|
||||
#define _GETOPT_DECLARED
|
||||
int getopt(int, char * const [], const char *);
|
||||
|
||||
extern char *optarg; /* getopt(3) external variables */
|
||||
extern int optind, opterr, optopt;
|
||||
#endif
|
||||
#ifndef _OPTRESET_DECLARED
|
||||
#define _OPTRESET_DECLARED
|
||||
extern int optreset; /* getopt(3) external variable */
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_GETOPT_H_ */
|
|
@ -1,651 +0,0 @@
|
|||
/* $OpenBSD: getopt_long.c,v 1.17 2004/06/03 18:46:52 millert Exp $ */
|
||||
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Sponsored in part by the Defense Advanced Research Projects
|
||||
* Agency (DARPA) and Air Force Research Laboratory, Air Force
|
||||
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
||||
*/
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Dieter Baron and Thomas Klausner.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
Modified by Sebastien Marinier for windows OS
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char *rcsid = "$OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#include "getopt.h"
|
||||
static void warnx() {
|
||||
}
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD: /repoman/r/ncvs/src/lib/libc/stdlib/getopt_long.c,v 1.12 2004/07/06 13:58:45 ache Exp $");
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define GNU_COMPATIBLE /* Be more compatible, configure's use us! */
|
||||
|
||||
#ifndef GNU_COMPATIBLE
|
||||
#define REPLACE_GETOPT /* use this getopt as the system getopt(3) */
|
||||
#endif
|
||||
|
||||
#ifdef REPLACE_GETOPT
|
||||
int opterr = 1; /* if error message should be printed */
|
||||
int optind = 1; /* index into parent argv vector */
|
||||
int optopt = '?'; /* character checked for validity */
|
||||
int optreset; /* reset getopt */
|
||||
char *optarg; /* argument associated with option */
|
||||
#endif
|
||||
|
||||
#define PRINT_ERROR ((opterr) && (*options != ':'))
|
||||
|
||||
#define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */
|
||||
#define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */
|
||||
#define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */
|
||||
|
||||
/* return values */
|
||||
#define BADCH (int)'?'
|
||||
#define BADARG ((*options == ':') ? (int)':' : (int)'?')
|
||||
#define INORDER (int)1
|
||||
|
||||
#define EMSG ""
|
||||
|
||||
#ifdef GNU_COMPATIBLE
|
||||
#define NO_PREFIX (-1)
|
||||
#define D_PREFIX 0
|
||||
#define DD_PREFIX 1
|
||||
#define W_PREFIX 2
|
||||
#endif
|
||||
|
||||
static int getopt_internal(int, char * const *, const char *,
|
||||
const struct option *, int *, int);
|
||||
static int parse_long_options(char * const *, const char *,
|
||||
const struct option *, int *, int, int);
|
||||
static int gcd(int, int);
|
||||
static void permute_args(int, int, int, char * const *);
|
||||
|
||||
static char *place = EMSG; /* option letter processing */
|
||||
|
||||
/* XXX: set optreset to 1 rather than these two */
|
||||
static int nonopt_start = -1; /* first non option argument (for permute) */
|
||||
static int nonopt_end = -1; /* first option after non options (for permute) */
|
||||
|
||||
/* Error messages */
|
||||
static const char recargchar[] = "option requires an argument -- %c";
|
||||
static const char illoptchar[] = "illegal option -- %c"; /* From P1003.2 */
|
||||
#ifdef GNU_COMPATIBLE
|
||||
static int dash_prefix = NO_PREFIX;
|
||||
static const char gnuoptchar[] = "invalid option -- %c";
|
||||
|
||||
static const char recargstring[] = "option `%s%s' requires an argument";
|
||||
static const char ambig[] = "option `%s%.*s' is ambiguous";
|
||||
static const char noarg[] = "option `%s%.*s' doesn't allow an argument";
|
||||
static const char illoptstring[] = "unrecognized option `%s%s'";
|
||||
#else
|
||||
static const char recargstring[] = "option requires an argument -- %s";
|
||||
static const char ambig[] = "ambiguous option -- %.*s";
|
||||
static const char noarg[] = "option doesn't take an argument -- %.*s";
|
||||
static const char illoptstring[] = "unknown option -- %s";
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compute the greatest common divisor of a and b.
|
||||
*/
|
||||
static int
|
||||
gcd(int a, int b)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = a % b;
|
||||
while (c != 0) {
|
||||
a = b;
|
||||
b = c;
|
||||
c = a % b;
|
||||
}
|
||||
|
||||
return (b);
|
||||
}
|
||||
|
||||
/*
|
||||
* Exchange the block from nonopt_start to nonopt_end with the block
|
||||
* from nonopt_end to opt_end (keeping the same order of arguments
|
||||
* in each block).
|
||||
*/
|
||||
static void
|
||||
permute_args(int panonopt_start, int panonopt_end, int opt_end,
|
||||
char * const *nargv)
|
||||
{
|
||||
int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
|
||||
char *swap;
|
||||
|
||||
/*
|
||||
* compute lengths of blocks and number and size of cycles
|
||||
*/
|
||||
nnonopts = panonopt_end - panonopt_start;
|
||||
nopts = opt_end - panonopt_end;
|
||||
ncycle = gcd(nnonopts, nopts);
|
||||
cyclelen = (opt_end - panonopt_start) / ncycle;
|
||||
|
||||
for (i = 0; i < ncycle; i++) {
|
||||
cstart = panonopt_end+i;
|
||||
pos = cstart;
|
||||
for (j = 0; j < cyclelen; j++) {
|
||||
if (pos >= panonopt_end)
|
||||
pos -= nnonopts;
|
||||
else
|
||||
pos += nopts;
|
||||
swap = nargv[pos];
|
||||
/* LINTED const cast */
|
||||
((char **) nargv)[pos] = nargv[cstart];
|
||||
/* LINTED const cast */
|
||||
((char **)nargv)[cstart] = swap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* parse_long_options --
|
||||
* Parse long options in argc/argv argument vector.
|
||||
* Returns -1 if short_too is set and the option does not match long_options.
|
||||
*/
|
||||
static int
|
||||
parse_long_options(char * const *nargv, const char *options,
|
||||
const struct option *long_options, int *idx, int short_too, int flags)
|
||||
{
|
||||
char *current_argv, *has_equal;
|
||||
#ifdef GNU_COMPATIBLE
|
||||
char *current_dash;
|
||||
#endif
|
||||
size_t current_argv_len;
|
||||
int i, match, exact_match, second_partial_match;
|
||||
|
||||
current_argv = place;
|
||||
#ifdef GNU_COMPATIBLE
|
||||
switch (dash_prefix) {
|
||||
case D_PREFIX:
|
||||
current_dash = "-";
|
||||
break;
|
||||
case DD_PREFIX:
|
||||
current_dash = "--";
|
||||
break;
|
||||
case W_PREFIX:
|
||||
current_dash = "-W ";
|
||||
break;
|
||||
default:
|
||||
current_dash = "";
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
match = -1;
|
||||
exact_match = 0;
|
||||
second_partial_match = 0;
|
||||
|
||||
optind++;
|
||||
|
||||
if ((has_equal = strchr(current_argv, '=')) != NULL) {
|
||||
/* argument found (--option=arg) */
|
||||
current_argv_len = has_equal - current_argv;
|
||||
has_equal++;
|
||||
} else
|
||||
current_argv_len = strlen(current_argv);
|
||||
|
||||
for (i = 0; long_options[i].name; i++) {
|
||||
/* find matching long option */
|
||||
if (strncmp(current_argv, long_options[i].name,
|
||||
current_argv_len))
|
||||
continue;
|
||||
|
||||
if (strlen(long_options[i].name) == current_argv_len) {
|
||||
/* exact match */
|
||||
match = i;
|
||||
exact_match = 1;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* If this is a known short option, don't allow
|
||||
* a partial match of a single character.
|
||||
*/
|
||||
if (short_too && current_argv_len == 1)
|
||||
continue;
|
||||
|
||||
if (match == -1) /* first partial match */
|
||||
match = i;
|
||||
else if ((flags & FLAG_LONGONLY) ||
|
||||
long_options[i].has_arg !=
|
||||
long_options[match].has_arg ||
|
||||
long_options[i].flag != long_options[match].flag ||
|
||||
long_options[i].val != long_options[match].val)
|
||||
second_partial_match = 1;
|
||||
}
|
||||
if (!exact_match && second_partial_match) {
|
||||
/* ambiguous abbreviation */
|
||||
if (PRINT_ERROR)
|
||||
warnx(ambig,
|
||||
#ifdef GNU_COMPATIBLE
|
||||
current_dash,
|
||||
#endif
|
||||
(int)current_argv_len,
|
||||
current_argv);
|
||||
optopt = 0;
|
||||
return (BADCH);
|
||||
}
|
||||
if (match != -1) { /* option found */
|
||||
if (long_options[match].has_arg == no_argument
|
||||
&& has_equal) {
|
||||
if (PRINT_ERROR)
|
||||
warnx(noarg,
|
||||
#ifdef GNU_COMPATIBLE
|
||||
current_dash,
|
||||
#endif
|
||||
(int)current_argv_len,
|
||||
current_argv);
|
||||
/*
|
||||
* XXX: GNU sets optopt to val regardless of flag
|
||||
*/
|
||||
if (long_options[match].flag == NULL)
|
||||
optopt = long_options[match].val;
|
||||
else
|
||||
optopt = 0;
|
||||
#ifdef GNU_COMPATIBLE
|
||||
return (BADCH);
|
||||
#else
|
||||
return (BADARG);
|
||||
#endif
|
||||
}
|
||||
if (long_options[match].has_arg == required_argument ||
|
||||
long_options[match].has_arg == optional_argument) {
|
||||
if (has_equal)
|
||||
optarg = has_equal;
|
||||
else if (long_options[match].has_arg ==
|
||||
required_argument) {
|
||||
/*
|
||||
* optional argument doesn't use next nargv
|
||||
*/
|
||||
optarg = nargv[optind++];
|
||||
}
|
||||
}
|
||||
if ((long_options[match].has_arg == required_argument)
|
||||
&& (optarg == NULL)) {
|
||||
/*
|
||||
* Missing argument; leading ':' indicates no error
|
||||
* should be generated.
|
||||
*/
|
||||
if (PRINT_ERROR)
|
||||
warnx(recargstring,
|
||||
#ifdef GNU_COMPATIBLE
|
||||
current_dash,
|
||||
#endif
|
||||
current_argv);
|
||||
/*
|
||||
* XXX: GNU sets optopt to val regardless of flag
|
||||
*/
|
||||
if (long_options[match].flag == NULL)
|
||||
optopt = long_options[match].val;
|
||||
else
|
||||
optopt = 0;
|
||||
--optind;
|
||||
return (BADARG);
|
||||
}
|
||||
} else { /* unknown option */
|
||||
if (short_too) {
|
||||
--optind;
|
||||
return (-1);
|
||||
}
|
||||
if (PRINT_ERROR)
|
||||
warnx(illoptstring,
|
||||
#ifdef GNU_COMPATIBLE
|
||||
current_dash,
|
||||
#endif
|
||||
current_argv);
|
||||
optopt = 0;
|
||||
return (BADCH);
|
||||
}
|
||||
if (idx)
|
||||
*idx = match;
|
||||
if (long_options[match].flag) {
|
||||
*long_options[match].flag = long_options[match].val;
|
||||
return (0);
|
||||
} else
|
||||
return (long_options[match].val);
|
||||
}
|
||||
|
||||
/*
|
||||
* getopt_internal --
|
||||
* Parse argc/argv argument vector. Called by user level routines.
|
||||
*/
|
||||
static int
|
||||
getopt_internal(int nargc, char * const *nargv, const char *options,
|
||||
const struct option *long_options, int *idx, int flags)
|
||||
{
|
||||
char *oli; /* option letter list index */
|
||||
int optchar, short_too;
|
||||
int posixly_correct;
|
||||
|
||||
if (options == NULL)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Disable GNU extensions if POSIXLY_CORRECT is set or options
|
||||
* string begins with a '+'.
|
||||
*/
|
||||
posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
|
||||
#ifdef GNU_COMPATIBLE
|
||||
if (*options == '-')
|
||||
flags |= FLAG_ALLARGS;
|
||||
else if (posixly_correct || *options == '+')
|
||||
flags &= ~FLAG_PERMUTE;
|
||||
#else
|
||||
if (posixly_correct || *options == '+')
|
||||
flags &= ~FLAG_PERMUTE;
|
||||
else if (*options == '-')
|
||||
flags |= FLAG_ALLARGS;
|
||||
#endif
|
||||
if (*options == '+' || *options == '-')
|
||||
options++;
|
||||
|
||||
/*
|
||||
* XXX Some GNU programs (like cvs) set optind to 0 instead of
|
||||
* XXX using optreset. Work around this braindamage.
|
||||
*/
|
||||
if (optind == 0)
|
||||
optind = optreset = 1;
|
||||
|
||||
optarg = NULL;
|
||||
if (optreset)
|
||||
nonopt_start = nonopt_end = -1;
|
||||
start:
|
||||
if (optreset || !*place) { /* update scanning pointer */
|
||||
optreset = 0;
|
||||
if (optind >= nargc) { /* end of argument vector */
|
||||
place = EMSG;
|
||||
if (nonopt_end != -1) {
|
||||
/* do permutation, if we have to */
|
||||
permute_args(nonopt_start, nonopt_end,
|
||||
optind, nargv);
|
||||
optind -= nonopt_end - nonopt_start;
|
||||
}
|
||||
else if (nonopt_start != -1) {
|
||||
/*
|
||||
* If we skipped non-options, set optind
|
||||
* to the first of them.
|
||||
*/
|
||||
optind = nonopt_start;
|
||||
}
|
||||
nonopt_start = nonopt_end = -1;
|
||||
return (-1);
|
||||
}
|
||||
if (*(place = nargv[optind]) != '-' ||
|
||||
#ifdef GNU_COMPATIBLE
|
||||
place[1] == '\0') {
|
||||
#else
|
||||
(place[1] == '\0' && strchr(options, '-') == NULL)) {
|
||||
#endif
|
||||
place = EMSG; /* found non-option */
|
||||
if (flags & FLAG_ALLARGS) {
|
||||
/*
|
||||
* GNU extension:
|
||||
* return non-option as argument to option 1
|
||||
*/
|
||||
optarg = nargv[optind++];
|
||||
return (INORDER);
|
||||
}
|
||||
if (!(flags & FLAG_PERMUTE)) {
|
||||
/*
|
||||
* If no permutation wanted, stop parsing
|
||||
* at first non-option.
|
||||
*/
|
||||
return (-1);
|
||||
}
|
||||
/* do permutation */
|
||||
if (nonopt_start == -1)
|
||||
nonopt_start = optind;
|
||||
else if (nonopt_end != -1) {
|
||||
permute_args(nonopt_start, nonopt_end,
|
||||
optind, nargv);
|
||||
nonopt_start = optind -
|
||||
(nonopt_end - nonopt_start);
|
||||
nonopt_end = -1;
|
||||
}
|
||||
optind++;
|
||||
/* process next argument */
|
||||
goto start;
|
||||
}
|
||||
if (nonopt_start != -1 && nonopt_end == -1)
|
||||
nonopt_end = optind;
|
||||
|
||||
/*
|
||||
* If we have "-" do nothing, if "--" we are done.
|
||||
*/
|
||||
if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
|
||||
optind++;
|
||||
place = EMSG;
|
||||
/*
|
||||
* We found an option (--), so if we skipped
|
||||
* non-options, we have to permute.
|
||||
*/
|
||||
if (nonopt_end != -1) {
|
||||
permute_args(nonopt_start, nonopt_end,
|
||||
optind, nargv);
|
||||
optind -= nonopt_end - nonopt_start;
|
||||
}
|
||||
nonopt_start = nonopt_end = -1;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check long options if:
|
||||
* 1) we were passed some
|
||||
* 2) the arg is not just "-"
|
||||
* 3) either the arg starts with -- we are getopt_long_only()
|
||||
*/
|
||||
if (long_options != NULL && place != nargv[optind] &&
|
||||
(*place == '-' || (flags & FLAG_LONGONLY))) {
|
||||
short_too = 0;
|
||||
#ifdef GNU_COMPATIBLE
|
||||
dash_prefix = D_PREFIX;
|
||||
#endif
|
||||
if (*place == '-') {
|
||||
place++; /* --foo long option */
|
||||
#ifdef GNU_COMPATIBLE
|
||||
dash_prefix = DD_PREFIX;
|
||||
#endif
|
||||
} else if (*place != ':' && strchr(options, *place) != NULL)
|
||||
short_too = 1; /* could be short option too */
|
||||
|
||||
optchar = parse_long_options(nargv, options, long_options,
|
||||
idx, short_too, flags);
|
||||
if (optchar != -1) {
|
||||
place = EMSG;
|
||||
return (optchar);
|
||||
}
|
||||
}
|
||||
|
||||
if ((optchar = (int)*place++) == (int)':' ||
|
||||
(optchar == (int)'-' && *place != '\0') ||
|
||||
(oli = strchr(options, optchar)) == NULL) {
|
||||
/*
|
||||
* If the user specified "-" and '-' isn't listed in
|
||||
* options, return -1 (non-option) as per POSIX.
|
||||
* Otherwise, it is an unknown option character (or ':').
|
||||
*/
|
||||
if (optchar == (int)'-' && *place == '\0')
|
||||
return (-1);
|
||||
if (!*place)
|
||||
++optind;
|
||||
#ifdef GNU_COMPATIBLE
|
||||
if (PRINT_ERROR)
|
||||
warnx(posixly_correct ? illoptchar : gnuoptchar,
|
||||
optchar);
|
||||
#else
|
||||
if (PRINT_ERROR)
|
||||
warnx(illoptchar, optchar);
|
||||
#endif
|
||||
optopt = optchar;
|
||||
return (BADCH);
|
||||
}
|
||||
if (long_options != NULL && optchar == 'W' && oli[1] == ';') {
|
||||
/* -W long-option */
|
||||
if (*place) /* no space */
|
||||
/* NOTHING */;
|
||||
else if (++optind >= nargc) { /* no arg */
|
||||
place = EMSG;
|
||||
if (PRINT_ERROR)
|
||||
warnx(recargchar, optchar);
|
||||
optopt = optchar;
|
||||
return (BADARG);
|
||||
} else /* white space */
|
||||
place = nargv[optind];
|
||||
#ifdef GNU_COMPATIBLE
|
||||
dash_prefix = W_PREFIX;
|
||||
#endif
|
||||
optchar = parse_long_options(nargv, options, long_options,
|
||||
idx, 0, flags);
|
||||
place = EMSG;
|
||||
return (optchar);
|
||||
}
|
||||
if (*++oli != ':') { /* doesn't take argument */
|
||||
if (!*place)
|
||||
++optind;
|
||||
} else { /* takes (optional) argument */
|
||||
optarg = NULL;
|
||||
if (*place) /* no white space */
|
||||
optarg = place;
|
||||
/* XXX: disable test for :: if PC? (GNU doesn't) */
|
||||
else if (oli[1] != ':') { /* arg not optional */
|
||||
if (++optind >= nargc) { /* no arg */
|
||||
place = EMSG;
|
||||
if (PRINT_ERROR)
|
||||
warnx(recargchar, optchar);
|
||||
optopt = optchar;
|
||||
return (BADARG);
|
||||
} else
|
||||
optarg = nargv[optind];
|
||||
} else if (!(flags & FLAG_PERMUTE)) {
|
||||
/*
|
||||
* If permutation is disabled, we can accept an
|
||||
* optional arg separated by whitespace so long
|
||||
* as it does not start with a dash (-).
|
||||
*/
|
||||
if (optind + 1 < nargc && *nargv[optind + 1] != '-')
|
||||
optarg = nargv[++optind];
|
||||
}
|
||||
place = EMSG;
|
||||
++optind;
|
||||
}
|
||||
/* dump back option letter */
|
||||
return (optchar);
|
||||
}
|
||||
|
||||
#ifdef REPLACE_GETOPT
|
||||
/*
|
||||
* getopt --
|
||||
* Parse argc/argv argument vector.
|
||||
*
|
||||
* [eventually this will replace the BSD getopt]
|
||||
*/
|
||||
int
|
||||
getopt(int nargc, char * const *nargv, const char *options)
|
||||
{
|
||||
|
||||
/*
|
||||
* We don't pass FLAG_PERMUTE to getopt_internal() since
|
||||
* the BSD getopt(3) (unlike GNU) has never done this.
|
||||
*
|
||||
* Furthermore, since many privileged programs call getopt()
|
||||
* before dropping privileges it makes sense to keep things
|
||||
* as simple (and bug-free) as possible.
|
||||
*/
|
||||
return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
|
||||
}
|
||||
#endif /* REPLACE_GETOPT */
|
||||
|
||||
/*
|
||||
* getopt_long --
|
||||
* Parse argc/argv argument vector.
|
||||
*/
|
||||
int
|
||||
getopt_long(nargc, nargv, options, long_options, idx)
|
||||
int nargc;
|
||||
char * const *nargv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *idx;
|
||||
{
|
||||
|
||||
return (getopt_internal(nargc, nargv, options, long_options, idx,
|
||||
FLAG_PERMUTE));
|
||||
}
|
||||
|
||||
/*
|
||||
* getopt_long_only --
|
||||
* Parse argc/argv argument vector.
|
||||
*/
|
||||
int
|
||||
getopt_long_only(nargc, nargv, options, long_options, idx)
|
||||
int nargc;
|
||||
char * const *nargv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *idx;
|
||||
{
|
||||
|
||||
return (getopt_internal(nargc, nargv, options, long_options, idx,
|
||||
FLAG_PERMUTE|FLAG_LONGONLY));
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
.libs
|
||||
*.la
|
||||
*.lo
|
|
@ -1,17 +0,0 @@
|
|||
top_builddir = ../..
|
||||
|
||||
TARGET = libdata-types
|
||||
HEADERS = mmapstring.h mailstream.h mailstream_helper.h mail.h \
|
||||
mailstream_low.h \
|
||||
mailstream_socket.h mailstream_ssl.h \
|
||||
mailstream_types.h \
|
||||
carray.h clist.h chash.h cinthash.h \
|
||||
charconv.h mailsem.h maillock.h
|
||||
SOURCES = connect.c md5.c mmapstring.c \
|
||||
mailstream_helper.c mailstream_low.c \
|
||||
mailstream.c mailstream_socket.c mailstream_ssl.c \
|
||||
mapping.c cinthash.c carray.c clist.c chash.c \
|
||||
charconv.c maillock.c base64.c \
|
||||
mail_cache_db.c mailsem.c mailsasl.c
|
||||
|
||||
include $(top_builddir)/Rules
|
|
@ -1,145 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - Juergen Graf
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: base64.c,v 1.3 2005/06/01 12:21:57 smarinier Exp $
|
||||
*/
|
||||
|
||||
#include "base64.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define OUTPUT_SIZE 513
|
||||
#define CHAR64(c) (((c) < 0 || (c) > 127) ? -1 : index_64[(c)])
|
||||
|
||||
static char index_64[128] = {
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
|
||||
52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1,
|
||||
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
|
||||
15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
|
||||
-1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
|
||||
41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
|
||||
};
|
||||
|
||||
static char basis_64[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
char * encode_base64(const char * in, int len)
|
||||
{
|
||||
char * output, * tmp;
|
||||
unsigned char oval;
|
||||
int out_len;
|
||||
|
||||
out_len = ((len + 2) / 3 * 4) + 1;
|
||||
|
||||
if ((len > 0) && (in == NULL))
|
||||
return NULL;
|
||||
|
||||
output = malloc(out_len);
|
||||
if (!output)
|
||||
return NULL;
|
||||
|
||||
tmp = output;
|
||||
while (len >= 3) {
|
||||
*tmp++ = basis_64[in[0] >> 2];
|
||||
*tmp++ = basis_64[((in[0] << 4) & 0x30) | (in[1] >> 4)];
|
||||
*tmp++ = basis_64[((in[1] << 2) & 0x3c) | (in[2] >> 6)];
|
||||
*tmp++ = basis_64[in[2] & 0x3f];
|
||||
in += 3;
|
||||
len -= 3;
|
||||
}
|
||||
if (len > 0) {
|
||||
*tmp++ = basis_64[in[0] >> 2];
|
||||
oval = (in[0] << 4) & 0x30;
|
||||
if (len > 1) oval |= in[1] >> 4;
|
||||
*tmp++ = basis_64[oval];
|
||||
*tmp++ = (len < 2) ? '=' : basis_64[(in[1] << 2) & 0x3c];
|
||||
*tmp++ = '=';
|
||||
}
|
||||
|
||||
*tmp = '\0';
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
char * decode_base64(const char * in, int len)
|
||||
{
|
||||
char * output, * out;
|
||||
int i, c1, c2, c3, c4, out_len;
|
||||
|
||||
out_len = 0;
|
||||
|
||||
output = malloc(OUTPUT_SIZE);
|
||||
if (output == NULL)
|
||||
return NULL;
|
||||
out = output;
|
||||
|
||||
if (in[0] == '+' && in[1] == ' ')
|
||||
in += 2;
|
||||
|
||||
for (i = 0; i < (len / 4); i++) {
|
||||
c1 = in[0];
|
||||
c2 = in[1];
|
||||
c3 = in[2];
|
||||
c4 = in[3];
|
||||
if (CHAR64(c1) == -1 || CHAR64(c2) == -1 ||
|
||||
(c3 != '=' && CHAR64(c3) == -1) ||
|
||||
(c4 != '=' && CHAR64(c4) == -1))
|
||||
return NULL;
|
||||
|
||||
in += 4;
|
||||
*output++ = (CHAR64(c1) << 2) | (CHAR64(c2) >> 4);
|
||||
if (++out_len >= OUTPUT_SIZE)
|
||||
return NULL;
|
||||
|
||||
if (c3 != '=') {
|
||||
*output++ = ((CHAR64(c2) << 4) & 0xf0) | (CHAR64(c3) >> 2);
|
||||
if (++out_len >= OUTPUT_SIZE)
|
||||
return NULL;
|
||||
|
||||
if (c4 != '=') {
|
||||
*output++ = ((CHAR64(c3) << 6) & 0xc0) | CHAR64(c4);
|
||||
if (++out_len >= OUTPUT_SIZE)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*output = 0;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - Juergen Graf
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: base64.h,v 1.3 2005/06/01 12:21:57 smarinier Exp $
|
||||
*/
|
||||
|
||||
#ifndef BASE64_H
|
||||
#define BASE64_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef LIBETPAN_CONFIG_H
|
||||
# include "libetpan-config.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* creates (malloc) a new base64 encoded string from a standard 8bit string
|
||||
* don't forget to free it when time comes ;)
|
||||
*/
|
||||
LIBETPAN_EXPORT
|
||||
char * encode_base64(const char * in, int len);
|
||||
|
||||
/**
|
||||
* creates (malloc) a new standard 8bit string from an base64 encoded string
|
||||
* don't forget to free it when time comes ;)
|
||||
*/
|
||||
LIBETPAN_EXPORT
|
||||
char * decode_base64(const char * in, int len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,162 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* carray - Implements simple dynamic pointer arrays
|
||||
*
|
||||
* Copyright (c) 1999-2005, Gaël Roualland <gael.roualland@iname.com>
|
||||
* interface changes - 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: carray.c,v 1.10 2006/05/22 13:39:40 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "carray.h"
|
||||
|
||||
#define MIN_ARRAY_SIZE 4
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
carray * carray_new(unsigned int initsize) {
|
||||
carray * array;
|
||||
|
||||
array = (carray *) malloc(sizeof(carray));
|
||||
if (!array) return NULL;
|
||||
|
||||
if (initsize < MIN_ARRAY_SIZE)
|
||||
initsize = MIN_ARRAY_SIZE;
|
||||
|
||||
array->len = 0;
|
||||
array->max = initsize;
|
||||
array->array = (void **) malloc(sizeof(void *) * initsize);
|
||||
if (!array->array) {
|
||||
free(array);
|
||||
return NULL;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int carray_add(carray * array, void * data, unsigned int * index) {
|
||||
int r;
|
||||
|
||||
r = carray_set_size(array, array->len + 1);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
array->array[array->len - 1] = data;
|
||||
if (index != NULL)
|
||||
* index = array->len - 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int carray_set_size(carray * array, unsigned int new_size)
|
||||
{
|
||||
if (new_size > array->max) {
|
||||
unsigned int n = array->max * 2;
|
||||
void * new;
|
||||
|
||||
while (n <= new_size)
|
||||
n *= 2;
|
||||
|
||||
new = (void **) realloc(array->array, sizeof(void *) * n);
|
||||
if (!new)
|
||||
return -1;
|
||||
array->array = new;
|
||||
array->max = n;
|
||||
}
|
||||
array->len = new_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int carray_delete_fast(carray * array, unsigned int indx) {
|
||||
if (indx >= array->len)
|
||||
return -1;
|
||||
|
||||
array->array[indx] = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int carray_delete(carray * array, unsigned int indx) {
|
||||
if (indx >= array->len)
|
||||
return -1;
|
||||
|
||||
if (indx != --array->len)
|
||||
array->array[indx] = array->array[array->len];
|
||||
return 0;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int carray_delete_slow(carray * array, unsigned int indx) {
|
||||
if (indx >= array->len)
|
||||
return -1;
|
||||
|
||||
if (indx != --array->len)
|
||||
memmove(array->array + indx, array->array + indx + 1,
|
||||
(array->len - indx) * sizeof(void *));
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef NO_MACROS
|
||||
LIBETPAN_EXPORT
|
||||
void ** carray_data(carray * array) {
|
||||
return array->array;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
unsigned int carray_count(carray * array) {
|
||||
return array->len;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void * carray_get(carray * array, unsigned int indx) {
|
||||
return array->array[indx];
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void carray_set(carray * array, unsigned int indx, void * value) {
|
||||
array->array[indx] = value;
|
||||
}
|
||||
#endif
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void carray_free(carray * array) {
|
||||
free(array->array);
|
||||
free(array);
|
||||
}
|
|
@ -1,138 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* carray - Implements simple dynamic pointer arrays
|
||||
*
|
||||
* Copyright (c) 1999-2005, Gaël Roualland <gael.roualland@iname.com>
|
||||
* interface changes - 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: carray.h,v 1.16 2006/03/22 08:10:47 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef CARRAY_H
|
||||
#define CARRAY_H
|
||||
|
||||
#ifndef LIBETPAN_CONFIG_H
|
||||
# include <libetpan/libetpan-config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct carray_s {
|
||||
void ** array;
|
||||
unsigned int len;
|
||||
unsigned int max;
|
||||
};
|
||||
|
||||
typedef struct carray_s carray;
|
||||
|
||||
/* Creates a new array of pointers, with initsize preallocated cells */
|
||||
LIBETPAN_EXPORT
|
||||
carray * carray_new(unsigned int initsize);
|
||||
|
||||
/* Adds the pointer to data in the array.
|
||||
Returns the index of the pointer in the array or -1 on error */
|
||||
LIBETPAN_EXPORT
|
||||
int carray_add(carray * array, void * data, unsigned int * index);
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int carray_set_size(carray * array, unsigned int new_size);
|
||||
|
||||
/* Removes the cell at this index position. Returns TRUE on success.
|
||||
Order of elements in the array IS changed. */
|
||||
LIBETPAN_EXPORT
|
||||
int carray_delete(carray * array, unsigned int indx);
|
||||
|
||||
/* Removes the cell at this index position. Returns TRUE on success.
|
||||
Order of elements in the array IS not changed. */
|
||||
LIBETPAN_EXPORT
|
||||
int carray_delete_slow(carray * array, unsigned int indx);
|
||||
|
||||
/* remove without decreasing the size of the array */
|
||||
LIBETPAN_EXPORT
|
||||
int carray_delete_fast(carray * array, unsigned int indx);
|
||||
|
||||
/* Some of the following routines can be implemented as macros to
|
||||
be faster. If you don't want it, define NO_MACROS */
|
||||
#ifdef NO_MACROS
|
||||
|
||||
/* Returns the array itself */
|
||||
LIBETPAN_EXPORT
|
||||
void ** carray_data(carray *);
|
||||
|
||||
/* Returns the number of elements in the array */
|
||||
LIBETPAN_EXPORT
|
||||
unsigned int carray_count(carray *);
|
||||
|
||||
/* Returns the contents of one cell */
|
||||
LIBETPAN_EXPORT
|
||||
void * carray_get(carray * array, unsigned int indx);
|
||||
|
||||
/* Sets the contents of one cell */
|
||||
LIBETPAN_EXPORT
|
||||
void carray_set(carray * array, unsigned int indx, void * value);
|
||||
|
||||
#else
|
||||
|
||||
#if 0
|
||||
#define carray_data(a) (a->array)
|
||||
#define carray_count(a) (a->len)
|
||||
#define carray_get(a, indx) (a->array[indx])
|
||||
#define carray_set(a, indx, v) do { a->array[indx]=v; } while(0)
|
||||
#endif
|
||||
|
||||
static inline void ** carray_data(carray * array) {
|
||||
return array->array;
|
||||
}
|
||||
|
||||
static inline unsigned int carray_count(carray * array) {
|
||||
return array->len;
|
||||
}
|
||||
|
||||
static inline void * carray_get(carray * array, unsigned int indx) {
|
||||
return array->array[indx];
|
||||
}
|
||||
|
||||
static inline void carray_set(carray * array,
|
||||
unsigned int indx, void * value) {
|
||||
array->array[indx] = value;
|
||||
}
|
||||
#endif
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void carray_free(carray * array);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,316 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: charconv.c,v 1.22 2006/07/03 16:36:08 skunk Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "charconv.h"
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "mmapstring.h"
|
||||
|
||||
int (*extended_charconv)(const char * tocode, const char * fromcode, const char * str, size_t length,
|
||||
char * result, size_t* result_len) = NULL;
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
static size_t mail_iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft,
|
||||
char **outbuf, size_t *outbytesleft,
|
||||
char **inrepls, char *outrepl)
|
||||
{
|
||||
size_t ret = 0, ret1;
|
||||
/* XXX - force const to mutable */
|
||||
char *ib = (char *) *inbuf;
|
||||
size_t ibl = *inbytesleft;
|
||||
char *ob = *outbuf;
|
||||
size_t obl = *outbytesleft;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
#ifdef HAVE_ICONV_PROTO_CONST
|
||||
ret1 = iconv (cd, (const char **) &ib, &ibl, &ob, &obl);
|
||||
#else
|
||||
ret1 = iconv (cd, &ib, &ibl, &ob, &obl);
|
||||
#endif
|
||||
if (ret1 != (size_t)-1)
|
||||
ret += ret1;
|
||||
if (ibl && obl && errno == EILSEQ)
|
||||
{
|
||||
if (inrepls)
|
||||
{
|
||||
/* Try replacing the input */
|
||||
char **t;
|
||||
for (t = inrepls; *t; t++)
|
||||
{
|
||||
char *ib1 = *t;
|
||||
size_t ibl1 = strlen (*t);
|
||||
char *ob1 = ob;
|
||||
size_t obl1 = obl;
|
||||
#ifdef HAVE_ICONV_PROTO_CONST
|
||||
iconv (cd, (const char **) &ib1, &ibl1, &ob1, &obl1);
|
||||
#else
|
||||
iconv (cd, &ib1, &ibl1, &ob1, &obl1);
|
||||
#endif
|
||||
if (!ibl1)
|
||||
{
|
||||
++ib, --ibl;
|
||||
ob = ob1, obl = obl1;
|
||||
++ret;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*t)
|
||||
continue;
|
||||
}
|
||||
if (outrepl)
|
||||
{
|
||||
/* Try replacing the output */
|
||||
size_t n = strlen (outrepl);
|
||||
if (n <= obl)
|
||||
{
|
||||
memcpy (ob, outrepl, n);
|
||||
++ib, --ibl;
|
||||
ob += n, obl -= n;
|
||||
++ret;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
*inbuf = ib, *inbytesleft = ibl;
|
||||
*outbuf = ob, *outbytesleft = obl;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int charconv(const char * tocode, const char * fromcode,
|
||||
const char * str, size_t length,
|
||||
char ** result)
|
||||
{
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t conv;
|
||||
size_t r;
|
||||
char * pout;
|
||||
size_t out_size;
|
||||
size_t old_out_size;
|
||||
size_t count;
|
||||
#endif
|
||||
char * out;
|
||||
int res;
|
||||
|
||||
if (extended_charconv != NULL) {
|
||||
size_t result_length;
|
||||
result_length = length * 6;
|
||||
*result = malloc( length * 6 + 1);
|
||||
if (*result == NULL) {
|
||||
res = MAIL_CHARCONV_ERROR_MEMORY;
|
||||
} else {
|
||||
res = (*extended_charconv)( tocode, fromcode, str, length, *result, &result_length);
|
||||
if (res != MAIL_CHARCONV_NO_ERROR) {
|
||||
free( *result);
|
||||
} else {
|
||||
out = realloc( *result, result_length + 1);
|
||||
if (out != NULL) *result = out;
|
||||
/* also a cstring, just in case */
|
||||
(*result)[result_length] = '\0';
|
||||
}
|
||||
}
|
||||
if (res != MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET)
|
||||
return res;
|
||||
/* else, let's try with iconv, if available */
|
||||
}
|
||||
|
||||
#ifndef HAVE_ICONV
|
||||
return MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET;
|
||||
#else
|
||||
|
||||
conv = iconv_open(tocode, fromcode);
|
||||
if (conv == (iconv_t) -1) {
|
||||
res = MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET;
|
||||
goto err;
|
||||
}
|
||||
|
||||
out_size = 6 * length; /* UTF-8 can be encoded up to 6 bytes */
|
||||
|
||||
out = malloc(out_size + 1);
|
||||
if (out == NULL) {
|
||||
res = MAIL_CHARCONV_ERROR_MEMORY;
|
||||
goto close_iconv;
|
||||
}
|
||||
|
||||
pout = out;
|
||||
old_out_size = out_size;
|
||||
|
||||
r = mail_iconv(conv, &str, &length, &pout, &out_size, NULL, "?");
|
||||
|
||||
if (r == (size_t) -1) {
|
||||
res = MAIL_CHARCONV_ERROR_CONV;
|
||||
goto free;
|
||||
}
|
||||
|
||||
iconv_close(conv);
|
||||
|
||||
* pout = '\0';
|
||||
count = old_out_size - out_size;
|
||||
pout = realloc(out, count + 1);
|
||||
if (pout != NULL)
|
||||
out = pout;
|
||||
|
||||
* result = out;
|
||||
|
||||
return MAIL_CHARCONV_NO_ERROR;
|
||||
|
||||
free:
|
||||
free(out);
|
||||
close_iconv:
|
||||
iconv_close(conv);
|
||||
err:
|
||||
return res;
|
||||
#endif
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int charconv_buffer(const char * tocode, const char * fromcode,
|
||||
const char * str, size_t length,
|
||||
char ** result, size_t * result_len)
|
||||
{
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t conv;
|
||||
size_t iconv_r;
|
||||
int r;
|
||||
char * out;
|
||||
char * pout;
|
||||
size_t out_size;
|
||||
size_t old_out_size;
|
||||
size_t count;
|
||||
#endif
|
||||
int res;
|
||||
MMAPString * mmapstr;
|
||||
|
||||
if (extended_charconv != NULL) {
|
||||
size_t result_length;
|
||||
result_length = length * 6;
|
||||
mmapstr = mmap_string_sized_new( result_length + 1);
|
||||
*result_len = 0;
|
||||
if (mmapstr == NULL) {
|
||||
res = MAIL_CHARCONV_ERROR_MEMORY;
|
||||
} else {
|
||||
res = (*extended_charconv)( tocode, fromcode, str, length, mmapstr->str, &result_length);
|
||||
if (res != MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET) {
|
||||
if (res == MAIL_CHARCONV_NO_ERROR) {
|
||||
*result = mmapstr->str;
|
||||
res = mmap_string_ref(mmapstr);
|
||||
if (res < 0) {
|
||||
res = MAIL_CHARCONV_ERROR_MEMORY;
|
||||
mmap_string_free(mmapstr);
|
||||
} else {
|
||||
mmap_string_set_size( mmapstr, result_length); /* can't fail */
|
||||
*result_len = result_length;
|
||||
}
|
||||
}
|
||||
free( *result);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/* else, let's try with iconv, if available */
|
||||
}
|
||||
|
||||
#ifndef HAVE_ICONV
|
||||
return MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET;
|
||||
#else
|
||||
|
||||
conv = iconv_open(tocode, fromcode);
|
||||
if (conv == (iconv_t) -1) {
|
||||
res = MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET;
|
||||
goto err;
|
||||
}
|
||||
|
||||
out_size = 6 * length; /* UTF-8 can be encoded up to 6 bytes */
|
||||
|
||||
mmapstr = mmap_string_sized_new(out_size + 1);
|
||||
if (mmapstr == NULL) {
|
||||
res = MAIL_CHARCONV_ERROR_MEMORY;
|
||||
goto err;
|
||||
}
|
||||
|
||||
out = mmapstr->str;
|
||||
|
||||
pout = out;
|
||||
old_out_size = out_size;
|
||||
|
||||
iconv_r = mail_iconv(conv, &str, &length, &pout, &out_size, NULL, "?");
|
||||
|
||||
if (iconv_r == (size_t) -1) {
|
||||
res = MAIL_CHARCONV_ERROR_CONV;
|
||||
goto free;
|
||||
}
|
||||
|
||||
iconv_close(conv);
|
||||
|
||||
* pout = '\0';
|
||||
|
||||
count = old_out_size - out_size;
|
||||
|
||||
r = mmap_string_ref(mmapstr);
|
||||
if (r < 0) {
|
||||
res = MAIL_CHARCONV_ERROR_MEMORY;
|
||||
goto free;
|
||||
}
|
||||
|
||||
* result = out;
|
||||
* result_len = count;
|
||||
|
||||
return MAIL_CHARCONV_NO_ERROR;
|
||||
|
||||
free:
|
||||
mmap_string_free(mmapstr);
|
||||
err:
|
||||
return res;
|
||||
#endif
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void charconv_buffer_free(char * str)
|
||||
{
|
||||
mmap_string_unref(str);
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: charconv.h,v 1.13 2006/06/16 09:25:23 smarinier Exp $
|
||||
*/
|
||||
|
||||
#ifndef CHARCONV_H
|
||||
|
||||
#define CHARCONV_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef LIBETPAN_CONFIG_H
|
||||
# include <libetpan/libetpan-config.h>
|
||||
#endif
|
||||
|
||||
enum {
|
||||
MAIL_CHARCONV_NO_ERROR = 0,
|
||||
MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET,
|
||||
MAIL_CHARCONV_ERROR_MEMORY,
|
||||
MAIL_CHARCONV_ERROR_CONV
|
||||
};
|
||||
|
||||
/**
|
||||
* define your own conversion.
|
||||
* - result is big enough to contain your converted string
|
||||
* - result_len contain the maximum size available (out value must contain the final converted size)
|
||||
* - your conversion return an error code based on upper enum values
|
||||
*/
|
||||
LIBETPAN_EXPORT
|
||||
extern int (*extended_charconv)(const char * tocode, const char * fromcode, const char * str, size_t length,
|
||||
char * result, size_t* result_len);
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int charconv(const char * tocode, const char * fromcode,
|
||||
const char * str, size_t length,
|
||||
char ** result);
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int charconv_buffer(const char * tocode, const char * fromcode,
|
||||
const char * str, size_t length,
|
||||
char ** result, size_t * result_len);
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void charconv_buffer_free(char * str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,414 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* chash - Implements generic hash tables.
|
||||
*
|
||||
* Copyright (c) 1999-2005, Gaël Roualland <gael.roualland@iname.com>
|
||||
* interface changes - 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: chash.c,v 1.16 2006/05/22 13:39:40 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "chash.h"
|
||||
|
||||
/* This defines the maximum (average) number of entries per bucket.
|
||||
The hash is resized everytime inserting an entry makes the
|
||||
average go over that value. */
|
||||
#define CHASH_MAXDEPTH 3
|
||||
|
||||
static inline unsigned int chash_func(const char * key, unsigned int len) {
|
||||
#if 0
|
||||
register unsigned int c = 0, t;
|
||||
register const char * k = key;
|
||||
|
||||
while (len--) {
|
||||
c += (c << 4) + *k++;
|
||||
if ((t = c & 0xF0000000)) {
|
||||
c ^= t >> 24;
|
||||
c ^= t;
|
||||
}
|
||||
}
|
||||
return c;
|
||||
#endif
|
||||
register unsigned int c = 5381;
|
||||
register const char * k = key;
|
||||
|
||||
while (len--) {
|
||||
c = ((c << 5) + c) + *k++;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline char * chash_dup(const void * data, unsigned int len)
|
||||
{
|
||||
void * r;
|
||||
|
||||
r = (char *) malloc(len);
|
||||
if (!r)
|
||||
return NULL;
|
||||
memcpy(r, data, len);
|
||||
return r;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
chash * chash_new(unsigned int size, int flags)
|
||||
{
|
||||
chash * h;
|
||||
|
||||
h = (chash *) malloc(sizeof(chash));
|
||||
if (h == NULL)
|
||||
return NULL;
|
||||
|
||||
if (size < CHASH_DEFAULTSIZE)
|
||||
size = CHASH_DEFAULTSIZE;
|
||||
|
||||
h->count = 0;
|
||||
h->cells = (struct chashcell **) calloc(size, sizeof(struct chashcell *));
|
||||
if (h->cells == NULL) {
|
||||
free(h);
|
||||
return NULL;
|
||||
}
|
||||
h->size = size;
|
||||
h->copykey = flags & CHASH_COPYKEY;
|
||||
h->copyvalue = flags & CHASH_COPYVALUE;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int chash_get(chash * hash,
|
||||
chashdatum * key, chashdatum * result)
|
||||
{
|
||||
unsigned int func;
|
||||
chashiter * iter;
|
||||
|
||||
func = chash_func(key->data, key->len);
|
||||
|
||||
/* look for the key in existing cells */
|
||||
iter = hash->cells[func % hash->size];
|
||||
while (iter) {
|
||||
if (iter->key.len == key->len && iter->func == func
|
||||
&& !memcmp(iter->key.data, key->data, key->len)) {
|
||||
* result = iter->value; /* found */
|
||||
|
||||
return 0;
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int chash_set(chash * hash,
|
||||
chashdatum * key,
|
||||
chashdatum * value,
|
||||
chashdatum * oldvalue)
|
||||
{
|
||||
unsigned int func, indx;
|
||||
chashiter * iter, * cell;
|
||||
int r;
|
||||
|
||||
if (hash->count > hash->size * CHASH_MAXDEPTH) {
|
||||
r = chash_resize(hash, (hash->count / CHASH_MAXDEPTH) * 2 + 1);
|
||||
if (r < 0)
|
||||
goto err;
|
||||
}
|
||||
|
||||
func = chash_func(key->data, key->len);
|
||||
indx = func % hash->size;
|
||||
|
||||
/* look for the key in existing cells */
|
||||
iter = hash->cells[indx];
|
||||
while (iter) {
|
||||
if (iter->key.len == key->len && iter->func == func
|
||||
&& !memcmp(iter->key.data, key->data, key->len)) {
|
||||
/* found, replacing entry */
|
||||
if (hash->copyvalue) {
|
||||
char * data;
|
||||
|
||||
data = chash_dup(value->data, value->len);
|
||||
if (data == NULL)
|
||||
goto err;
|
||||
|
||||
free(iter->value.data);
|
||||
iter->value.data = data;
|
||||
iter->value.len = value->len;
|
||||
} else {
|
||||
if (oldvalue != NULL) {
|
||||
oldvalue->data = iter->value.data;
|
||||
oldvalue->len = iter->value.len;
|
||||
}
|
||||
iter->value.data = value->data;
|
||||
iter->value.len = value->len;
|
||||
}
|
||||
if (!hash->copykey)
|
||||
iter->key.data = key->data;
|
||||
|
||||
if (oldvalue != NULL) {
|
||||
oldvalue->data = value->data;
|
||||
oldvalue->len = value->len;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
if (oldvalue != NULL) {
|
||||
oldvalue->data = NULL;
|
||||
oldvalue->len = 0;
|
||||
}
|
||||
|
||||
/* not found, adding entry */
|
||||
cell = (struct chashcell *) malloc(sizeof(struct chashcell));
|
||||
if (cell == NULL)
|
||||
goto err;
|
||||
|
||||
if (hash->copykey) {
|
||||
cell->key.data = chash_dup(key->data, key->len);
|
||||
if (cell->key.data == NULL)
|
||||
goto free;
|
||||
}
|
||||
else
|
||||
cell->key.data = key->data;
|
||||
|
||||
cell->key.len = key->len;
|
||||
if (hash->copyvalue) {
|
||||
cell->value.data = chash_dup(value->data, value->len);
|
||||
if (cell->value.data == NULL)
|
||||
goto free_key_data;
|
||||
}
|
||||
else
|
||||
cell->value.data = value->data;
|
||||
|
||||
cell->value.len = value->len;
|
||||
cell->func = func;
|
||||
cell->next = hash->cells[indx];
|
||||
hash->cells[indx] = cell;
|
||||
hash->count++;
|
||||
|
||||
return 0;
|
||||
|
||||
free_key_data:
|
||||
if (hash->copykey)
|
||||
free(cell->key.data);
|
||||
free:
|
||||
free(cell);
|
||||
err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int chash_delete(chash * hash, chashdatum * key, chashdatum * oldvalue)
|
||||
{
|
||||
/* chashdatum result = { NULL, TRUE }; */
|
||||
unsigned int func, indx;
|
||||
chashiter * iter, * old;
|
||||
|
||||
/*
|
||||
if (!keylen)
|
||||
keylen = strlen(key) + 1;
|
||||
*/
|
||||
|
||||
func = chash_func(key->data, key->len);
|
||||
indx = func % hash->size;
|
||||
|
||||
/* look for the key in existing cells */
|
||||
old = NULL;
|
||||
iter = hash->cells[indx];
|
||||
while (iter) {
|
||||
if (iter->key.len == key->len && iter->func == func
|
||||
&& !memcmp(iter->key.data, key->data, key->len)) {
|
||||
/* found, deleting */
|
||||
if (old)
|
||||
old->next = iter->next;
|
||||
else
|
||||
hash->cells[indx] = iter->next;
|
||||
if (hash->copykey)
|
||||
free(iter->key.data);
|
||||
if (hash->copyvalue)
|
||||
free(iter->value.data);
|
||||
else {
|
||||
if (oldvalue != NULL) {
|
||||
oldvalue->data = iter->value.data;
|
||||
oldvalue->len = iter->value.len;
|
||||
}
|
||||
}
|
||||
free(iter);
|
||||
hash->count--;
|
||||
return 0;
|
||||
}
|
||||
old = iter;
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
return -1; /* not found */
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void chash_free(chash * hash) {
|
||||
unsigned int indx;
|
||||
chashiter * iter, * next;
|
||||
|
||||
/* browse the hash table */
|
||||
for(indx = 0; indx < hash->size; indx++) {
|
||||
iter = hash->cells[indx];
|
||||
while (iter) {
|
||||
next = iter->next;
|
||||
if (hash->copykey)
|
||||
free(iter->key.data);
|
||||
if (hash->copyvalue)
|
||||
free(iter->value.data);
|
||||
free(iter);
|
||||
iter = next;
|
||||
}
|
||||
}
|
||||
free(hash->cells);
|
||||
free(hash);
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void chash_clear(chash * hash) {
|
||||
unsigned int indx;
|
||||
chashiter * iter, * next;
|
||||
|
||||
/* browse the hash table */
|
||||
for(indx = 0; indx < hash->size; indx++) {
|
||||
iter = hash->cells[indx];
|
||||
while (iter) {
|
||||
next = iter->next;
|
||||
if (hash->copykey)
|
||||
free(iter->key.data);
|
||||
if (hash->copyvalue)
|
||||
free(iter->value.data);
|
||||
free(iter);
|
||||
iter = next;
|
||||
}
|
||||
}
|
||||
memset(hash->cells, 0, hash->size * sizeof(* hash->cells));
|
||||
hash->count = 0;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
chashiter * chash_begin(chash * hash) {
|
||||
chashiter * iter;
|
||||
unsigned int indx = 0;
|
||||
|
||||
iter = hash->cells[0];
|
||||
while(!iter) {
|
||||
indx++;
|
||||
if (indx >= hash->size)
|
||||
return NULL;
|
||||
iter = hash->cells[indx];
|
||||
}
|
||||
return iter;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
chashiter * chash_next(chash * hash, chashiter * iter) {
|
||||
unsigned int indx;
|
||||
|
||||
if (!iter)
|
||||
return NULL;
|
||||
|
||||
indx = iter->func % hash->size;
|
||||
iter = iter->next;
|
||||
|
||||
while(!iter) {
|
||||
indx++;
|
||||
if (indx >= hash->size)
|
||||
return NULL;
|
||||
iter = hash->cells[indx];
|
||||
}
|
||||
return iter;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int chash_resize(chash * hash, unsigned int size)
|
||||
{
|
||||
struct chashcell ** cells;
|
||||
unsigned int indx, nindx;
|
||||
chashiter * iter, * next;
|
||||
|
||||
if (hash->size == size)
|
||||
return 0;
|
||||
|
||||
cells = (struct chashcell **) calloc(size, sizeof(struct chashcell *));
|
||||
if (!cells)
|
||||
return -1;
|
||||
|
||||
/* browse initial hash and copy items in second hash */
|
||||
for(indx = 0; indx < hash->size; indx++) {
|
||||
iter = hash->cells[indx];
|
||||
while (iter) {
|
||||
next = iter->next;
|
||||
nindx = iter->func % size;
|
||||
iter->next = cells[nindx];
|
||||
cells[nindx] = iter;
|
||||
iter = next;
|
||||
}
|
||||
}
|
||||
free(hash->cells);
|
||||
hash->size = size;
|
||||
hash->cells = cells;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef NO_MACROS
|
||||
LIBETPAN_EXPORT
|
||||
int chash_count(chash * hash) {
|
||||
return hash->count;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
int chash_size(chash * hash) {
|
||||
return hash->size;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void chash_value(chashiter * iter, chashdatum * result) {
|
||||
* result = iter->value;
|
||||
}
|
||||
|
||||
LIBETPAN_EXPORT
|
||||
void chash_key(chashiter * iter, chashdatum * result) {
|
||||
* result = iter->key;
|
||||
}
|
||||
#endif
|
|
@ -1,182 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* chash - Implements generic hash tables.
|
||||
*
|
||||
* Copyright (c) 1999-2005, Gaël Roualland <gael.roualland@iname.com>
|
||||
* interface changes - 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: chash.h,v 1.15 2006/03/22 08:10:47 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef CHASH_H
|
||||
#define CHASH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef LIBETPAN_CONFIG_H
|
||||
# include <libetpan/libetpan-config.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
void * data;
|
||||
unsigned int len;
|
||||
} chashdatum;
|
||||
|
||||
struct chash {
|
||||
unsigned int size;
|
||||
unsigned int count;
|
||||
int copyvalue;
|
||||
int copykey;
|
||||
struct chashcell ** cells;
|
||||
};
|
||||
|
||||
typedef struct chash chash;
|
||||
|
||||
struct chashcell {
|
||||
unsigned int func;
|
||||
chashdatum key;
|
||||
chashdatum value;
|
||||
struct chashcell * next;
|
||||
};
|
||||
|
||||
typedef struct chashcell chashiter;
|
||||
|
||||
#define CHASH_COPYNONE 0
|
||||
#define CHASH_COPYKEY 1
|
||||
#define CHASH_COPYVALUE 2
|
||||
#define CHASH_COPYALL (CHASH_COPYKEY | CHASH_COPYVALUE)
|
||||
|
||||
#define CHASH_DEFAULTSIZE 13
|
||||
|
||||
/* Allocates a new (empty) hash using this initial size and the given flags,
|
||||
specifying which data should be copied in the hash.
|
||||
CHASH_COPYNONE : Keys/Values are not copied.
|
||||
CHASH_COPYKEY : Keys are dupped and freed as needed in the hash.
|
||||
CHASH_COPYVALUE : Values are dupped and freed as needed in the hash.
|
||||
CHASH_COPYALL : Both keys and values are dupped in the hash.
|
||||
*/
|
||||
LIBETPAN_EXPORT
|
||||
chash * chash_new(unsigned int size, int flags);
|
||||
|
||||
/* Frees a hash */
|
||||
LIBETPAN_EXPORT
|
||||
void chash_free(chash * hash);
|
||||
|
||||
/* Removes all elements from a hash */
|
||||
LIBETPAN_EXPORT
|
||||
void chash_clear(chash * hash);
|
||||
|
||||
/* Adds an entry in the hash table.
|
||||
Length can be 0 if key/value are strings.
|
||||
If an entry already exists for this key, it is replaced, and its value
|
||||
is returned. Otherwise, the data pointer will be NULL and the length
|
||||
field be set to TRUE or FALSe to indicate success or failure. */
|
||||
LIBETPAN_EXPORT
|
||||
int chash_set(chash * hash,
|
||||
chashdatum * key,
|
||||
chashdatum * value,
|
||||
chashdatum * oldvalue);
|
||||
|
||||
/* Retrieves the data associated to the key if it is found in the hash table.
|
||||
The data pointer and the length will be NULL if not found*/
|
||||
LIBETPAN_EXPORT
|
||||
int chash_get(chash * hash,
|
||||
chashdatum * key, chashdatum * result);
|
||||
|
||||
/* Removes the entry associated to this key if it is found in the hash table,
|
||||
and returns its contents if not dupped (otherwise, pointer will be NULL
|
||||
and len TRUE). If entry is not found both pointer and len will be NULL. */
|
||||
LIBETPAN_EXPORT
|
||||
int chash_delete(chash * hash,
|
||||
chashdatum * key,
|
||||
chashdatum * oldvalue);
|
||||
|
||||
/* Resizes the hash table to the passed size. */
|
||||
LIBETPAN_EXPORT
|
||||
int chash_resize(chash * hash, unsigned int size);
|
||||
|
||||
/* Returns an iterator to the first non-empty entry of the hash table */
|
||||
LIBETPAN_EXPORT
|
||||
chashiter * chash_begin(chash * hash);
|
||||
|
||||
/* Returns the next non-empty entry of the hash table */
|
||||
LIBETPAN_EXPORT
|
||||
chashiter * chash_next(chash * hash, chashiter * iter);
|
||||
|
||||
/* Some of the following routines can be implemented as macros to
|
||||
be faster. If you don't want it, define NO_MACROS */
|
||||
#ifdef NO_MACROS
|
||||
/* Returns the size of the hash table */
|
||||
LIBETPAN_EXPORT
|
||||
unsigned int chash_size(chash * hash);
|
||||
|
||||
/* Returns the number of entries in the hash table */
|
||||
LIBETPAN_EXPORT
|
||||
unsigned int chash_count(chash * hash);
|
||||
|
||||
/* Returns the key part of the entry pointed by the iterator */
|
||||
LIBETPAN_EXPORT
|
||||
void chash_key(chashiter * iter, chashdatum * result);
|
||||
|
||||
/* Returns the value part of the entry pointed by the iterator */
|
||||
LIBETPAN_EXPORT
|
||||
void chash_value(chashiter * iter, chashdatum * result);
|
||||
|
||||
#else
|
||||
static inline unsigned int chash_size(chash * hash)
|
||||
{
|
||||
return hash->size;
|
||||
}
|
||||
|
||||
static inline unsigned int chash_count(chash * hash)
|
||||
{
|
||||
return hash->count;
|
||||
}
|
||||
|
||||
static inline void chash_key(chashiter * iter, chashdatum * result)
|
||||
{
|
||||
* result = iter->key;
|
||||
}
|
||||
|
||||
static inline void chash_value(chashiter * iter, chashdatum * result)
|
||||
{
|
||||
* result = iter->value;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,255 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: cinthash.c,v 1.9 2006/05/22 13:39:40 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef LIBETPAN_CONFIG_H
|
||||
# include "libetpan-config.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include "cinthash.h"
|
||||
|
||||
struct cinthash_list {
|
||||
unsigned long hash;
|
||||
void * data;
|
||||
struct cinthash_list * next;
|
||||
};
|
||||
|
||||
static struct cinthash_list HASH_LISTHEAD_NEW = { 0, NULL, NULL };
|
||||
|
||||
static inline int hash_list_add(cinthash_t * table,
|
||||
unsigned long hash, void * data)
|
||||
{
|
||||
struct cinthash_list * ht;
|
||||
int index;
|
||||
|
||||
index = hash % table->hashtable_size;
|
||||
|
||||
ht = malloc(sizeof(struct cinthash_list));
|
||||
if (ht == NULL)
|
||||
return -1;
|
||||
|
||||
ht->hash = hash;
|
||||
ht->data = data;
|
||||
ht->next = table->table[index].next;
|
||||
|
||||
table->table[index].next = ht;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void hash_list_free(struct cinthash_list * list)
|
||||
{
|
||||
struct cinthash_list * cur;
|
||||
struct cinthash_list * next;
|
||||
|
||||
next = list;
|
||||
while (next != NULL) {
|
||||
cur = next;
|
||||
next = cur->next;
|
||||
free(cur);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int hash_list_remove(cinthash_t * table, unsigned long hash)
|
||||
{
|
||||
struct cinthash_list * cur;
|
||||
int index;
|
||||
|
||||
index = hash % table->hashtable_size;
|
||||
|
||||
for(cur = &table->table[index] ; cur->next != NULL ; cur = cur->next) {
|
||||
if (cur->next->hash == hash) {
|
||||
struct cinthash_list * hash_data;
|
||||
|
||||
hash_data = cur->next;
|
||||
cur->next = cur->next->next;
|
||||
|
||||
free(hash_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline void * hash_list_find(cinthash_t * table, unsigned long hash)
|
||||
{
|
||||
struct cinthash_list * cur;
|
||||
int index;
|
||||
|
||||
index = hash % table->hashtable_size;
|
||||
|
||||
for(cur = table->table[index].next ; cur != NULL ; cur = cur->next) {
|
||||
if (cur->hash == hash)
|
||||
return cur->data;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cinthash_t * cinthash_new(unsigned long hashtable_size)
|
||||
{
|
||||
cinthash_t * ht;
|
||||
unsigned long i;
|
||||
|
||||
ht = malloc(sizeof(cinthash_t));
|
||||
if (ht == NULL)
|
||||
return NULL;
|
||||
|
||||
ht->table = malloc(sizeof(struct cinthash_list) * hashtable_size);
|
||||
if (ht->table == NULL)
|
||||
return NULL;
|
||||
|
||||
ht->hashtable_size = hashtable_size;
|
||||
ht->count = 0;
|
||||
|
||||
for(i = 0 ; i < hashtable_size ; i++)
|
||||
ht->table[i] = HASH_LISTHEAD_NEW;
|
||||
|
||||
return ht;
|
||||
}
|
||||
|
||||
void cinthash_free(cinthash_t * table)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
for(i = 0 ; i < table->hashtable_size ; i++)
|
||||
hash_list_free(table->table[i].next);
|
||||
|
||||
free(table->table);
|
||||
|
||||
free(table);
|
||||
}
|
||||
|
||||
int cinthash_add(cinthash_t * table, unsigned long hash, void * data)
|
||||
{
|
||||
int index;
|
||||
|
||||
index = hash % table->hashtable_size;
|
||||
|
||||
if (table->table[index].data == NULL) {
|
||||
table->table[index].hash = hash;
|
||||
table->table[index].data = data;
|
||||
table->table[index].next = NULL;
|
||||
|
||||
table->count ++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
int r;
|
||||
|
||||
r = hash_list_add(table, hash, data);
|
||||
if (r == -1)
|
||||
return -1;
|
||||
|
||||
table->count ++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int cinthash_remove(cinthash_t * table, unsigned long hash)
|
||||
{
|
||||
int index;
|
||||
|
||||
index = hash % table->hashtable_size;
|
||||
|
||||
if (table->table[index].hash == hash) {
|
||||
table->table[index].hash = 0;
|
||||
table->table[index].data = NULL;
|
||||
|
||||
table->count --;
|
||||
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
int r;
|
||||
|
||||
r = hash_list_remove(table, hash);
|
||||
|
||||
table->count --;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void * cinthash_find(cinthash_t * table, unsigned long hash)
|
||||
{
|
||||
int index;
|
||||
|
||||
index = hash % table->hashtable_size;
|
||||
|
||||
if (table->table[index].hash == hash)
|
||||
return table->table[index].data;
|
||||
|
||||
return hash_list_find(table, hash);
|
||||
}
|
||||
|
||||
void cinthash_foreach_key(cinthash_t * table,
|
||||
void (* func)(unsigned long, void *),
|
||||
void * data)
|
||||
{
|
||||
unsigned long index;
|
||||
struct cinthash_list * cur;
|
||||
|
||||
for(index = 0 ; index < table->hashtable_size ; index ++) {
|
||||
if (table->table[index].data != NULL) {
|
||||
func(table->table[index].hash, data);
|
||||
for(cur = table->table[index].next ; cur != NULL ; cur = cur->next)
|
||||
func(cur->hash, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cinthash_foreach_data(cinthash_t * table,
|
||||
void (* func)(void *, void *),
|
||||
void * data)
|
||||
{
|
||||
unsigned long index;
|
||||
struct cinthash_list * cur;
|
||||
|
||||
for(index = 0 ; index < table->hashtable_size ; index ++) {
|
||||
if (table->table[index].data != NULL) {
|
||||
func(table->table[index].data, data);
|
||||
for(cur = table->table[index].next ; cur != NULL ; cur = cur->next)
|
||||
func(cur->data, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: cinthash.h,v 1.6 2004/11/21 21:53:31 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef CINTHASH_H
|
||||
|
||||
#define CINTHASH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct cinthash_t {
|
||||
struct cinthash_list * table;
|
||||
unsigned long hashtable_size ;
|
||||
unsigned long count;
|
||||
} cinthash_t;
|
||||
|
||||
cinthash_t * cinthash_new(unsigned long hashtable_size);
|
||||
void cinthash_free(cinthash_t * table);
|
||||
|
||||
int cinthash_add(cinthash_t * table, unsigned long hash, void * data);
|
||||
int cinthash_remove(cinthash_t * table, unsigned long hash);
|
||||
void * cinthash_find(cinthash_t * table, unsigned long hash);
|
||||
|
||||
void cinthash_foreach_key(cinthash_t * table,
|
||||
void (* func)(unsigned long, void *),
|
||||
void * data);
|
||||
|
||||
void cinthash_foreach_data(cinthash_t * table,
|
||||
void (* fun)(void *, void *),
|
||||
void * data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,273 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* clist - Implements simple generic double-linked pointer lists
|
||||
*
|
||||
* Copyright (c) 1999-2005, Gaël Roualland <gael.roualland@iname.com>
|
||||
* interface changes - 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: clist.c,v 1.10 2006/05/22 13:39:40 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef LIBETPAN_CONFIG_H
|
||||
# include "libetpan-config.h"
|
||||
#endif
|
||||
|
||||
#include "clist.h"
|
||||
|
||||
clist * clist_new(void) {
|
||||
clist * lst;
|
||||
|
||||
lst = (clist *) malloc(sizeof(clist));
|
||||
if (!lst) return NULL;
|
||||
|
||||
lst->first = lst->last = NULL;
|
||||
lst->count = 0;
|
||||
|
||||
return lst;
|
||||
}
|
||||
|
||||
void clist_free(clist * lst) {
|
||||
clistcell * l1, * l2;
|
||||
|
||||
l1 = lst->first;
|
||||
while (l1) {
|
||||
l2 = l1->next;
|
||||
free(l1);
|
||||
l1 = l2;
|
||||
}
|
||||
|
||||
free(lst);
|
||||
}
|
||||
|
||||
#ifdef NO_MACROS
|
||||
int clist_isempty(clist * lst) {
|
||||
return ((lst->first==lst->last) && (lst->last==NULL));
|
||||
}
|
||||
|
||||
clistiter * clist_begin(clist * lst) {
|
||||
return lst->first;
|
||||
}
|
||||
|
||||
clistiter * clist_end(clist * lst) {
|
||||
return lst->last;
|
||||
}
|
||||
|
||||
clistiter * clist_next(clistiter * iter) {
|
||||
if (iter)
|
||||
return iter->next;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
clistiter * clist_previous(clistiter * iter) {
|
||||
if (iter)
|
||||
return iter->previous;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void * clist_content(clistiter * iter) {
|
||||
if (iter)
|
||||
return iter->data;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int clist_count(clist * lst) {
|
||||
return lst->count;
|
||||
}
|
||||
|
||||
int clist_prepend(clist * lst, void * data) {
|
||||
return clist_insert_before(lst, lst->first, data);
|
||||
}
|
||||
|
||||
int clist_append(clist * lst, void * data) {
|
||||
return clist_insert_after(lst, lst->last, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
int clist_insert_before(clist * lst, clistiter * iter, void * data) {
|
||||
clistcell * c;
|
||||
|
||||
c = (clistcell *) malloc(sizeof(clistcell));
|
||||
if (!c) return -1;
|
||||
|
||||
c->data = data;
|
||||
lst->count++;
|
||||
|
||||
if (clist_isempty(lst)) {
|
||||
c->previous = c->next = NULL;
|
||||
lst->first = lst->last = c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!iter) {
|
||||
c->previous = lst->last;
|
||||
c->previous->next = c;
|
||||
c->next = NULL;
|
||||
lst->last = c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
c->previous = iter->previous;
|
||||
c->next = iter;
|
||||
c->next->previous = c;
|
||||
if (c->previous)
|
||||
c->previous->next = c;
|
||||
else
|
||||
lst->first = c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int clist_insert_after(clist * lst, clistiter * iter, void * data) {
|
||||
clistcell * c;
|
||||
|
||||
c = (clistcell *) malloc(sizeof(clistcell));
|
||||
if (!c) return -1;
|
||||
|
||||
c->data = data;
|
||||
lst->count++;
|
||||
|
||||
if (clist_isempty(lst)) {
|
||||
c->previous = c->next = NULL;
|
||||
lst->first = lst->last = c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!iter) {
|
||||
c->previous = lst->last;
|
||||
c->previous->next = c;
|
||||
c->next = NULL;
|
||||
lst->last = c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
c->previous = iter;
|
||||
c->next = iter->next;
|
||||
if (c->next)
|
||||
c->next->previous = c;
|
||||
else
|
||||
lst->last = c;
|
||||
c->previous->next = c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
clistiter * clist_delete(clist * lst, clistiter * iter) {
|
||||
clistiter * ret;
|
||||
|
||||
if (!iter) return NULL;
|
||||
|
||||
if (iter->previous)
|
||||
iter->previous->next = iter->next;
|
||||
else
|
||||
lst->first = iter->next;
|
||||
|
||||
if (iter->next) {
|
||||
iter->next->previous = iter->previous;
|
||||
ret = iter->next;
|
||||
} else {
|
||||
lst->last = iter->previous;
|
||||
ret = NULL;
|
||||
}
|
||||
|
||||
free(iter);
|
||||
lst->count--;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void clist_foreach(clist * lst, clist_func func, void * data)
|
||||
{
|
||||
clistiter * cur;
|
||||
|
||||
for(cur = clist_begin(lst) ; cur != NULL ; cur = cur->next)
|
||||
func(cur->data, data);
|
||||
}
|
||||
|
||||
void clist_concat(clist * dest, clist * src)
|
||||
{
|
||||
if (src->first == NULL) {
|
||||
/* do nothing */
|
||||
}
|
||||
else if (dest->last == NULL) {
|
||||
dest->first = src->first;
|
||||
dest->last = src->last;
|
||||
}
|
||||
else {
|
||||
dest->last->next = src->first;
|
||||
src->first->previous = dest->last;
|
||||
dest->last = src->last;
|
||||
}
|
||||
|
||||
dest->count += src->count;
|
||||
src->last = src->first = NULL;
|
||||
}
|
||||
|
||||
static inline clistiter * internal_clist_nth(clist * lst, int index)
|
||||
{
|
||||
clistiter * cur;
|
||||
|
||||
cur = clist_begin(lst);
|
||||
while ((index > 0) && (cur != NULL)) {
|
||||
cur = cur->next;
|
||||
index --;
|
||||
}
|
||||
|
||||
if (cur == NULL)
|
||||
return NULL;
|
||||
|
||||
return cur;
|
||||
}
|
||||
|
||||
void * clist_nth_data(clist * lst, int index)
|
||||
{
|
||||
clistiter * cur;
|
||||
|
||||
cur = internal_clist_nth(lst, index);
|
||||
if (cur == NULL)
|
||||
return NULL;
|
||||
|
||||
return cur->data;
|
||||
}
|
||||
|
||||
clistiter * clist_nth(clist * lst, int index)
|
||||
{
|
||||
return internal_clist_nth(lst, index);
|
||||
}
|
|
@ -1,133 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* clist - Implements simple generic double-linked pointer lists
|
||||
*
|
||||
* Copyright (c) 1999-2005, Gaël Roualland <gael.roualland@iname.com>
|
||||
* interface changes - 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: clist.h,v 1.10 2006/05/22 13:39:40 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef CLIST_H
|
||||
#define CLIST_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct clistcell_s {
|
||||
void * data;
|
||||
struct clistcell_s * previous;
|
||||
struct clistcell_s * next;
|
||||
} clistcell;
|
||||
|
||||
struct clist_s {
|
||||
clistcell * first;
|
||||
clistcell * last;
|
||||
int count;
|
||||
};
|
||||
|
||||
typedef struct clist_s clist;
|
||||
typedef clistcell clistiter;
|
||||
|
||||
/* Allocate a new pointer list */
|
||||
clist * clist_new(void);
|
||||
|
||||
/* Destroys a list. Data pointed by data pointers is NOT freed. */
|
||||
void clist_free(clist *);
|
||||
|
||||
/* Some of the following routines can be implemented as macros to
|
||||
be faster. If you don't want it, define NO_MACROS */
|
||||
#ifdef NO_MACROS
|
||||
|
||||
/* Returns TRUE if list is empty */
|
||||
int clist_isempty(clist *);
|
||||
|
||||
/* Returns the number of elements in the list */
|
||||
int clist_count(clist *);
|
||||
|
||||
/* Returns an iterator to the first element of the list */
|
||||
clistiter * clist_begin(clist *);
|
||||
|
||||
/* Returns an iterator to the last element of the list */
|
||||
clistiter * clist_end(clist *);
|
||||
|
||||
/* Returns an iterator to the next element of the list */
|
||||
clistiter * clist_next(clistiter *);
|
||||
|
||||
/* Returns an iterator to the previous element of the list */
|
||||
clistiter * clist_previous(clistiter *);
|
||||
|
||||
/* Returns the data pointer of this element of the list */
|
||||
void* clist_content(clistiter *);
|
||||
|
||||
/* Inserts this data pointer at the beginning of the list */
|
||||
int clist_prepend(clist *, void *);
|
||||
|
||||
/* Inserts this data pointer at the end of the list */
|
||||
int clist_append(clist *, void *);
|
||||
#else
|
||||
#define clist_isempty(lst) ((lst->first==lst->last) && (lst->last==NULL))
|
||||
#define clist_count(lst) (lst->count)
|
||||
#define clist_begin(lst) (lst->first)
|
||||
#define clist_end(lst) (lst->last)
|
||||
#define clist_next(iter) (iter ? iter->next : NULL)
|
||||
#define clist_previous(iter) (iter ? iter->previous : NULL)
|
||||
#define clist_content(iter) (iter ? iter->data : NULL)
|
||||
#define clist_prepend(lst, data) (clist_insert_before(lst, lst->first, data))
|
||||
#define clist_append(lst, data) (clist_insert_after(lst, lst->last, data))
|
||||
#endif
|
||||
|
||||
/* Inserts this data pointer before the element pointed by the iterator */
|
||||
int clist_insert_before(clist *, clistiter *, void *);
|
||||
|
||||
/* Inserts this data pointer after the element pointed by the iterator */
|
||||
int clist_insert_after(clist *, clistiter *, void *);
|
||||
|
||||
/* Deletes the element pointed by the iterator.
|
||||
Returns an iterator to the next element. */
|
||||
clistiter * clist_delete(clist *, clistiter *);
|
||||
|
||||
typedef void (* clist_func)(void *, void *);
|
||||
|
||||
void clist_foreach(clist * lst, clist_func func, void * data);
|
||||
|
||||
void clist_concat(clist * dest, clist * src);
|
||||
|
||||
void * clist_nth_data(clist * lst, int index);
|
||||
|
||||
clistiter * clist_nth(clist * lst, int index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,141 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: connect.c,v 1.16 2006/07/15 12:24:26 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include "win_etpan.h"
|
||||
#else
|
||||
# include <netdb.h>
|
||||
# include <netinet/in.h>
|
||||
# include <sys/socket.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
uint16_t mail_get_service_port(const char * name, char * protocol)
|
||||
{
|
||||
struct servent * service;
|
||||
|
||||
service = getservbyname(name, protocol);
|
||||
|
||||
if (service == NULL)
|
||||
return 0;
|
||||
|
||||
return ntohs(service->s_port);
|
||||
}
|
||||
|
||||
int mail_tcp_connect(const char * server, uint16_t port)
|
||||
{
|
||||
#ifndef HAVE_IPV6
|
||||
struct hostent * remotehost;
|
||||
struct sockaddr_in sa;
|
||||
#else /* HAVE_IPV6 */
|
||||
struct addrinfo hints, *res, *ai;
|
||||
char port_str[6];
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
SOCKET s;
|
||||
#else
|
||||
int s;
|
||||
#endif
|
||||
int r;
|
||||
|
||||
#ifndef HAVE_IPV6
|
||||
s = socket(PF_INET, SOCK_STREAM, 0);
|
||||
if (s == -1)
|
||||
goto err;
|
||||
|
||||
remotehost = gethostbyname(server);
|
||||
if (remotehost == NULL)
|
||||
goto close_socket;
|
||||
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = htons(port);
|
||||
memcpy(&sa.sin_addr, remotehost->h_addr, remotehost->h_length);
|
||||
|
||||
r = connect(s, (struct sockaddr *) &sa, sizeof(struct sockaddr_in));
|
||||
if (r == -1)
|
||||
goto close_socket;
|
||||
#else /* HAVE_IPV6 */
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
|
||||
/* convert port from integer to string. */
|
||||
snprintf(port_str, sizeof(port_str), "%d", port);
|
||||
|
||||
if (getaddrinfo(server, port_str, &hints, &res) != 0)
|
||||
goto err;
|
||||
|
||||
for (ai = res; ai != NULL; ai = ai->ai_next) {
|
||||
s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if (s == -1)
|
||||
continue;
|
||||
|
||||
r = connect(s, ai->ai_addr, ai->ai_addrlen);
|
||||
if (r == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (res != NULL)
|
||||
freeaddrinfo(res);
|
||||
|
||||
if (ai == NULL)
|
||||
goto err;
|
||||
#endif
|
||||
|
||||
return s;
|
||||
|
||||
#ifndef HAVE_IPV6
|
||||
close_socket:
|
||||
#ifdef WIN32
|
||||
closesocket(s);
|
||||
#else
|
||||
close(s);
|
||||
#endif
|
||||
#endif
|
||||
err:
|
||||
return -1;
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: connect.h,v 1.15 2006/05/22 13:39:40 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef CONNECT_H
|
||||
|
||||
#define CONNECT_H
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
uint16_t mail_get_service_port(const char * name, char * protocol);
|
||||
int mail_tcp_connect(const char * server, uint16_t port);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* hmac-md5.h -- HMAC_MD5 functions
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: hmac-md5.h,v 1.4 2004/11/21 21:53:31 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef HMAC_MD5_H
|
||||
#define HMAC_MD5_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define HMAC_MD5_SIZE 16
|
||||
|
||||
/* intermediate MD5 context */
|
||||
typedef struct HMAC_MD5_CTX_s {
|
||||
MD5_CTX ictx, octx;
|
||||
} HMAC_MD5_CTX;
|
||||
|
||||
/* intermediate HMAC state
|
||||
* values stored in network byte order (Big Endian)
|
||||
*/
|
||||
typedef struct HMAC_MD5_STATE_s {
|
||||
UINT4 istate[4];
|
||||
UINT4 ostate[4];
|
||||
} HMAC_MD5_STATE;
|
||||
|
||||
/* One step hmac computation
|
||||
*
|
||||
* digest may be same as text or key
|
||||
*/
|
||||
void hmac_md5(const unsigned char *text, int text_len,
|
||||
const unsigned char *key, int key_len,
|
||||
unsigned char digest[HMAC_MD5_SIZE]);
|
||||
|
||||
/* create context from key
|
||||
*/
|
||||
void hmac_md5_init(HMAC_MD5_CTX *hmac,
|
||||
const unsigned char *key, int key_len);
|
||||
|
||||
/* precalculate intermediate state from key
|
||||
*/
|
||||
void hmac_md5_precalc(HMAC_MD5_STATE *hmac,
|
||||
const unsigned char *key, int key_len);
|
||||
|
||||
/* initialize context from intermediate state
|
||||
*/
|
||||
void hmac_md5_import(HMAC_MD5_CTX *hmac, HMAC_MD5_STATE *state);
|
||||
|
||||
#define hmac_md5_update(hmac, text, text_len) MD5Update(&(hmac)->ictx, (text), (text_len))
|
||||
|
||||
/* finish hmac from intermediate result. Intermediate result is zeroed.
|
||||
*/
|
||||
void hmac_md5_final(unsigned char digest[HMAC_MD5_SIZE],
|
||||
HMAC_MD5_CTX *hmac);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HMAC_MD5_H */
|
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: mail.h,v 1.8 2004/11/21 21:53:31 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef MAIL_H
|
||||
|
||||
#define MAIL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,500 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: mail_cache_db.c,v 1.20 2006/05/22 13:39:40 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "mail_cache_db.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libetpan-config.h"
|
||||
|
||||
#include "maillock.h"
|
||||
|
||||
#if DBVERS >= 1
|
||||
#include <db.h>
|
||||
#endif
|
||||
|
||||
#if DBVERS >= 1
|
||||
static struct mail_cache_db * mail_cache_db_new(DB * db)
|
||||
{
|
||||
struct mail_cache_db * cache_db;
|
||||
|
||||
cache_db = malloc(sizeof(* cache_db));
|
||||
if (cache_db == NULL)
|
||||
return NULL;
|
||||
cache_db->internal_database = db;
|
||||
|
||||
return cache_db;
|
||||
}
|
||||
|
||||
static void mail_cache_db_free(struct mail_cache_db * cache_db)
|
||||
{
|
||||
free(cache_db);
|
||||
}
|
||||
#endif
|
||||
|
||||
int mail_cache_db_open(const char * filename,
|
||||
struct mail_cache_db ** pcache_db)
|
||||
{
|
||||
#if DBVERS >= 1
|
||||
DB * dbp;
|
||||
#if DBVERS > 1
|
||||
int r;
|
||||
#endif
|
||||
struct mail_cache_db * cache_db;
|
||||
|
||||
#if DB_VERSION_MAJOR >= 3
|
||||
r = db_create(&dbp, NULL, 0);
|
||||
if (r != 0)
|
||||
goto err;
|
||||
|
||||
#if (DB_VERSION_MAJOR >= 4) && ((DB_VERSION_MAJOR > 4) || (DB_VERSION_MINOR >= 1))
|
||||
r = dbp->open(dbp, NULL, filename, NULL, DB_BTREE, DB_CREATE,
|
||||
S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
r = dbp->open(dbp, filename, NULL, DB_BTREE, DB_CREATE, S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
if (r != 0)
|
||||
goto close_db;
|
||||
#else
|
||||
#if DBVERS > 1
|
||||
r = db_open(filename, DB_BTREE, DB_CREATE, S_IRUSR | S_IWUSR,
|
||||
NULL, NULL, &dbp);
|
||||
if (r != 0)
|
||||
goto err;
|
||||
#elif DBVERS == 1
|
||||
dbp = dbopen(filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, DB_BTREE, NULL);
|
||||
if (dbp == NULL)
|
||||
goto err;
|
||||
#else
|
||||
goto err;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
cache_db = mail_cache_db_new(dbp);
|
||||
if (cache_db == NULL)
|
||||
goto close_db;
|
||||
|
||||
* pcache_db = cache_db;
|
||||
|
||||
return 0;
|
||||
|
||||
close_db:
|
||||
#if DBVERS > 1
|
||||
dbp->close(dbp, 0);
|
||||
#elif DBVERS == 1
|
||||
dbp->close(dbp);
|
||||
#endif
|
||||
err:
|
||||
return -1;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void mail_cache_db_close(struct mail_cache_db * cache_db)
|
||||
{
|
||||
#if DBVERS >= 1
|
||||
DB * dbp;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
#if DBVERS > 1
|
||||
dbp->close(cache_db->internal_database, 0);
|
||||
#elif DBVERS == 1
|
||||
dbp->close(cache_db->internal_database);
|
||||
#endif
|
||||
|
||||
mail_cache_db_free(cache_db);
|
||||
#endif
|
||||
}
|
||||
|
||||
int mail_cache_db_open_lock(const char * filename,
|
||||
struct mail_cache_db ** pcache_db)
|
||||
{
|
||||
int r;
|
||||
struct mail_cache_db * cache_db;
|
||||
|
||||
r = maillock_write_lock(filename, -1);
|
||||
if (r < 0)
|
||||
goto err;
|
||||
|
||||
r = mail_cache_db_open(filename, &cache_db);
|
||||
if (r < 0)
|
||||
goto unlock;
|
||||
|
||||
* pcache_db = cache_db;
|
||||
|
||||
return 0;
|
||||
|
||||
unlock:
|
||||
maillock_write_unlock(filename, -1);
|
||||
err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
void mail_cache_db_close_unlock(const char * filename,
|
||||
struct mail_cache_db * cache_db)
|
||||
{
|
||||
mail_cache_db_close(cache_db);
|
||||
maillock_write_unlock(filename, -1);
|
||||
}
|
||||
|
||||
|
||||
int mail_cache_db_put(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len, const void * value, size_t value_len)
|
||||
{
|
||||
#if DBVERS >= 1
|
||||
int r;
|
||||
DBT db_key;
|
||||
DBT db_data;
|
||||
DB * dbp;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
memset(&db_data, 0, sizeof(db_data));
|
||||
db_key.data = (void *) key;
|
||||
db_key.size = key_len;
|
||||
db_data.data = (void *) value;
|
||||
db_data.size = value_len;
|
||||
|
||||
#if DBVERS > 1
|
||||
r = dbp->put(dbp, NULL, &db_key, &db_data, 0);
|
||||
#elif DBVERS == 1
|
||||
r = dbp->put(dbp, &db_key, &db_data, 0);
|
||||
#else
|
||||
r = -1;
|
||||
#endif
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int mail_cache_db_get(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len, void ** pvalue, size_t * pvalue_len)
|
||||
{
|
||||
#if DBVERS >= 1
|
||||
int r;
|
||||
DBT db_key;
|
||||
DBT db_data;
|
||||
DB * dbp;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
memset(&db_data, 0, sizeof(db_data));
|
||||
db_key.data = (void *) key;
|
||||
db_key.size = key_len;
|
||||
|
||||
#if DBVERS > 1
|
||||
r = dbp->get(dbp, NULL, &db_key, &db_data, 0);
|
||||
#elif DBVERS == 1
|
||||
r = dbp->get(dbp, &db_key, &db_data, 0);
|
||||
#else
|
||||
r = -1;
|
||||
#endif
|
||||
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
* pvalue = db_data.data;
|
||||
* pvalue_len = db_data.size;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int mail_cache_db_del(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len)
|
||||
{
|
||||
#if DBVERS >= 1
|
||||
int r;
|
||||
DBT db_key;
|
||||
DB * dbp;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
db_key.data = (void *) key;
|
||||
db_key.size = key_len;
|
||||
|
||||
#if DBVERS > 1
|
||||
r = dbp->del(dbp, NULL, &db_key, 0);
|
||||
#elif DBVERS == 1
|
||||
r = dbp->del(dbp, &db_key, 0);
|
||||
#else
|
||||
r = -1;
|
||||
#endif
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if DBVERS > 1
|
||||
int mail_cache_db_clean_up(struct mail_cache_db * cache_db,
|
||||
chash * exist)
|
||||
{
|
||||
DB * dbp;
|
||||
int r;
|
||||
DBC * dbcp;
|
||||
DBT db_key;
|
||||
DBT db_data;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 6
|
||||
r = dbp->cursor(dbp, NULL, &dbcp);
|
||||
#else
|
||||
r = dbp->cursor(dbp, NULL, &dbcp, 0);
|
||||
#endif
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
memset(&db_data, 0, sizeof(db_data));
|
||||
|
||||
while (1) {
|
||||
chashdatum hash_key;
|
||||
chashdatum hash_data;
|
||||
|
||||
r = dbcp->c_get(dbcp, &db_key, &db_data, DB_NEXT);
|
||||
if (r != 0)
|
||||
break;
|
||||
|
||||
hash_key.data = db_key.data;
|
||||
hash_key.len = db_key.size;
|
||||
|
||||
r = chash_get(exist, &hash_key, &hash_data);
|
||||
if (r < 0) {
|
||||
r = dbcp->c_del(dbcp, 0);
|
||||
if (r != 0)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
r = dbcp->c_close(dbcp);
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#elif DBVERS == 1
|
||||
int mail_cache_db_clean_up(struct mail_cache_db * cache_db,
|
||||
chash * exist)
|
||||
{
|
||||
DB * dbp;
|
||||
int r;
|
||||
DBT db_key;
|
||||
DBT db_data;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
r = dbp->seq(dbp, &db_key, &db_data, R_FIRST);
|
||||
if (r == -1)
|
||||
return -1;
|
||||
|
||||
while (r == 0) {
|
||||
chashdatum hash_key;
|
||||
chashdatum hash_data;
|
||||
|
||||
hash_key.data = db_key.data;
|
||||
hash_key.len = db_key.size;
|
||||
|
||||
r = chash_get(exist, &hash_key, &hash_data);
|
||||
if (r < 0) {
|
||||
r = dbp->del(dbp, &db_key, 0);
|
||||
if (r != 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
r = dbp->seq(dbp, &db_key, &db_data, R_NEXT);
|
||||
if (r < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int mail_cache_db_clean_up(struct mail_cache_db * cache_db,
|
||||
chash * exist)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int mail_cache_db_get_size(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len, size_t * pvalue_len)
|
||||
{
|
||||
#if DBVERS >= 1
|
||||
int r;
|
||||
DBT db_key;
|
||||
DBT db_data;
|
||||
DB * dbp;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
memset(&db_data, 0, sizeof(db_data));
|
||||
db_key.data = (void *) key;
|
||||
db_key.size = key_len;
|
||||
#if DBVERS > 1
|
||||
db_data.flags = DB_DBT_USERMEM;
|
||||
db_data.ulen = 0;
|
||||
#endif
|
||||
|
||||
#if DBVERS > 1
|
||||
r = dbp->get(dbp, NULL, &db_key, &db_data, 0);
|
||||
#elif DBVERS == 1
|
||||
r = dbp->get(dbp, &db_key, &db_data, 0);
|
||||
#else
|
||||
r = -1;
|
||||
#endif
|
||||
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
* pvalue_len = db_data.size;
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if DBVERS > 1
|
||||
int mail_cache_db_get_keys(struct mail_cache_db * cache_db,
|
||||
chash * keys)
|
||||
{
|
||||
DB * dbp;
|
||||
int r;
|
||||
DBC * dbcp;
|
||||
DBT db_key;
|
||||
DBT db_data;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
r = dbp->cursor(dbp, NULL, &dbcp, 0);
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
memset(&db_data, 0, sizeof(db_data));
|
||||
|
||||
while (1) {
|
||||
chashdatum hash_key;
|
||||
chashdatum hash_data;
|
||||
|
||||
r = dbcp->c_get(dbcp, &db_key, &db_data, DB_NEXT);
|
||||
if (r != 0)
|
||||
break;
|
||||
|
||||
hash_key.data = db_key.data;
|
||||
hash_key.len = db_key.size;
|
||||
hash_data.data = NULL;
|
||||
hash_data.len = 0;
|
||||
|
||||
r = chash_set(keys, &hash_key, &hash_data, NULL);
|
||||
if (r < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
r = dbcp->c_close(dbcp);
|
||||
if (r != 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#elif DBVERS == 1
|
||||
int mail_cache_db_get_keys(struct mail_cache_db * cache_db,
|
||||
chash * keys)
|
||||
{
|
||||
DB * dbp;
|
||||
int r;
|
||||
DBT db_key;
|
||||
DBT db_data;
|
||||
|
||||
dbp = cache_db->internal_database;
|
||||
|
||||
r = dbp->seq(dbp, &db_key, &db_data, R_FIRST);
|
||||
if (r == -1)
|
||||
return -1;
|
||||
|
||||
while (r == 0) {
|
||||
chashdatum hash_key;
|
||||
chashdatum hash_data;
|
||||
|
||||
hash_key.data = db_key.data;
|
||||
hash_key.len = db_key.size;
|
||||
hash_data.data = NULL;
|
||||
hash_data.len = 0;
|
||||
|
||||
r = chash_set(keys, &hash_key, &hash_data, NULL);
|
||||
if (r < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
r = dbp->seq(dbp, &db_key, &db_data, R_NEXT);
|
||||
if (r < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int mail_cache_db_get_keys(struct mail_cache_db * cache_db,
|
||||
chash * keys)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif
|
|
@ -1,158 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: mail_cache_db.h,v 1.6 2005/04/07 00:05:25 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef MAIL_CACHE_DB_H
|
||||
|
||||
#define MAIL_CACHE_DB_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "mail_cache_db_types.h"
|
||||
#include "chash.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
this module will handle a database "f(key) -> value" in a file
|
||||
|
||||
berkeley DB or other can be used for implementation of low-level file.
|
||||
*/
|
||||
|
||||
/*
|
||||
mail_cache_db_open()
|
||||
|
||||
This function opens the file "filename".
|
||||
The pointer return in pcache_db should be used for further references
|
||||
to the database.
|
||||
*/
|
||||
|
||||
int mail_cache_db_open(const char * filename,
|
||||
struct mail_cache_db ** pcache_db);
|
||||
|
||||
/*
|
||||
mail_cache_db_close()
|
||||
|
||||
This function closes the opened database.
|
||||
The pointer cannot be used later.
|
||||
*/
|
||||
|
||||
void mail_cache_db_close(struct mail_cache_db * cache_db);
|
||||
|
||||
/*
|
||||
mail_cache_db_open_lock()
|
||||
|
||||
This function opens and locks the file "filename".
|
||||
The pointer return in pcache_db should be used for further references
|
||||
to the database.
|
||||
*/
|
||||
|
||||
int mail_cache_db_open_lock(const char * filename,
|
||||
struct mail_cache_db ** pcache_db);
|
||||
|
||||
/*
|
||||
mail_cache_db_open_unlock()
|
||||
|
||||
This function closes and unlocks the opened database.
|
||||
The pointer cannot be used later.
|
||||
*/
|
||||
|
||||
void mail_cache_db_close_unlock(const char * filename,
|
||||
struct mail_cache_db * cache_db);
|
||||
|
||||
/*
|
||||
mail_cache_db_put()
|
||||
|
||||
This function will store a given key and value in the database.
|
||||
*/
|
||||
|
||||
int mail_cache_db_put(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len, const void * value, size_t value_len);
|
||||
|
||||
/*
|
||||
mail_cache_db_get()
|
||||
|
||||
This function will retrieve the value corresponding to a given key
|
||||
from the database.
|
||||
*/
|
||||
|
||||
int mail_cache_db_get(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len, void ** pvalue, size_t * pvalue_len);
|
||||
|
||||
/*
|
||||
mail_cache_db_get_size()
|
||||
|
||||
This function will retrieve the size of the value corresponding
|
||||
to a given key from the database.
|
||||
*/
|
||||
|
||||
int mail_cache_db_get_size(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len, size_t * pvalue_len);
|
||||
|
||||
/*
|
||||
mail_cache_db_del()
|
||||
|
||||
This function will delete the given key and the corresponding value
|
||||
from the database.
|
||||
*/
|
||||
|
||||
int mail_cache_db_del(struct mail_cache_db * cache_db,
|
||||
const void * key, size_t key_len);
|
||||
|
||||
/*
|
||||
mail_cache_clean_up()
|
||||
|
||||
This function will delete the key all the key/value pairs of the
|
||||
database file which key does not exist in the given hash.
|
||||
*/
|
||||
|
||||
int mail_cache_db_clean_up(struct mail_cache_db * cache_db,
|
||||
chash * exist);
|
||||
|
||||
/*
|
||||
mail_cache_db_get_keys()
|
||||
|
||||
This function will get all keys of the database and will
|
||||
store them to the given chash.
|
||||
*/
|
||||
|
||||
int mail_cache_db_get_keys(struct mail_cache_db * cache_db,
|
||||
chash * keys);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: mail_cache_db_types.h,v 1.2 2004/11/21 21:53:31 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef MAIL_CACHE_DB_TYPES_H
|
||||
|
||||
#define MAIL_CACHE_DB_TYPES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct mail_cache_db {
|
||||
void * internal_database;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,356 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: maillock.c,v 1.15 2006/08/05 02:34:06 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "maillock.h"
|
||||
|
||||
#include "libetpan-config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#ifdef _MSC_VER
|
||||
# include "win_etpan.h"
|
||||
#endif
|
||||
#ifdef HAVE_LIBLOCKFILE
|
||||
#include <lockfile.h>
|
||||
#endif
|
||||
|
||||
/* ********************************************************************** */
|
||||
|
||||
/* lock primitives */
|
||||
|
||||
/* the lock code is modified from the dot lock file code from mail.local.c */
|
||||
|
||||
/*
|
||||
SENDMAIL LICENSE
|
||||
|
||||
The following license terms and conditions apply, unless a different
|
||||
license is obtained from Sendmail, Inc., 6425 Christie Ave, Fourth Floor,
|
||||
Emeryville, CA 94608, or by electronic mail at license@sendmail.com.
|
||||
|
||||
License Terms:
|
||||
|
||||
Use, Modification and Redistribution (including distribution of any
|
||||
modified or derived work) in source and binary forms is permitted only if
|
||||
each of the following conditions is met:
|
||||
|
||||
1. Redistributions qualify as "freeware" or "Open Source Software" under
|
||||
one of the following terms:
|
||||
|
||||
(a) Redistributions are made at no charge beyond the reasonable cost of
|
||||
materials and delivery.
|
||||
|
||||
(b) Redistributions are accompanied by a copy of the Source Code or by an
|
||||
irrevocable offer to provide a copy of the Source Code for up to three
|
||||
years at the cost of materials and delivery. Such redistributions
|
||||
must allow further use, modification, and redistribution of the Source
|
||||
Code under substantially the same terms as this license. For the
|
||||
purposes of redistribution "Source Code" means the complete compilable
|
||||
and linkable source code of sendmail including all modifications.
|
||||
|
||||
2. Redistributions of source code must retain the copyright notices as they
|
||||
appear in each source code file, these license terms, and the
|
||||
disclaimer/limitation of liability set forth as paragraph 6 below.
|
||||
|
||||
3. Redistributions in binary form must reproduce the Copyright Notice,
|
||||
these license terms, and the disclaimer/limitation of liability set
|
||||
forth as paragraph 6 below, in the documentation and/or other materials
|
||||
provided with the distribution. For the purposes of binary distribution
|
||||
the "Copyright Notice" refers to the following language:
|
||||
"Copyright (c) 1998-2002 Sendmail, Inc. All rights reserved."
|
||||
|
||||
4. Neither the name of Sendmail, Inc. nor the University of California nor
|
||||
the names of their contributors may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission. The name "sendmail" is a trademark of Sendmail, Inc.
|
||||
|
||||
5. All redistributions must comply with the conditions imposed by the
|
||||
University of California on certain embedded code, whose copyright
|
||||
notice and conditions for redistribution are as follows:
|
||||
|
||||
(a) Copyright (c) 1988, 1993 The Regents of the University of
|
||||
California. All rights reserved.
|
||||
|
||||
(b) Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
(i) Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
(ii) Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
(iii) Neither the name of the University nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
6. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY
|
||||
SENDMAIL, INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
NO EVENT SHALL SENDMAIL, INC., THE REGENTS OF THE UNIVERSITY OF
|
||||
CALIFORNIA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
/*
|
||||
TODO : lock, prefer fcntl() over flock()
|
||||
AND use dotlock code above
|
||||
*/
|
||||
|
||||
#define LOCKTO_RM 300 /* timeout for stale lockfile removal */
|
||||
#define LOCKTO_GLOB 400 /* global timeout for lockfile creation */
|
||||
|
||||
#ifdef WIN32
|
||||
# define F_RDLCK 0
|
||||
# define F_WRLCK 1
|
||||
# include <sys/locking.h>
|
||||
#endif
|
||||
|
||||
static int lock_common(const char * filename, int fd, short locktype)
|
||||
{
|
||||
#ifdef WIN32
|
||||
time_t start;
|
||||
|
||||
/* SEB try implementation */
|
||||
if (fd != -1) {
|
||||
lseek( fd, 0L, SEEK_SET );
|
||||
if (_locking( fd, _LK_NBLCK, LONG_MAX) == 0) return 0;
|
||||
|
||||
time(&start);
|
||||
|
||||
while (1) {
|
||||
time_t now;
|
||||
sleep( 5);
|
||||
if (_locking( fd, _LK_NBLCK, LONG_MAX) == 0) return 0;
|
||||
time(&now);
|
||||
if (now > start + LOCKTO_GLOB) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
char lockfilename[PATH_MAX];
|
||||
#ifndef HAVE_LIBLOCKFILE
|
||||
struct flock lock;
|
||||
/* dot lock file */
|
||||
int statfailed = 0;
|
||||
time_t start;
|
||||
int r;
|
||||
#endif
|
||||
int res;
|
||||
|
||||
/* dot lock file */
|
||||
|
||||
if (strlen(filename) + 6 > PATH_MAX) {
|
||||
res = -1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
snprintf(lockfilename, PATH_MAX, "%s.lock", filename);
|
||||
|
||||
#ifdef HAVE_LIBLOCKFILE
|
||||
return lockfile_create(lockfilename, LOCKTO_GLOB, 0);
|
||||
#else
|
||||
|
||||
if (fd != -1) {
|
||||
lock.l_start = 0;
|
||||
lock.l_len = 0;
|
||||
lock.l_pid = getpid();
|
||||
lock.l_type = locktype;
|
||||
lock.l_whence = SEEK_SET;
|
||||
|
||||
r = fcntl(fd, F_SETLKW, &lock);
|
||||
if (r < 0) {
|
||||
/* WARNING POSIX lock could not be applied */
|
||||
}
|
||||
}
|
||||
|
||||
time(&start);
|
||||
while (1) {
|
||||
int fd;
|
||||
struct stat st;
|
||||
time_t now;
|
||||
|
||||
/* global timeout */
|
||||
time(&now);
|
||||
if (now > start + LOCKTO_GLOB) {
|
||||
res = -1;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
fd = open(lockfilename, O_WRONLY|O_EXCL|O_CREAT, 0);
|
||||
if (fd >= 0) {
|
||||
/* defeat lock checking programs which test pid */
|
||||
write(fd, "0", 2);
|
||||
close(fd);
|
||||
break;
|
||||
}
|
||||
|
||||
/* libEtPan! - adds a delay of 5 seconds between each tries */
|
||||
sleep(5);
|
||||
|
||||
if (stat(lockfilename, &st) < 0) {
|
||||
if (statfailed++ > 5) {
|
||||
res = -1;
|
||||
goto unlock;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
statfailed = 0;
|
||||
time(&now);
|
||||
|
||||
if (now < st.st_ctime + LOCKTO_RM)
|
||||
continue;
|
||||
|
||||
/* try to remove stale lockfile */
|
||||
if (unlink(lockfilename) < 0) {
|
||||
res = -1;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/*
|
||||
libEtPan! - removes this delay of 5 seconds,
|
||||
maybe it was misplaced ?
|
||||
*/
|
||||
#if 0
|
||||
sleep(5);
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
unlock:
|
||||
if (fd != -1) {
|
||||
lock.l_start = 0;
|
||||
lock.l_len = 0;
|
||||
lock.l_pid = getpid();
|
||||
lock.l_type = F_UNLCK;
|
||||
lock.l_whence = SEEK_SET;
|
||||
|
||||
r = fcntl(fd, F_SETLK, &lock);
|
||||
if (r < 0) {
|
||||
/* WARNING POSIX lock could not be applied */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
err:
|
||||
return res;
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
static int unlock_common(const char * filename, int fd)
|
||||
{
|
||||
/* SEB */
|
||||
#ifdef WIN32
|
||||
if (fd != -1) {
|
||||
lseek( fd, 0L, SEEK_SET );
|
||||
_locking( fd, _LK_UNLCK, LONG_MAX);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
char lockfilename[PATH_MAX];
|
||||
#ifndef HAVE_LIBLOCKFILE
|
||||
struct flock lock;
|
||||
int r;
|
||||
#endif
|
||||
|
||||
if (strlen(filename) + 6 > PATH_MAX)
|
||||
return -1;
|
||||
|
||||
snprintf(lockfilename, PATH_MAX, "%s.lock", filename);
|
||||
|
||||
#ifdef HAVE_LIBLOCKFILE
|
||||
return lockfile_remove(lockfilename);
|
||||
#else
|
||||
|
||||
unlink(lockfilename);
|
||||
|
||||
if (fd != -1) {
|
||||
lock.l_start = 0;
|
||||
lock.l_len = 0;
|
||||
lock.l_pid = getpid();
|
||||
lock.l_type = F_UNLCK;
|
||||
lock.l_whence = SEEK_SET;
|
||||
|
||||
r = fcntl(fd, F_SETLK, &lock);
|
||||
if (r < 0) {
|
||||
/* WARNING POSIX lock could not be applied */
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
int maillock_read_lock(const char * filename, int fd)
|
||||
{
|
||||
return lock_common(filename, fd, F_RDLCK);
|
||||
}
|
||||
|
||||
int maillock_read_unlock(const char * filename, int fd)
|
||||
{
|
||||
return unlock_common(filename, fd);
|
||||
}
|
||||
|
||||
int maillock_write_lock(const char * filename, int fd)
|
||||
{
|
||||
return lock_common(filename, fd, F_WRLCK);
|
||||
}
|
||||
|
||||
int maillock_write_unlock(const char * filename, int fd)
|
||||
{
|
||||
return unlock_common(filename, fd);
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
/*
|
||||
* libEtPan! -- a mail stuff library
|
||||
*
|
||||
* Copyright (C) 2001, 2005 - DINH Viet Hoa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the libEtPan! project nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: maillock.h,v 1.5 2004/11/21 21:53:31 hoa Exp $
|
||||
*/
|
||||
|
||||
#ifndef MAILLOCK_H
|
||||
|
||||
#define MAILLOCK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int maillock_read_lock(const char * filename, int fd);
|
||||
int maillock_read_unlock(const char * filename, int fd);
|
||||
int maillock_write_lock(const char * filename, int fd);
|
||||
int maillock_write_unlock(const char * filename, int fd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "mailsasl.h"
|
||||
|
||||
#ifdef USE_SASL
|
||||
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include <sasl/sasl.h>
|
||||
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
static pthread_mutex_t sasl_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
#endif
|
||||
static int sasl_use_count = 0;
|
||||
|
||||
void mailsasl_external_ref(void)
|
||||
{
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
pthread_mutex_lock(&sasl_lock);
|
||||
#endif
|
||||
sasl_use_count ++;
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
pthread_mutex_unlock(&sasl_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
void mailsasl_ref(void)
|
||||
{
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
pthread_mutex_lock(&sasl_lock);
|
||||
#endif
|
||||
sasl_use_count ++;
|
||||
if (sasl_use_count == 1)
|
||||
sasl_client_init(NULL);
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
pthread_mutex_unlock(&sasl_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
void mailsasl_unref(void)
|
||||
{
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
pthread_mutex_lock(&sasl_lock);
|
||||
#endif
|
||||
sasl_use_count --;
|
||||
if (sasl_use_count == 0) {
|
||||
sasl_done();
|
||||
}
|
||||
#ifdef LIBETPAN_REENTRANT
|
||||
pthread_mutex_unlock(&sasl_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void mailsasl_external_ref(void)
|
||||
{
|
||||
}
|
||||
|
||||
void mailsasl_ref(void)
|
||||
{
|
||||
}
|
||||
|
||||
void mailsasl_unref(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue