FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 03-01-2012, 06:10 AM
Zameer Manji
 
Default 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
 
Old 03-01-2012, 06:14 AM
Allan McRae
 
Default Arguments for alpm_initialize

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
>
>
>
 

Thread Tools




All times are GMT. The time now is 12:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org