2
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
4
Copyright 2007-2010 Thomas Schmitt, <scdbackup@gmx.net>
6
Provided under GPL version 2 or later.
8
This file contains declarations of functions around files and strings.
12
#ifndef Xorriso_pvt_sfile_includeD
13
#define Xorriso_pvt_sfile_includeD yes
15
#define TSOB_FELD(typ,anz) (typ *) calloc(1, (anz)*sizeof(typ));
16
#define Smem_malloC malloc
17
#define Smem_freE free
19
#define SfileadrL 4096
22
int Sfile_str(char target[SfileadrL], char *source, int flag);
24
double Sfile_microtime(int flag);
26
int Sfile_add_to_path(char path[SfileadrL], char *addon, int flag);
28
int Sfile_scale(double value, char *result, int siz, double thresh, int flag);
30
int Sfile_destroy_argv(int *argc, char ***argv, int flag);
33
bit0= do not ignore trailing slash
34
bit1= do not ignore empty components (other than the empty root name)
36
int Sfile_count_components(char *path, int flag);
40
bit0= return -1 if file is missing
41
bit1= return a hardlink with siblings as type 5
42
bit2= evaluate eventual link target rather than the link object itself
43
bit3= return a socket or a char device as types 7 or 8 rather than 0
50
5=multiple hardlink (with bit1)
53
8=character device (with bit3)
55
int Sfile_type(char *filename, int flag);
57
/* @param flag bit0= only encode inside quotes
58
bit1= encode < 32 outside quotes except 7, 8, 9, 10, 12, 13
59
bit2= encode in any case above 126
60
bit3= encode in any case shellsafe:
61
<=42 , 59, 60, 62, 63, 92, 94, 96, >=123
63
int Sfile_bsl_encoder(char **result, char *text, size_t text_len, int flag);
65
int Sfile_argv_bsl(int argc, char ***argv, int flag);
68
bit0= read progname as first argument from line
69
bit1= just release argument list argv and return
70
bit2= abort with return(0) if incomplete quotes are found
71
bit3= eventually prepend missing '-' to first argument read from line
72
bit4= like bit2 but only check quote completeness, do not allocate memory
73
bit5+6= interpretation of backslashes:
74
0= no interpretation, leave unchanged
75
1= only inside double quotes
76
2= outside single quotes
78
bit7= append a NULL element to argv
80
int Sfile_make_argv(char *progname, char *line, int *argc, char ***argv,
83
/* YYMMDD[.hhmm[ss]] */
84
int Sfile_decode_datestr(struct tm *reply, char *text, int flag);
86
int Sfile_off_t_text(char text[80], off_t num, int flag);
88
int Sfile_leafname(char *path, char leafname[SfileadrL], int flag);
90
/* @param flag bit0= do not clip of carriage return at line end
92
char *Sfile_fgets_n(char *line, int maxl, FILE *fp, int flag);
95
bit0=with hours+minutes
98
bit8= local time rather than UTC
100
char *Sfile_datestr(time_t tim, short int flag);
102
/* Converts backslash codes into single characters:
103
\a BEL 7 , \b BS 8 , \e ESC 27 , \f FF 12 , \n LF 10 , \r CR 13 ,
104
\t HT 9 , \v VT 11 , \\ \ 92
105
\[0-9][0-9][0-9] octal code , \x[0-9a-f][0-9a-f] hex code ,
106
\cX control-x (ascii(X)-64)
107
@param upto maximum number of characters to examine for backslash.
108
The scope of a backslash (0 to 3 characters) is not affected.
109
@param eaten returns the difference in length between input and output
110
@param flag bit0= only determine *eaten, do not convert
111
bit1= allow to convert \000 to binary 0
113
int Sfile_bsl_interpreter(char *text, int upto, int *eaten, int flag);
115
int Sfile_prepend_path(char *prefix, char path[SfileadrL], int flag);
117
int Sfile_home_adr_s(char *filename, char *fileadr, int fa_size, int flag);
120
#endif /* ! Xorriso_pvt_sfile_includeD */