a99  V32.6
allegro Windows Hauptprogramm
 Alle Klassen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
utility.hpp
gehe zur Dokumentation dieser Datei
1 // utility.hpp : Unterprogramme fuer Hilfsfunktionen
2 // 1995
3 // Copyright 2011 Universitätsbibliothek Braunschweig, more see bottom
4 
5 // Function prototypes
6 
7 #include "includes.h"
8 // Index-Sachen
9 //#include "ai-const.h" // Konstanten
10 
11 #define __UTIL
12 
13 
14 #ifdef UNIX
15 // f. Dateioeffnung im shared mode
16 #define O_DENYNONE 64
17 
18 #endif
19 
20 
21 void UtLower(CHAR *); // turn whole string into lower
22 
23 void UtUpper(CHAR *); // turn whole string into upper
24 
25 
26 #ifdef UNIX
27 #define __min(x,y) ((x) < (y) ? (x) : (y))
28 #define __max(x,y) ((x) > (y) ? (x) : (y))
29 void Ulowtype(CHAR *); // turn file type into small letters
30 
31 int isSpace(char a); // is a a space?
32 int isSpace(CHAR a);
33 int sperre_einaus(int fd, int kdo, int sperr_typ,off_t offset, int wie, off_t laenge);
34 
35 #endif
36 
37 #define isSpace(x) isspace(x)
38 
39 void UtRemsp(CHAR *); // remove trailing spaces
40 
41 void UtRemspB(CHAR *string,CHAR rem); // remove all chars "rem" at start of string
42 
43 // f. Param. und CFG
44 void UtRemCom(char *); // remove comments preceded by 2 spaces, xcpt quoted text.
45 
46 int uifRead(char,char *dir=".\\"); // read uif texts
47 
48 
49 // Ende einer Zeichenfolge finden und mit 0 markieren
50 void UtEndSf(char *, char); // u=Zeichenfolge, e= Endzeichen, z.B. Code 31
51 
52 // Akzente vertauschen (Unicode)
53 
54 void UtAccent(char *,char *,int);
55 
56 
57 void UtRange(RECNR lMin,RECNR & lValue,RECNR lMax); // lValue in die Grenzen zwischen lMin und lMax zwingen
58 
59 
60 // F Space: #u variables
61 // Background management / Hintergrund- oder Reservespeicher
62 
63 bool UtFIns(CHAR *w, int tgl=2); // insert w = #uxyINHALT
64 
65 bool UtFInsSub(CHAR *fA,CHAR *w); // fA = Datenfeld, w= $aText
66 
67 bool UtFInsSf(CHAR *w, int tgl=2); // insert w = $a-#uxyINHALT
68 
69 // umstaendlicher, wird nur intern gebraucht:
70 bool UtFinst(CHAR *wc, int f, int tgl); // insert field beginning at CHAR into fa[]
71 // f is field's internal number according to CFG, frueher: finst.
72 // fuer die #u-Variablen: #uax hat interne Nr. f=2049 (=2049 +a -97)
73 
74 void UtFdel(int); // delete field i from background space, (frueher: fdel)
75 
76 void UtFDel(char); // delete all #ucx, (frueher: fDel
77 
78 CHAR *UtFind(char *kat); // find kat="#uxy" in background store, (frueher fAdr)
79 
80 int UtFindI(CHAR *kat, int lg=4); // find kat="#uxy" in background store, ret index
81 
82 int UtFindX(int,CHAR,int); // find a background string's number
83 
84 
85 
86 // Phrase management
87 
88 int UtPinst(CHAR *t,int i); // insert text t as phrase i into phrase field
89 
90 
91 void UtPdel(int i); // delete phrase i
92 
93 
94 int UtPfind(int i); // find internal number of phrase i
95 
96 
97 
98 // Umrechnungen String -- Zahl
99 
100 void UtRecn4(RECNR r,CHAR *addr); // write r as 4 bytes to addr
101 
102 
103 void UtKitoa(int n,CHAR *); // turn n into a string
104 void UtKitoa5(int n,CHAR *); // turn n into a 5byte string
105 
106 
107 // Zahl rp in 4 Byte umwandeln, high-low
108 void UtLong2char(long rp,CHAR *a);
109 
110 // aufsteigend sortieren: Vergl.Funktion
111 
112 int UtCompstr(void const*, void const*);
113 
114 
115 
116 // absteigend sortieren: Vergl.Funktion
117 
118 int UtComprstr(void const *, void const *);
119 
120 
121 // long Zahlen sortieren
122 
123 int UtComplong(void const *, void const *);
124 
125 /*
126  Copyright 2011 Universitätsbibliothek Braunschweig
127 
128  Licensed under the Apache License, Version 2.0 (the "License");
129  you may not use this file except in compliance with the License.
130  You may obtain a copy of the License at
131 
132  http://www.apache.org/licenses/LICENSE-2.0
133 
134  Unless required by applicable law or agreed to in writing, software
135  distributed under the License is distributed on an "AS IS" BASIS,
136  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137  See the License for the specific language governing permissions and
138  limitations under the License.
139 */
140