xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

misc_funct.h
Go to the documentation of this file.
1 
2 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
3 
4  Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
5 
6  Provided under GPL version 2 or later.
7 
8  This file contains declarations of miscellaneous helper functions of
9  xorriso.
10 */
11 
12 
13 #ifndef Xorriso_pvt_misc_includeD
14 #define Xorriso_pvt_misc_includeD yes
15 
16 #include <regex.h>
17 
18 #ifdef HAVE_STDINT_H
19 #include <stdint.h>
20 #else
21 #ifdef HAVE_INTTYPES_H
22 #include <inttypes.h>
23 #endif
24 #endif
25 
26 
27 char *Text_shellsafe(char *in_text, char *out_text, int flag);
28 
29 int Sort_argv(int argc, char **argv, int flag);
30 
31 /* @param flag bit0= single letters */
32 char *Ftypetxt(mode_t st_mode, int flag);
33 
34 /* @param flag bit0=with year and seconds
35  bit1=timestamp format YYYY.MM.DD.hhmmss
36 */
37 char *Ftimetxt(time_t t, char timetext[40], int flag);
38 
39 int System_uname(char **sysname, char **release, char **version,
40  char **machine, int flag);
41 
42 /** Convert a text into a number of type double and multiply it by unit code
43  [kmgtpe] (2^10 to 2^60) or [s] (2048). (Also accepts capital letters.)
44  @param text Input like "42", "2k", "3.14m" or "-1g"
45  @param flag Bitfield for control purposes:
46  bit0= return -1 rather than 0 on failure
47  @return The derived double value
48 */
49 double Scanf_io_size(char *text, int flag);
50 
51 /*
52  @flag bit0= do not initialize *diff_count
53  @return <0 error , 0 = mismatch , 1 = match
54 */
55 int Compare_text_lines(char *text1, char *text2, int *diff_count, int flag);
56 
57 time_t Decode_timestring(char *code, time_t *date, int flag);
58 
59 int Decode_ecma119_format(struct tm *erg, char *text, int flag);
60 
61 int Wait_for_input(int fd, int microsec, int flag);
62 
63 int Fileliste__target_source_limit(char *line, char sep, char **limit_pt,
64  int flag);
65 
66 int Fileliste__escape_source_path(char *line, int size, int flag);
67 
68 int Hex_to_bin(char *hex,
69  int bin_size, int *bin_count, unsigned char *bin_data, int flag);
70 
71 
72 /* bit0= append (text!=NULL) */
73 int Sregex_string(char **handle, char *text, int flag);
74 
75 /* @param flag bit0= only test expression whether compilable
76 */
77 int Sregex_match(char *pattern, char *text, int flag);
78 
79 /*
80  vars[][0] points to the variable names, vars[][1] to their contents.
81  start marks the begin of variable names. It must be non-empty. esc before
82  start disables this meaning. start and esc may be equal but else they must
83  have disjoint character sets.
84  end marks the end of a variable name. It may be empty but if non-empty it
85  must not appear in vars[][0].
86  @param flag bit0= Substitute unknown variables by empty text
87  (else copy start,name,end unaltered to result).
88  Parameter end must be non-empty for that.
89 */
90 int Sregex_resolve_var(char *form, char *vars[][2], int num_vars,
91  char *start, char *end, char *esc,
92  char *result, int result_size, int flag);
93 
94 /* reg_expr should be twice as large as bourne_expr ( + 2 to be exact) */
95 /* return: 2= bourne_expr is surely a constant */
96 int Xorriso__bourne_to_reg(char bourne_expr[], char reg_expr[], int flag);
97 
98 
99 int Xorriso__hide_mode(char *mode, int flag);
100 
101 char *Xorriso__hide_mode_text(int hide_mode, int flag);
102 
103 /* @return 0=truncated, 1=ok
104 */
105 int Xorriso__to_upper(char *in, char *out, int out_size, int flag);
106 
107 /* @param flag bit0= prepend target_prefix even if source_prefix does not get
108  removed
109 */
110 int Xorriso__exchange_prefix(char *source_prefix, char *target_prefix,
111  char *eff_source, char *eff_target, int flag);
112 
113 /* @param text takes result, must provide at least 37 characters of storage
114  @param flag bit0= structured text format (else hex string)
115 */
116 int Xorriso__format_guid(uint8_t guid[16], char *text, int flag);
117 
118 /* @param cpt start of keyword=value string
119  @param key_l length from cpt of keyword= string
120  @param l length from cpt up to end of value string
121  @param num result
122 */
123 int Xorriso__parse_size_param(char *cpt, int key_l, int l, double *num);
124 
125 
126 #endif /* ! Xorriso_pvt_misc_includeD */
127 
int Fileliste__escape_source_path(char *line, int size, int flag)
Definition: misc_funct.c:1140
int Fileliste__target_source_limit(char *line, char sep, char **limit_pt, int flag)
Definition: misc_funct.c:1119
int Xorriso__bourne_to_reg(char bourne_expr[], char reg_expr[], int flag)
Definition: misc_funct.c:1162
int Wait_for_input(int fd, int microsec, int flag)
Definition: misc_funct.c:770
int Xorriso__hide_mode(char *mode, int flag)
Definition: misc_funct.c:1242
int Sregex_resolve_var(char *form, char *vars[][2], int num_vars, char *start, char *end, char *esc, char *result, int result_size, int flag)
Definition: misc_funct.c:899
int Sort_argv(int argc, char **argv, int flag)
Definition: misc_funct.c:40
int Sregex_match(char *pattern, char *text, int flag)
Definition: misc_funct.c:1006
int Xorriso__parse_size_param(char *cpt, int key_l, int l, double *num)
Definition: misc_funct.c:1371
double Scanf_io_size(char *text, int flag)
Definition: misc_funct.c:182
int Xorriso__exchange_prefix(char *source_prefix, char *target_prefix, char *eff_source, char *eff_target, int flag)
Definition: misc_funct.c:1318
char * Text_shellsafe(char *in_text, char *out_text, int flag)
Definition: misc_funct.c:1044
char * Ftimetxt(time_t t, char timetext[40], int flag)
Definition: misc_funct.c:682
int Xorriso__format_guid(uint8_t guid[16], char *text, int flag)
Definition: misc_funct.c:1341
char * Xorriso__hide_mode_text(int hide_mode, int flag)
Definition: misc_funct.c:1273
char * Ftypetxt(mode_t st_mode, int flag)
Definition: misc_funct.c:732
time_t Decode_timestring(char *code, time_t *date, int flag)
Definition: misc_funct.c:587
int Hex_to_bin(char *hex, int bin_size, int *bin_count, unsigned char *bin_data, int flag)
Definition: misc_funct.c:1080
int Sregex_string(char **handle, char *text, int flag)
Definition: misc_funct.c:865
int Xorriso__to_upper(char *in, char *out, int out_size, int flag)
Definition: misc_funct.c:1301
int Compare_text_lines(char *text1, char *text2, int *diff_count, int flag)
Definition: misc_funct.c:131
int System_uname(char **sysname, char **release, char **version, char **machine, int flag)
Definition: misc_funct.c:794
int Decode_ecma119_format(struct tm *erg, char *text, int flag)
Definition: misc_funct.c:461