r4346 - trunk/src/target/opkg/libopkg

thomas at sita.openmoko.org thomas at sita.openmoko.org
Fri Apr 11 16:35:15 CEST 2008


Author: thomas
Date: 2008-04-11 16:35:12 +0200 (Fri, 11 Apr 2008)
New Revision: 4346

Modified:
   trunk/src/target/opkg/libopkg/libopkg.c
   trunk/src/target/opkg/libopkg/libopkg.h
   trunk/src/target/opkg/libopkg/opkg_download.c
   trunk/src/target/opkg/libopkg/opkg_download.h
   trunk/src/target/opkg/libopkg/opkg_message.c
   trunk/src/target/opkg/libopkg/opkg_message.h
   trunk/src/target/opkg/libopkg/opkg_remove.c
   trunk/src/target/opkg/libopkg/opkg_state.c
   trunk/src/target/opkg/libopkg/opkg_state.h
   trunk/src/target/opkg/libopkg/opkg_utils.h
   trunk/src/target/opkg/libopkg/user.c
   trunk/src/target/opkg/libopkg/user.h
Log:
libopkg: remove internal dependency on libopkg.h and opkg_cmd.h


Modified: trunk/src/target/opkg/libopkg/libopkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/libopkg.c	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/libopkg.c	2008-04-11 14:35:12 UTC (rev 4346)
@@ -26,8 +26,6 @@
 
 
 
-opkg_message_callback opkg_cb_message = NULL;
-opkg_response_callback opkg_cb_response = NULL;
 opkg_status_callback opkg_cb_status = NULL;
 opkg_list_callback opkg_cb_list = NULL;
 

Modified: trunk/src/target/opkg/libopkg/libopkg.h
===================================================================
--- trunk/src/target/opkg/libopkg/libopkg.h	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/libopkg.h	2008-04-11 14:35:12 UTC (rev 4346)
@@ -24,19 +24,17 @@
 #include "opkg_conf.h"
 #include "opkg_message.h"
 #include "opkg_state.h"
+#include "opkg_download.h"
+#include "opkg_utils.h"
 
 #include "args.h"
 #include "pkg.h"
+#include "user.h"
 
-typedef int (*opkg_message_callback)(opkg_conf_t *conf, message_level_t level, 
-	char *msg);
-typedef int (*opkg_list_callback)(char *name, char *desc, char *version, 
-	pkg_state_status_t status, void *userdata);
 typedef int (*opkg_status_callback)(char *name, int istatus, char *desc,
 	void *userdata);
-typedef char* (*opkg_response_callback)(char *question);
-typedef void (*opkg_download_progress_callback)(int percent, char *url);
-typedef void (*opkg_state_changed_callback)(opkg_state_t state, const char *data);
+typedef int (*opkg_list_callback)(char *name, char *desc, char *version, 
+	pkg_state_status_t status, void *userdata);
 typedef void (*opkg_progress_callback)(int complete, int total, void *userdata);
 
 extern int opkg_op(int argc, char *argv[]); /* opkglib.c */
@@ -76,15 +74,11 @@
 extern int opkg_package_whatconflicts(args_t *args, const char *file);
 extern int opkg_package_whatreplaces(args_t *args, const char *file);
 
-extern opkg_message_callback opkg_cb_message; /* opkglib.c */
-extern opkg_response_callback opkg_cb_response;
+extern opkg_message_callback opkg_cb_message; /* opkg_message.c */
+extern opkg_response_callback opkg_cb_response; /* user.c */
 extern opkg_status_callback opkg_cb_status;
 extern opkg_list_callback opkg_cb_list;
 extern opkg_download_progress_callback opkg_cb_download_progress; /* opkg_download.c */
 extern opkg_state_changed_callback opkg_cb_state_changed; /* opkg_state.c */
 
-extern void push_error_list(struct errlist **errors,char * msg);
-extern void reverse_error_list(struct errlist **errors);
-extern void free_error_list();
-
 #endif

Modified: trunk/src/target/opkg/libopkg/opkg_download.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_download.c	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_download.c	2008-04-11 14:35:12 UTC (rev 4346)
@@ -32,7 +32,6 @@
 #include "file_util.h"
 #include "str_util.h"
 
-#include "libopkg.h"
 opkg_download_progress_callback opkg_cb_download_progress = NULL;
 
 int

Modified: trunk/src/target/opkg/libopkg/opkg_download.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_download.h	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_download.h	2008-04-11 14:35:12 UTC (rev 4346)
@@ -20,6 +20,8 @@
 
 #include "opkg_conf.h"
 
