forked from juddmon/jpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugins.h
89 lines (79 loc) · 2.75 KB
/
plugins.h
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
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*******************************************************************************
* plugins.h
* A module of J-Pilot http://jpilot.org
*
* Copyright (C) 1999-2014 by Judd Montgomery
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
******************************************************************************/
#include "config.h"
#ifdef ENABLE_PLUGINS
#ifndef __PLUGINS_H__
#define __PLUGINS_H__
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include "libplugin.h"
#include "prefs.h"
#define MAX_NUM_PLUGINS 50
struct plugin_s
{
char *full_path;
void *handle;
unsigned char sync_on;
unsigned char user_only;
char *name;
char *menu_name;
char *help_name;
char *db_name;
int number;
int (*plugin_get_name)(char *name, int len);
int (*plugin_get_menu_name)(char *name, int len);
int (*plugin_get_help_name)(char *name, int len);
int (*plugin_get_db_name)(char *db_name, int len);
int (*plugin_startup)(jp_startup_info *info);
int (*plugin_gui)(GtkWidget *vbox, GtkWidget *hbox, unsigned int unique_id);
int (*plugin_help)(char **text, int *width, int *height);
int (*plugin_print)(void);
int (*plugin_import)(GtkWidget *window);
int (*plugin_export)(GtkWidget *window);
int (*plugin_gui_cleanup)(void);
int (*plugin_pre_sync_pre_connect)(void);
int (*plugin_pre_sync)(void);
int (*plugin_sync)(int sd);
int (*plugin_search)(const char *search_string, int case_sense, struct search_result **sr);
int (*plugin_post_sync)(void);
int (*plugin_exit_cleanup)(void);
int (*plugin_unpack_cai_from_ai)(struct CategoryAppInfo *cai,
unsigned char *ai_raw, int len);
int (*plugin_pack_cai_into_ai)(struct CategoryAppInfo *cai,
unsigned char *ai_raw, int len);
};
int load_plugins(void);
GList *get_plugin_list(void);
/*
* Free the search_result record list
*/
void free_search_result(struct search_result **sr);
/*
* Write out the jpilot.plugins file that tells which plugins to sync
*/
void write_plugin_sync_file(void);
/*
* Free the plugin_list
*/
void free_plugin_list(GList **plugin_list);
#endif
#endif