a99  V32.6
allegro Windows Hauptprogramm
 Alle Klassen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
abasew.hpp
gehe zur Dokumentation dieser Datei
1 // abase.hpp : Schreibfunktionen fuer die Datenbank
2 // 1996-04-02 : Saetze einer Datenbank schreiben, loeschen, sperren, freigeben
3 // Copyright 2011 Universitätsbibliothek Braunschweig, more see bottom
4 
5 // Klasse ABASE (c) UB Braunschweig 1995
6 
7 // Wird per #include in abase.hpp einbezogen
8 // Nur einzubinden, wenn Schreibfunktionen noetig sind
9 
10 // ================
11 // Weitere Methoden
12 // ================
13 
14 public:
15 
16 // Satz speichern
17 
18 int AwPut(RECORD *r, int modus=0); // %% write_out();
19 // wmodus = 0 : full operation, index and all (default)
20 // 1 : same, with message to Aerror
21 // 2 : no indexing
22 // 4 : no LOGging
23 // these modes can be ORed: 6 : no index, no LOG
24 //
25 // if(r->rNr==0L) : new record, else: updated record
26 
27 // return: EOF file not good
28 // 0 rec was not properly prepared / TBL locked
29 // gri number of fields of this rec
30 
31 
32 // Satz loeschen
33 // clear a rec, i.e. make space available and delete index entries
34 
35 int AwDel(RECNR recn, int md=3, RECORD *rec=(RECORD *)0);
36 // md = 2 : nur Loeschkontrolle, Result -1 falls negativ
37 // 3 : Kontrolle + Loeschung = default
38 // 1 : Loeschung ohne Kontrolle
39 // return: 0=record error,
40 // 1=ok,
41 // -1=loeschkontrolle negativ, d.h. keine Loeschung
42 // wenn rec nicht angegeben, legt Del ein temporaeres RECORD an
43 
44 // Satz sperren
45 
46 // ABASE::AwRecLock() / ABASE::RecUnlock() --------------------
47 // lock/unlock a record: write 8/1 to first byte
48 // result: -1 : problem with TBL
49 // 0 : recn out of range
50 // 1 : ok, rec is locked / already unlocked
51 // 8 : rec is already locked / ok, now unlocked
52 // 9 : rec is deleted, cannot be locked or unlocked
53 
54 int AwRecLock(RECNR recn,int md=0); // return -1 file error,
55 // 8,9 locked/deleted
56 // result: 1 for o.k.
57 // first byte of rec is now 8
58 
59 // Satz freigeben
60 
61 int AwRecUnlk(RECNR recn); // unlock current rec,
62 // result: 8 for o.k.,
63 // 1 : was not locked
64 // 9 : is deleted
65 // -1 : file error
66 
67 
68 int AwTlock(void); // lock the .TBL file
69 
70 void AwTunlock(void); // unlock .TBL
71 
72 
73 // ========= interne Dinge
74 private:
75 
76 FILE * Openf(int fnr); // open file_fnr.ALD for read/write
77 int OpenALD(int fnr); // open file_fnr.ALD als Handle
78 
79 int wrout(FILE *dataStream, int wmodus, int wf); // write into .ALD/.LOG
80 
81 int old_rec(void); // write back after EDIT
82 
83 int new_rec(void); // save a new rec
84 
85 void tbl_out(int fln,RECNR rn,long rd); // write rec addr to tbl
86 
87 void ald_out(FILE *fwr, RECNR rn); // write 4byte rec# to data file
88 
89 void timestamp(int md=0); // time stamping and number generating
90 // md==0: ohne Nummernvergabe 1=mit
91 // nutzt die Befehle ce,cn,cg,ci aus der CFG
92 
93 /*
94  Copyright 2011 Universitätsbibliothek Braunschweig
95 
96  Licensed under the Apache License, Version 2.0 (the "License");
97  you may not use this file except in compliance with the License.
98  You may obtain a copy of the License at
99 
100  http://www.apache.org/licenses/LICENSE-2.0
101 
102  Unless required by applicable law or agreed to in writing, software
103  distributed under the License is distributed on an "AS IS" BASIS,
104  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105  See the License for the specific language governing permissions and
106  limitations under the License.
107 */
108