File: utils.h

package info (click to toggle)
loki 2.4.7.4-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,172 kB
  • sloc: ansic: 38,653; yacc: 4,974; lex: 946; makefile: 333; sh: 100
file content (53 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef _UTILS_H_
#define _UTILS_H_

#include <time.h>

#ifndef WORD_BIT
#define WORD_BIT (sizeof(int)<<3)
#endif

#ifndef LONG_BIT
#define LONG_BIT (sizeof(long)<<3)
#endif

#define   READ	   0
#define   WRITE	1

#define DEFAULT_FILE_PREFIX "loki"

#define UTL_NULL_POINTER 1
#define UTL_NO_MEM 2
#define UTL_BAD_STAT 3
#define UTL_BAD_DIR 4
#define UTL_BAD_PERM 5
#define UTL_MAX_ERR 5

typedef struct {
	time_t start_time;
	double extra_time,extra_stime,extra_utime;
} loki_time;

extern const char *FMsg,*IntErr,*MMsg,*AbMsg;
extern int from_abt;

void abt(const char *, const int, const char *, ...);
char *copy_string(const char *);
char *make_file_name( const char *);
void print_start_time(const char *,const char *,char *,loki_time *);
void print_end_time(void);
int mystrcmp(const char *, const char *);
void qstrip(char *);
char **tokenize(char *,const int);
void gen_perm(int *,int);
void gnu_qsort(void *const,size_t,size_t,int(*)(const void *,const void *));
int txt_print_double(double,FILE *);
int txt_get_double(char *,char **,double *);
int set_file_prefix(const char *);
int set_file_dir(const char *);
const char *utl_error(int);
char *add_file_dir(const char *);

#define ABT_FUNC(msg) abt(__FILE__,__LINE__,"%s(): %s",FUNC_NAME,msg)

#endif