source: rtems/cpukit/httpd/emfdb.h @ f26145b

4.104.114.84.95
Last change on this file since f26145b was 73b5bd5d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/15/04 at 13:33:58

Remove stray white spaces.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 *      emfdb.h -- EMF database compatability functions for GoAhead WebServer.
3 *
4 *      Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.
5 *
6 *      See the file "license.txt" for usage and redistribution license requirements
7 *
8 *      $Id$
9 */
10
11/******************************** Description *********************************/
12/*
13 *      Emf-like textfile database support for WebServer 2.1.
14 */
15
16/********************************* Includes ***********************************/
17
18#ifndef _h_EMFDB
19#define _h_EMFDB 1
20
21#ifndef UEMF
22        #include        "basic/basic.h"
23        #include        "emf/emf.h"
24#else
25        #include        "uemf.h"
26#endif
27
28
29/********************************* Defines ************************************/
30
31#define         T_INT                                   0
32#define         T_STRING                                1
33
34#define         DB_OK                                   0
35#define         DB_ERR_GENERAL                  -1
36#define         DB_ERR_COL_NOT_FOUND    -2
37#define         DB_ERR_COL_DELETED              -3
38#define         DB_ERR_ROW_NOT_FOUND    -4
39#define         DB_ERR_ROW_DELETED              -5
40#define         DB_ERR_TABLE_NOT_FOUND  -6
41#define         DB_ERR_TABLE_DELETED    -7
42#define         DB_ERR_BAD_FORMAT               -8
43
44typedef struct dbTable_s {
45        char_t  *name;
46        int             nColumns;
47        char_t  **columnNames;
48        int             *columnTypes;
49        int             nRows;
50        int             **rows;
51} dbTable_t;
52
53/********************************** Prototypes ********************************/
54
55/*
56 *      Add a schema to the module-internal schema database
57 */
58extern int              dbRegisterDBSchema(dbTable_t *sTable);
59
60extern int              dbOpen(char_t *databasename, char_t *filename,
61                                        int (*gettime)(int did), int flags);
62extern void             dbClose(int did);
63extern int              dbGetTableId(int did, char_t *tname);
64extern char_t   *dbGetTableName(int did, int tid);
65extern int              dbReadInt(int did, char_t *table, char_t *column, int row,
66                                        int *returnValue);
67extern int              dbReadStr(int did, char_t *table, char_t *column, int row,
68                                        char_t **returnValue);
69extern int              dbWriteInt(int did, char_t *table, char_t *column, int row,
70                                        int idata);
71extern int              dbWriteStr(int did, char_t *table, char_t *column, int row,
72                                        char_t *s);
73extern int              dbAddRow(int did, char_t *table);
74extern int              dbDeleteRow(int did, char_t *table, int rid);
75extern int              dbSetTableNrow(int did, char_t *table, int nNewRows);
76extern int              dbGetTableNrow(int did, char_t *table);
77
78/*
79 *      Dump the contents of a database to file
80 */
81extern int              dbSave(int did, char_t *filename, int flags);
82
83/*
84 *      Load the contents of a database to file
85 */
86extern int              dbLoad(int did, char_t *filename, int flags);
87
88/*
89 *      Search for a data in a given column
90 */
91extern int              dbSearchStr(int did, char_t *table, char_t *column,
92                                        char_t *value, int flags);
93
94extern void             dbZero(int did);
95
96extern char_t   *basicGetProductDir();
97extern void             basicSetProductDir(char_t *proddir);
98
99#endif /* _h_EMFDB */
100
101/******************************************************************************/
Note: See TracBrowser for help on using the repository browser.