opkg: correct the name of the state changed callback and run it when appropriate
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:22:05 +0000 (04:22 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:22:05 +0000 (04:22 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@32 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

opkg_state.c

index 3dbd6c6b6a701066351258bc609d58097c364728..2cc85949374ca01e03b11b0c814eb662d5125026 100644 (file)
@@ -33,7 +33,7 @@ static char *state_strings[] =
 
 
 
 
 
 
-opkg_state_changed_callback opkg_cb_state;
+opkg_state_changed_callback opkg_cb_state_changed = NULL;
 
 static opkg_state_t opkg_state = 0;
 static char *opkg_state_data = NULL;
 
 static opkg_state_t opkg_state = 0;
 static char *opkg_state_data = NULL;
@@ -55,6 +55,12 @@ opkg_set_current_state (opkg_state_t state, const char *data)
 
   opkg_state = state;
 
 
   opkg_state = state;
 
+  if (opkg_cb_state_changed)
+  {
+    opkg_cb_state_changed (opkg_state, opkg_state_data);
+  }
+
+
   printf ("opkg state set to %s: %s\n", state_strings[state], data);
 }
 
   printf ("opkg state set to %s: %s\n", state_strings[state], data);
 }