Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
util.h File Reference
#include "platform.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utime.h>
#include <time.h>
#include <limits.h>
#include <errno.h>

Go to the source code of this file.

Macros

#define UTIL_fseek   fseek
 
#define SET_REALTIME_PRIORITY   /* disabled */
 
#define UTIL_sleep(s)
 
#define UTIL_sleepMilli(milli)
 
#define UTIL_TYPE_stat   stat
 
#define UTIL_stat   stat
 
#define UTIL_fstat   fstat
 
#define UTIL_STAT_MODE_ISREG(st_mode)
 
#define UTIL_fileno   fileno
 
#define LIST_SIZE_INCREASE   (8*1024)
 
#define UTIL_STATIC   static /* this version may generate warnings for unused static functions; disable the relevant warning */
 

Typedefs

typedef signed short S16
 
typedef signed long long S64
 
typedef struct stat stat_t
 

Functions

int UTIL_countCores (void)
 
UTIL_STATIC void * UTIL_realloc (void *ptr, size_t size)
 
UTIL_STATIC int UTIL_sameString (const char *a, const char *b)
 
UTIL_STATIC int UTIL_isRegFile (const char *infilename)
 
UTIL_STATIC int UTIL_isRegFD (int fd)
 
UTIL_STATIC int UTIL_setFileStat (const char *filename, stat_t *statbuf)
 
UTIL_STATIC int UTIL_getFDStat (int fd, stat_t *statbuf)
 
UTIL_STATIC int UTIL_getFileStat (const char *infilename, stat_t *statbuf)
 
UTIL_STATIC int UTIL_isDirectory (const char *infilename)
 
UTIL_STATIC U64 UTIL_getOpenFileSize (FILE *file)
 
UTIL_STATIC U64 UTIL_getFileSize (const char *infilename)
 
UTIL_STATIC U64 UTIL_getTotalFileSize (const char **fileNamesTable, unsigned nbFiles)
 
UTIL_STATIC int UTIL_prepareFileList (const char *dirName, char **bufStart, size_t *pos, char **bufEnd)
 
UTIL_STATIC const char ** UTIL_createFileList (const char **inputNames, unsigned inputNamesNb, char **allocatedBuffer, unsigned *allocatedNamesNb)
 
UTIL_STATIC void UTIL_freeFileList (const char **filenameTable, char *allocatedBuffer)
 

Macro Definition Documentation

◆ LIST_SIZE_INCREASE

#define LIST_SIZE_INCREASE   (8*1024)

◆ SET_REALTIME_PRIORITY

#define SET_REALTIME_PRIORITY   /* disabled */

◆ UTIL_fileno

#define UTIL_fileno   fileno

◆ UTIL_fseek

#define UTIL_fseek   fseek

◆ UTIL_fstat

#define UTIL_fstat   fstat

◆ UTIL_sleep

#define UTIL_sleep ( s)
Value:
/* disabled */

◆ UTIL_sleepMilli

#define UTIL_sleepMilli ( milli)
Value:
/* disabled */

◆ UTIL_stat

#define UTIL_stat   stat

◆ UTIL_STAT_MODE_ISREG

#define UTIL_STAT_MODE_ISREG ( st_mode)
Value:
(S_ISREG(st_mode))

◆ UTIL_STATIC

#define UTIL_STATIC   static /* this version may generate warnings for unused static functions; disable the relevant warning */

◆ UTIL_TYPE_stat

#define UTIL_TYPE_stat   stat

Typedef Documentation

◆ S16

typedef signed short S16

◆ S64

typedef signed long long S64

◆ stat_t

typedef struct stat stat_t

Function Documentation

◆ UTIL_countCores()

int UTIL_countCores ( void )

◆ UTIL_createFileList()

UTIL_STATIC const char ** UTIL_createFileList ( const char ** inputNames,
unsigned inputNamesNb,
char ** allocatedBuffer,
unsigned * allocatedNamesNb )

◆ UTIL_freeFileList()

UTIL_STATIC void UTIL_freeFileList ( const char ** filenameTable,
char * allocatedBuffer )

◆ UTIL_getFDStat()

UTIL_STATIC int UTIL_getFDStat ( int fd,
stat_t * statbuf )

◆ UTIL_getFileSize()

UTIL_STATIC U64 UTIL_getFileSize ( const char * infilename)

◆ UTIL_getFileStat()

UTIL_STATIC int UTIL_getFileStat ( const char * infilename,
stat_t * statbuf )

◆ UTIL_getOpenFileSize()

UTIL_STATIC U64 UTIL_getOpenFileSize ( FILE * file)

◆ UTIL_getTotalFileSize()

UTIL_STATIC U64 UTIL_getTotalFileSize ( const char ** fileNamesTable,
unsigned nbFiles )

◆ UTIL_isDirectory()

UTIL_STATIC int UTIL_isDirectory ( const char * infilename)

◆ UTIL_isRegFD()

UTIL_STATIC int UTIL_isRegFD ( int fd)

◆ UTIL_isRegFile()

UTIL_STATIC int UTIL_isRegFile ( const char * infilename)

◆ UTIL_prepareFileList()

UTIL_STATIC int UTIL_prepareFileList ( const char * dirName,
char ** bufStart,
size_t * pos,
char ** bufEnd )

◆ UTIL_realloc()

UTIL_STATIC void * UTIL_realloc ( void * ptr,
size_t size )

◆ UTIL_sameString()

UTIL_STATIC int UTIL_sameString ( const char * a,
const char * b )

◆ UTIL_setFileStat()

UTIL_STATIC int UTIL_setFileStat ( const char * filename,
stat_t * statbuf )