"Fossies" - the Fresh Open Source Software Archive 
Member "libisoburn-1.5.6/xorriso/misc_funct.h" (3 Nov 2020, 4135 Bytes) of package /linux/misc/libisoburn-1.5.6.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "misc_funct.h" see the
Fossies "Dox" file reference documentation and the last
Fossies "Diffs" side-by-side code changes report:
1.5.0_vs_1.5.2.
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