diff options
author | Dan McGee <dan@archlinux.org> | 2007-11-04 19:05:22 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-11-04 19:05:22 +0100 |
commit | 86ca39d15e02dff47b5b0f5bcd0494cf101ce0c1 (patch) | |
tree | 4475913a7dd0fe5facbe9bed369aba34f67134aa /lib | |
parent | 006387828cbdd11e6307879ad27e9bb9409ca193 (diff) | |
download | pacman-86ca39d15e02dff47b5b0f5bcd0494cf101ce0c1.tar.gz pacman-86ca39d15e02dff47b5b0f5bcd0494cf101ce0c1.tar.xz |
Clean up usage of extern variables
Instead of declaring the extern variable in every *.c file, include it in
the header file that makes sense. This means handle.h for the handle, and
conf.h for the pacman side config object.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/alpm.c | 1 | ||||
-rw-r--r-- | lib/libalpm/deps.c | 2 | ||||
-rw-r--r-- | lib/libalpm/handle.c | 3 | ||||
-rw-r--r-- | lib/libalpm/handle.h | 1 |
4 files changed, 4 insertions, 3 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 7bbcc869..9fe9bc17 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -32,7 +32,6 @@ #include "util.h" /* Globals */ -pmhandle_t *handle = NULL; enum _pmerrno_t pm_errno SYMEXPORT; /** \addtogroup alpm_interface Interface Functions diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index a9de1612..d8cb0d67 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -39,8 +39,6 @@ #include "provide.h" #include "handle.h" -extern pmhandle_t *handle; - static pmgraph_t *_alpm_graph_new(void) { pmgraph_t *graph = NULL; diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 4c18943a..9031291d 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -43,6 +43,9 @@ #include "alpm.h" #include "server.h" +/* global var for handle (private to libalpm) */ +pmhandle_t *handle = NULL; + pmhandle_t *_alpm_handle_new() { pmhandle_t *handle; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index d8edf00f..0874ecd3 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -64,6 +64,7 @@ typedef struct _pmhandle_t { unsigned short usedelta; /* Download deltas if possible */ } pmhandle_t; +/* global handle variable */ extern pmhandle_t *handle; pmhandle_t *_alpm_handle_new(); |