summaryrefslogtreecommitdiff
path: root/src/jpilot.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/jpilot.h')
-rw-r--r--src/jpilot.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/src/jpilot.h b/src/jpilot.h
new file mode 100644
index 0000000..764e56f
--- /dev/null
+++ b/src/jpilot.h
@@ -0,0 +1,117 @@
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 for accessing JPilot database files.
22 * JPilot is Copyright(c) by Judd Montgomery.
23 * Visit http://www.jpilot.org for more details.
24 */
25
26#ifndef __JPILOT_H__
27#define __JPILOT_H__
28
29#ifdef HAVE_CONFIG_H
30# include "config.h"
31#endif
32
33#ifdef USE_JPILOT
34
35#include <glib.h>
36#include <stdio.h>
37
38#ifdef HAVE_LIBPISOCK_PI_ADDRESS_H
39# include <libpisock/pi-address.h>
40#else
41# include <pi-address.h>
42#endif
43
44#include "addritem.h"
45#include "addrcache.h"
46#include "utils.h"
47
48typedef struct _JPilotFile JPilotFile;
49
50struct _JPilotFile {
51 gchar *name;
52 FILE *file;
53 gchar *path;
54 AddressCache *addressCache;
55 struct AddressAppInfo addrInfo;
56 gboolean readMetadata;
57 GList *customLabels;
58 GList *labelInd;
59 gint retVal;
60 gboolean accessFlag;
61 gboolean havePC3;
62 stime_t pc3ModifyTime;
63};
64
65/* Limits */
66#define JPILOT_NUM_LABELS 22 /* Number of labels */
67#define JPILOT_NUM_PHONELABELS 8 /* Number of phone number labels */
68#define JPILOT_NUM_CATEG 16 /* Number of categories */
69#define JPILOT_LEN_LABEL 15 /* Max length of label */
70#define JPILOT_LEN_CATEG 15 /* Max length of category */
71#define JPILOT_NUM_ADDR_PHONE 5 /* Number of phone entries a person
72 can have */
73
74/* Function prototypes */
75JPilotFile *jpilot_create ( void );
76JPilotFile *jpilot_create_path ( const gchar *path );
77void jpilot_set_name ( JPilotFile* pilotFile, const gchar *value );
78void jpilot_set_file ( JPilotFile* pilotFile, const gchar *value );
79void jpilot_free ( JPilotFile *pilotFile );
80gint jpilot_get_status ( JPilotFile *pilotFile );
81gboolean jpilot_get_modified ( JPilotFile *pilotFile );
82gboolean jpilot_get_accessed ( JPilotFile *pilotFile );
83void jpilot_set_accessed ( JPilotFile *pilotFile, const gboolean value );
84gboolean jpilot_get_read_flag ( JPilotFile *pilotFile );
85ItemFolder *jpilot_get_root_folder ( JPilotFile *pilotFile );
86gchar *jpilot_get_name ( JPilotFile *pilotFile );
87
88void jpilot_force_refresh ( JPilotFile *pilotFile );
89void jpilot_print_file ( JPilotFile *jpilotFile, FILE *stream );
90void jpilot_print_short ( JPilotFile *pilotFile, FILE *stream );
91gint jpilot_read_data ( JPilotFile *pilotFile );
92GList *jpilot_get_list_person ( JPilotFile *pilotFile );
93GList *jpilot_get_list_folder ( JPilotFile *pilotFile );
94GList *jpilot_get_all_persons ( JPilotFile *pilotFile );
95
96GList *jpilot_load_label ( JPilotFile *pilotFile, GList *labelList );
97GList *jpilot_get_category_list ( JPilotFile *pilotFile );
98gchar *jpilot_get_category_name ( JPilotFile *pilotFile, gint catID );
99GList *jpilot_load_phone_label ( JPilotFile *pilotFile, GList *labelList );
100GList *jpilot_load_custom_label ( JPilotFile *pilotFile, GList *labelList );
101
102gboolean jpilot_validate ( const JPilotFile *pilotFile );
103gchar *jpilot_find_pilotdb ( void );
104
105gint jpilot_test_read_file ( const gchar *fileSpec );
106
107void jpilot_clear_custom_labels ( JPilotFile *pilotFile );
108void jpilot_add_custom_label ( JPilotFile *pilotFile, const gchar *labelName );
109GList *jpilot_get_custom_labels ( JPilotFile *pilotFile );
110gboolean jpilot_test_custom_label ( JPilotFile *pilotFile, const gchar *labelName );
111/* gboolean jpilot_test_pilot_lib ( void ); */
112
113gint jpilot_read_modified ( JPilotFile *pilotFile );
114
115#endif /* USE_JPILOT */
116
117#endif /* __JPILOT_H__ */