correction to English
[claws.git] / src / ldif.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 2001 Match Grun
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Definitions necessary to access VCard files. VCard files are used
22  * by GnomeCard for addressbook, and Netscape for sending business
23  * card information. Refer to RFC2426 for more information.
24  */
25
26 #ifndef __LDIF_H__
27 #define __LDIF_H__
28
29 #include <stdio.h>
30 #include <glib.h>
31
32 #include "addritem.h"
33 #include "addrcache.h"
34
35 #define LDIFBUFSIZE         2048
36
37 #define LDIF_TAG_COMMONNAME "cn"
38 #define LDIF_TAG_FIRSTNAME  "givenname"
39 #define LDIF_TAG_LASTNAME   "sn"
40 #define LDIF_TAG_NICKNAME   "xmozillanickname"
41 #define LDIF_TAG_EMAIL      "mail"
42
43 #define LDIF_SEP_TAG        ':'
44
45 /*
46 // Typical LDIF entry (similar to that generated by Netscape):
47 //
48 // dn: uid=axel, dc=axel, dc=com
49 // cn: Axel Rose
50 // sn: Rose
51 // givenname: Arnold
52 // xmozillanickname: Axel
53 // mail: axel@axelrose.com
54 // mail: axelrose@aol.com
55 // mail: axel@netscape.net
56 // mail: axel@hotmail.com
57 // uid: axelrose
58 // o: The Company
59 // locality: Denver
60 // st: CO
61 // streetaddress: 777 Lexington Avenue
62 // postalcode: 80298
63 // countryname: USA
64 // telephonenumber: 303-555-1234
65 // homephone: 303-555-2345
66 // cellphone: 303-555-3456
67 // homeurl: http://www.axelrose.com
68 // objectclass: top
69 // objectclass: person
70 //
71 // Note that first entry is always dn. Empty line defines end of record.
72 //
73 */
74
75 /* VCard object */
76 typedef struct _LdifFile LdifFile;
77 struct _LdifFile {
78         FILE         *file;
79         gchar        *path;
80         gchar        *bufptr;
81         gchar        buffer[ LDIFBUFSIZE ];
82         // AddressCache *addressCache;
83         gint         retVal;
84 };
85
86 /* Function prototypes */
87 LdifFile *ldif_create   ( void );
88 void ldif_set_file      ( LdifFile* ldifFile, const gchar *value );
89 void ldif_free          ( LdifFile *ldifFile );
90 gint ldif_import_data   ( LdifFile *ldifFile, AddressCache *cache );
91
92 #endif /* __LDIF_H__ */
93