+typedef void (*opkg_download_progress_callback)(int percent, char *url);
+
 int opkg_download(opkg_conf_t *conf, const char *src, const char *dest_file_name);
 int opkg_download_pkg(opkg_conf_t *conf, pkg_t *pkg, const char *dir);
 /*

Modified: trunk/src/target/opkg/libopkg/opkg_message.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_message.c	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_message.c	2008-04-11 14:35:12 UTC (rev 4346)
@@ -18,10 +18,8 @@
 #include "opkg_conf.h"
 #include "opkg_message.h"
 
-#include "libopkg.h"
+opkg_message_callback opkg_cb_message = NULL;
 
-//#define opkg_message(conf, level, fmt, arg...) opkg_cb_message(conf, level, fmt, ## arg)
-
 void
 opkg_message (opkg_conf_t * conf, message_level_t level, char *fmt, ...)
 {

Modified: trunk/src/target/opkg/libopkg/opkg_message.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_message.h	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_message.h	2008-04-11 14:35:12 UTC (rev 4346)
@@ -27,6 +27,9 @@
      OPKG_DEBUG2,	/* more debug level message */
 } message_level_t;
 
+typedef int (*opkg_message_callback)(opkg_conf_t *conf, message_level_t level, 
+	char *msg);
+
 extern void opkg_message(opkg_conf_t *conf, message_level_t level, char *fmt, ...);
 
 #endif /* _OPKG_MESSAGE_H_ */

Modified: trunk/src/target/opkg/libopkg/opkg_remove.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_remove.c	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_remove.c	2008-04-11 14:35:12 UTC (rev 4346)
@@ -26,8 +26,6 @@
 #include "sprintf_alloc.h"
 #include "str_util.h"
 
-#include "opkg_cmd.h"
-
 /*
  * Returns number of the number of packages depending on the packages provided by this package.
  * Every package implicitly provides itself.

Modified: trunk/src/target/opkg/libopkg/opkg_state.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_state.c	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_state.c	2008-04-11 14:35:12 UTC (rev 4346)
@@ -15,7 +15,6 @@
    General Public License for more details.
 */
 
-#include "libopkg.h"
 #include "opkg_state.h"
 
 

Modified: trunk/src/target/opkg/libopkg/opkg_state.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_state.h	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_state.h	2008-04-11 14:35:12 UTC (rev 4346)
@@ -18,7 +18,7 @@
 #ifndef OPKG_STATE_H
 #define OPKG_STATE_H
 
-#include <opkg_message.h>
+#include "opkg_message.h"
 
 extern int opkg_state_changed;
 
@@ -36,5 +36,8 @@
 
 void opkg_set_current_state (opkg_conf_t *conf, opkg_state_t state, const char *data);
 
+typedef void (*opkg_state_changed_callback)(opkg_state_t state, const char *data);
 
+
+
 #endif /* OPKG_STATE_H */

Modified: trunk/src/target/opkg/libopkg/opkg_utils.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_utils.h	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/opkg_utils.h	2008-04-11 14:35:12 UTC (rev 4346)
@@ -20,6 +20,10 @@
 
 #include "pkg.h"
 
+void push_error_list(struct errlist **errors,char * msg);
+void reverse_error_list(struct errlist **errors);
+void free_error_list();
+
 int get_available_blocks(char * filesystem);
 char **read_raw_pkgs_from_file(const char *file_name);
 char **read_raw_pkgs_from_stream(FILE *fp);

Modified: trunk/src/target/opkg/libopkg/user.c
===================================================================
--- trunk/src/target/opkg/libopkg/user.c	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/user.c	2008-04-11 14:35:12 UTC (rev 4346)
@@ -15,17 +15,19 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.
 */
-
+#include <stdlib.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <string.h>
 #include "file_util.h"
 #include "str_util.h"
-#include "libopkg.h"
+#include "user.h"
 
-
 static char *question = NULL;
 static int question_len = 255;
 
+opkg_response_callback opkg_cb_response = NULL;
+
 char *get_user_response(const char *format, ...)
 {
      int len = question_len;

Modified: trunk/src/target/opkg/libopkg/user.h
===================================================================
--- trunk/src/target/opkg/libopkg/user.h	2008-04-11 11:45:25 UTC (rev 4345)
+++ trunk/src/target/opkg/libopkg/user.h	2008-04-11 14:35:12 UTC (rev 4346)
@@ -19,5 +19,6 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+typedef char* (*opkg_response_callback)(char *question);
 char *get_user_response(const char *format, ...);
 





More information about the commitlog mailing list