* Add ipkg for future development
[project/opkg-lede.git] / libipkg.h
1 /* ipkglib.h - the itsy package management system
2
3 Florian Boor <florian.boor@kernelconcepts.de>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2, or (at
8 your option) any later version.
9
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14 */
15
16 #ifndef IPKGLIB_H
17 #define IPKGLIB_H
18
19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
22
23
24 #ifdef IPKG_LIB
25
26 #include "ipkg_conf.h"
27 #include "ipkg_message.h"
28
29 #include "args.h"
30 #include "pkg.h"
31
32 typedef int (*ipkg_message_callback)(ipkg_conf_t *conf, message_level_t level,
33 char *msg);
34 typedef int (*ipkg_list_callback)(char *name, char *desc, char *version,
35 pkg_state_status_t status, void *userdata);
36 typedef int (*ipkg_status_callback)(char *name, int istatus, char *desc,
37 void *userdata);
38 typedef char* (*ipkg_response_callback)(char *question);
39
40 extern int ipkg_op(int argc, char *argv[]); /* ipkglib.c */
41 extern int ipkg_init (ipkg_message_callback mcall,
42 ipkg_response_callback rcall,
43 args_t * args);
44
45 extern int ipkg_deinit (args_t *args);
46 extern int ipkg_packages_list(args_t *args,
47 const char *packages,
48 ipkg_list_callback cblist,
49 void *userdata);
50 extern int ipkg_packages_status(args_t *args,
51 const char *packages,
52 ipkg_status_callback cbstatus,
53 void *userdata);
54 extern int ipkg_packages_info(args_t *args,
55 const char *packages,
56 ipkg_status_callback cbstatus,
57 void *userdata);
58 extern int ipkg_packages_install(args_t *args, const char *name);
59 extern int ipkg_packages_remove(args_t *args, const char *name, int purge);
60 extern int ipkg_lists_update(args_t *args);
61 extern int ipkg_packages_upgrade(args_t *args);
62 extern int ipkg_packages_download(args_t *args, const char *name);
63 extern int ipkg_package_files(args_t *args,
64 const char *name,
65 ipkg_list_callback cblist,
66 void *userdata);
67 extern int ipkg_file_search(args_t *args,
68 const char *file,
69 ipkg_list_callback cblist,
70 void *userdata);
71 extern int ipkg_package_whatdepends(args_t *args, const char *file);
72 extern int ipkg_package_whatrecommends(args_t *args, const char *file);
73 extern int ipkg_package_whatprovides(args_t *args, const char *file);
74 extern int ipkg_package_whatconflicts(args_t *args, const char *file);
75 extern int ipkg_package_whatreplaces(args_t *args, const char *file);
76
77 extern ipkg_message_callback ipkg_cb_message; /* ipkglib.c */
78 extern ipkg_response_callback ipkg_cb_response;
79 extern ipkg_status_callback ipkg_cb_status;
80 extern ipkg_list_callback ipkg_cb_list;
81 extern void push_error_list(struct errlist **errors,char * msg);
82 extern void reverse_error_list(struct errlist **errors);
83 extern void free_error_list();
84
85 #endif
86
87
88 #endif