[pacman-dev] Arguments for alpm_initialize
Hello, This is my first time posting on this list, so my apologies if this is the incorrect place to ask for help. I've been trying to create a wrapper around libalpm for my own uses and I'm trying to get the project off the ground with a simple program: #include <alpm.h> #include <stdio.h> int main(void) { enum _alpm_errno_t errno = 0; alpm_handle_t* t = alpm_initialize("/", "/var/lib/pacman", &errno); if(t == NULL) { printf("Got APLM handle"); } else { printf("No Handle"); if(errno == 0) { printf("No Error Code Given"); } } alpm_release(t); return 0; } Currently the program outputs "No Handle" and "No Error Code Given". What can I do inorder to either get the handle correctly or get an error code so I can investigate further? -- - Zameer Manji
On 01/03/12 17:10, Zameer Manji wrote:
Hello,
This is my first time posting on this list, so my apologies if this is the incorrect place to ask for help. I've been trying to create a wrapper around libalpm for my own uses and I'm trying to get the project off the ground with a simple program:
#include <alpm.h> #include <stdio.h>
int main(void) { enum _alpm_errno_t errno = 0;
alpm_handle_t* t = alpm_initialize("/", "/var/lib/pacman", &errno);
if(t == NULL)
alpm_initialize returns NULL on error, not on success.
{ printf("Got APLM handle"); } else { printf("No Handle");
if(errno == 0) { printf("No Error Code Given"); } }
alpm_release(t); return 0; }
Currently the program outputs "No Handle" and "No Error Code Given". What can I do inorder to either get the handle correctly or get an error code so I can investigate further?
-- - Zameer Manji
participants (2)
-
Allan McRae
-
Zameer Manji