[hipl-commit] [trunk] Rev 4153: Declare externally available symbols from agent.c in agent.h. Fixes:

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Wed, 7 Apr 2010 17:07:28 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 07/04/2010 at 17:07:28
Revision: 4153
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Declare externally available symbols from agent.c in agent.h. Fixes:
  
  agent/hitdb.c: In function `hit_db_add':
  agent/hitdb.c:333: error: redundant redeclaration of `agent_db'
  agent/hitdb.c:246: note: previous declaration of `agent_db' was here
  agent/hitdb.c:334: error: redundant redeclaration of `init_in_progress'
  agent/hitdb.c:222: note: previous declaration of `init_in_progress' was here

Modified:
  M  agent/agent.h
  M  agent/hitdb.c

=== modified file 'agent/agent.h'
--- agent/agent.h       2010-02-17 17:38:08 +0000
+++ agent/agent.h       2010-04-07 14:06:01 +0000
@@ -8,17 +8,9 @@
 #ifndef HIP_AGENT_AGENT_H
 #define HIP_AGENT_AGENT_H
 
-
-/******************************************************************************/
-/* DEFINES */
-
-/******************************************************************************/
-/* INCLUDES */
-
-/******************************************************************************/
-/* FUNCTION DEFINITIONS */
-
-
-
-#endif /* END OF HEADER FILE */
-/******************************************************************************/
+#include <sqlite3.h>
+
+extern sqlite3 *agent_db;
+extern int init_in_progress;
+
+#endif /* HIP_AGENT_AGENT_H */

=== modified file 'agent/hitdb.c'
--- agent/hitdb.c       2010-03-18 21:15:21 +0000
+++ agent/hitdb.c       2010-04-07 14:06:01 +0000
@@ -19,6 +19,7 @@
 #include <sys/un.h>
 #include <sys/types.h>
 
+#include "agent.h"
 #include "hitdb.h"
 #include "language.h"
 #include "tools.h"
@@ -219,7 +220,6 @@
 int hit_db_init(char *file)
 {
     int err = 0;
-    extern int init_in_progress;
 
     hit_db_lock      = 0;
     hit_db_clear();
@@ -243,7 +243,6 @@
 void hit_db_quit(void)
 {
     int err = 0;
-    extern sqlite3 *agent_db;
 
     HIP_IFEL(hip_sqlite_close_db(agent_db), -1, "Failed to close the db\n");
     hit_db_clear();
@@ -330,8 +329,6 @@
     HIT_Remote *r, *err = NULL;
     char insert_into[256];
     int ret = 0;
-    extern sqlite3 *agent_db;
-    extern int init_in_progress;
 
     if (!nolock) {
         HIT_DB_LOCK();
@@ -411,7 +408,6 @@
     char name[MAX_NAME_LEN + 1], group_name[MAX_NAME_LEN + 1];
     int err        = 0;
     char delete_from[256];
-    extern sqlite3 *agent_db;
 
     /* Check that database is not empty. */
     HIP_IFEL(remote_db_n < 1, -1, "Remote database is empty, should not 
happen!\n");
@@ -521,8 +517,6 @@
 {
     FILE *db_file = NULL;
     int err       = 0;
-    extern sqlite3 *agent_db;
-    extern int init_in_progress;
 
     hit_db_clear();
     HIT_DB_LOCK();
@@ -658,8 +652,6 @@
     HIT_Group *g, *err = NULL;
     char insert_into[256];
     int ret = 0;
-    extern sqlite3 *agent_db;
-    extern int init_in_progress;
 
     /* Check group name length. */
     HIP_IFEL(strlen(name) < 1, NULL, "Remote group name too short.\n");
@@ -720,7 +712,6 @@
     HIT_Group *g, *g2;
     int err = 0;
     char delete_from[256];
-    extern sqlite3 *agent_db;
 
     /* Find group from database first. */
     g = hit_db_find_rgroup(name);
@@ -803,8 +794,6 @@
     char lhit[128];
     char insert_into[256];
     int ret = 0;
-    extern sqlite3 *agent_db;
-    extern int init_in_progress;
 
     /* Check HIT name length. */
     HIP_IFEL(strlen(name) < 1, NULL, "Local HIT name too short.\n");

Other related posts:

  • » [hipl-commit] [trunk] Rev 4153: Declare externally available symbols from agent.c in agent.h. Fixes: - Diego Biurrun