/usr/include/styx/line_scn.h is in styx-dev 2.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | /* ------------------------------------------------------------------------ */
/* */
/* [line_scn.h] Source Line Scanner */
/* & simple AWK Functionality */
/* */
/* Copyright (c) 1994 by Lars D\olle, Heike Manns */
/* ------------------------------------------------------------------------ */
/* File generated by 'ctoh'. Don't change manually. */
#ifndef line_scn_INCL
#define line_scn_INCL
/*
[line_scn] contains a set of functions for source analysis.
1. The primitive
| string Line_get(FILE *SysIn)
reads the next line from the source file 'SysIn' and returns it as a string.
'\x1a' (DOS) and '(-1)' (UNIX) are recognized as end of file.
The end of line characters '\n' eg. '\r\n' and trailing spaces will be removed.
2. Further this module provides a simple AWK-mechanism.
3. The primitive
| string Line_getCFunNam(string CDecl)
extracts the function name from a C-deklaration/definition.
4. The primitive
| string Line_replace(string txt, MAP(symbol,symbol) ReplaceRules)
supports simple text replacement. Each occurance of a key in the given text will
be replaced by the associated value.
5. The primitive
| bool Line_split(string txt, string pat, string* left, string* right)
supports simple text separation. If 'pat' is a substring of 'txt' the prefix
will be assigned to 'left' and the suffix to 'right'.
6. The following functions support the removement/extraction of HTML/XML-tags,
C-comments and spaces in a given text.
| string Line_withTag(string txt)
| string Line_withoutTag(string txt)
| string Line_withCCom(string txt)
| string Line_withCComText(string txt)
| string Line_withoutCCom(string txt)
| string Line_withoutWhite(string txt)
| string Line_clip[L|R](string txt)
7. Finally this module defines a set of functions for URI-Creation/Evaluation. ( RFC 2396 )
*/
#include "standard.h"
#include "symbols.h"
#include "hmap.h"
#include "otab.h"
#ifdef __cplusplus
extern "C" {
#endif
/* -------------------------- Single line scanner ------------------------- */
c_string Line_get(FILE *SysIn)
/* get a single line or NULL; allocs memory
All '\r', final '\n', trailing spaces and tabs
are removed and other tabs expanded.
Both (-1) and (0x1a) are treated as EOF-character.
*/
;
/* ------------------------ Split line & AWK -------------------------------- */
AbstractType( AWK ); /* Abstract AWK type */
ROW(c_string) StrToWords(c_string s)
/* get a row with all the words of line 's' */
;
void AWK_defKey(AWK awk, c_string key, void (*act)(ROW(c_string) wrd))
/* adds a line key / action pair to 'awk' */
;
AWK AWK_new(c_string Comment)
/* creates an AWK structure
parameter: comment key
*/
;
void AWK_free(AWK awk); /* frees 'awk' */
void AWK_apply(AWK awk, c_string FileName)
/* evaluates 'FileName' according to the rules in 'awk' */
;
/* -------------------------- Text substitution --------------------------- */
c_string Line_clipR(c_string txt)
/* removes trailing white space; allocs memory */
;
c_string Line_clipL(c_string txt)
/* removes leading white space; allocs memory */
;
c_string Line_clip(c_string txt)
/* removes trailing and leading white space; allocs memory */
;
c_string Line_withoutWhite(c_string txt)
/* removes white space; allocs memory */
;
c_string Line_withTok
(
c_string txt,
void (*getNextTokPos)(c_string s, c_string* ta, c_string* te)
)
/* get token text only or NULL; allocs memory */
;
c_string Line_withoutTok
(
c_string txt,
void (*getNextTokPos)(c_string s, c_string* ta, c_string* te)
)
/* get text without token or NULL; allocs memory */
;
c_string Line_withoutTag(c_string txt)
/* get text without HTML/XML-tags or NULL; allocs memory */
;
c_string Line_withCCom(c_string txt)
/* get C-comment only or NULL; allocs memory */
;
c_string Line_withCComText(c_string txt)
/* get C-comment text only or NULL; allocs memory */
;
c_string Line_withoutCCom(c_string txt)
/* get text without C-comment or NULL; allocs memory */
;
c_string Line_getCFunNam(c_string CDecl)
/* extracts C-function name or NULL; allocs memory
assertion: no comments in between 'CDecl'
evaluation from right to left:
... <Space> <ID> <Space> ( <Parameter> )
| ... ( ... <ID> ... ) ...\<ID> ( <Parameter> )
*/
;
c_string Line_replace(c_string txt, MAP(symbol,symbol) ReplaceRules)
/* replaces 'txt' according 'ReplaceRules'; allocs memory
assertion: disjunct keys
*/
;
c_bool Line_split(c_string txt, c_string pat, c_string* left, c_string* right)
/* separates 'txt'; allocs memory:
'txt' = 'pat' . suffix --> RC = true, *left=NULL, *right=suffix
'txt' = prefix . 'pat' --> RC = true, *left=prefix, *right=NULL
'txt' = prefix . 'pat' . suffix --> RC = true, *left=prefix, *right=suffix
else --> RC = false
*/
;
/* -------------------------- URI Generation & Evaluation ----------------- */
#define URI_SCHEME 0
#define URI_AUTHORITY 1
#define URI_PATH 2
#define URI_QUERY 3
#define URI_FRACTION 4
c_bool URI_hasFileScheme(MAP(long,symbol) parts)
/* whether URI has a file scheme */
;
void URI_setFileScheme(MAP(long,symbol) parts)
/* set URI scheme to file scheme */
;
c_bool URI_hasAuthority(MAP(long,symbol) parts)
/* whether URI has a non-empty authority */
;
c_bool URI_hasFraction(MAP(long,symbol) parts)
/* whether URI has a non-empty fraction */
;
void URI_setDftFraction(c_string dftfraction, MAP(long,symbol) parts)
/* set URI fraction to default fraction 'dftfraction', if non-defined */
;
c_string URI_getFraction(MAP(long,symbol) parts)
/* get URI fraction or NULL */
;
c_string URI_getPath(MAP(long,symbol) parts); /* get URI path or NULL */
void URI_setPath(c_string path, MAP(long,symbol) parts)
/* set URI path to 'path' */
;
int URI_EscToAscChar(c_string uri_part)
/* get ascii value of escaped character or -1 */
;
c_bool URI_isLocalFile(MAP(long,symbol) parts)
/* whether URI references a local file */
;
c_bool URI_isTreeLocalFile(c_string abspath, MAP(long,symbol) parts)
/* whether URI references a file within the local tree 'abspath' */
/* True <-->
(empty or file scheme) and empty authority and path located in tree
*/
;
void URI_desParts(c_string txt, MAP(long,symbol) parts)
/* destructs URI 'txt' to its components in 'parts' */
;
c_string URI_consParts(MAP(long,symbol) parts, c_bool localURI)
/* constructs URI from its components in 'parts'; allocs memory */
;
void URI_RelToAbs
(
c_string rel, c_string base, c_string doc, MAP(long,symbol) abs_parts
)
/* destructs relative URI 'rel' to its absolute components in 'parts' */
;
#ifdef __cplusplus
}
#endif
#endif
|