libalpm
Arch Linux Package Manager Library
util.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <dirent.h>
#include <time.h>
#include <errno.h>
#include <limits.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <poll.h>
#include <pwd.h>
#include <signal.h>
#include <archive.h>
#include <archive_entry.h>
#include "util.h"
#include "log.h"
#include "libarchive-compat.h"
#include "alpm.h"
#include "alpm_list.h"
#include "handle.h"
#include "trans.h"
Include dependency graph for util.c:

Macros

#define HEAD   1
 
#define TAIL   0
 
#define STOP_POLLING(p)   do { close(p->fd); p->fd = -1; } while(0)
 

Functions

char * strsep (char **str, const char *delims)
 Extracts tokens from a string.
 
static int should_retry (int errnum)
 
char * alpm_compute_md5sum (const char *filename)
 Get the md5 sum of file.
 
char * alpm_compute_sha256sum (const char *filename)
 Get the sha256 sum of file.
 

Macro Definition Documentation

◆ HEAD

#define HEAD   1

◆ STOP_POLLING

#define STOP_POLLING ( p)    do { close(p->fd); p->fd = -1; } while(0)

◆ TAIL

#define TAIL   0

Function Documentation

◆ should_retry()

static int should_retry ( int errnum)
static

◆ strsep()

char * strsep ( char ** str,
const char * delims )

Extracts tokens from a string.

Replaces strset which is not portable (missing on Solaris). Copyright (c) 2001 by François Gouget <fgouget_at_codeweavers.com> Modifies str to point to the first character after the token if one is found, or NULL if one is not.

Parameters
strstring containing delimited tokens to parse
delimcharacter delimiting tokens in str
Returns
pointer to the first token in str if str is not NULL, NULL if str is NULL