1 /* opkglib.h - the itsy package management system
3 Florian Boor <florian.boor@kernelconcepts.de>
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.
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.
24 #include "opkg_conf.h"
25 #include "opkg_message.h"
26 #include "opkg_state.h"
31 typedef int (*opkg_message_callback)(opkg_conf_t *conf, message_level_t level,
33 typedef int (*opkg_list_callback)(char *name, char *desc, char *version,
34 pkg_state_status_t status, void *userdata);
35 typedef int (*opkg_status_callback)(char *name, int istatus, char *desc,
37 typedef char* (*opkg_response_callback)(char *question);
38 typedef void (*opkg_download_progress_callback)(int percent, char *url);
39 typedef void (*opkg_state_changed_callback)(opkg_state_t state, const char *data);
40 typedef void (*opkg_progress_callback)(int complete, int total, void *userdata);
42 extern int opkg_op(int argc, char *argv[]); /* opkglib.c */
43 extern int opkg_init (opkg_message_callback mcall,
44 opkg_response_callback rcall,
47 extern int opkg_deinit (args_t *args);
48 extern int opkg_packages_list(args_t *args,
50 opkg_list_callback cblist,
52 extern int opkg_packages_status(args_t *args,
54 opkg_status_callback cbstatus,
56 extern int opkg_packages_info(args_t *args,
58 opkg_status_callback cbstatus,
60 extern int opkg_packages_install(args_t *args, const char *name);
61 extern int opkg_packages_remove(args_t *args, const char *name, int purge);
62 extern int opkg_lists_update(args_t *args);
63 extern int opkg_packages_upgrade(args_t *args);
64 extern int opkg_packages_download(args_t *args, const char *name);
65 extern int opkg_package_files(args_t *args,
67 opkg_list_callback cblist,
69 extern int opkg_file_search(args_t *args,
71 opkg_list_callback cblist,
73 extern int opkg_package_whatdepends(args_t *args, const char *file);
74 extern int opkg_package_whatrecommends(args_t *args, const char *file);
75 extern int opkg_package_whatprovides(args_t *args, const char *file);
76 extern int opkg_package_whatconflicts(args_t *args, const char *file);
77 extern int opkg_package_whatreplaces(args_t *args, const char *file);
79 extern opkg_message_callback opkg_cb_message; /* opkglib.c */
80 extern opkg_response_callback opkg_cb_response;
81 extern opkg_status_callback opkg_cb_status;
82 extern opkg_list_callback opkg_cb_list;
83 extern opkg_download_progress_callback opkg_cb_download_progress; /* opkg_download.c */
84 extern opkg_state_changed_callback opkg_cb_state_changed; /* opkg_state.c */
86 extern void push_error_list(struct errlist **errors,char * msg);
87 extern void reverse_error_list(struct errlist **errors);
88 extern void free_error_list();