death to trailing whitespace
[openafs.git] / src / WINNT / client_config / cellservdb.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef CELLSERVDB_H
11 #define CELLSERVDB_H
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */
16
17
18 /*
19  * DEFINITIONS ________________________________________________________________
20  *
21  */
22
23 typedef int BOOL;
24 #ifndef TRUE
25 #define TRUE 1
26 #endif
27 #ifndef FALSE
28 #define FALSE 0
29 #endif
30
31 #ifndef MAX_CSDB_PATH
32 #define MAX_CSDB_PATH 2048
33 #endif
34
35
36 #define cchCELLDBLINE  512
37
38 typedef struct CELLDBLINE CELLDBLINE, *PCELLDBLINE;
39 struct CELLDBLINE
40    {
41    char szLine[ cchCELLDBLINE ];
42    PCELLDBLINE pPrev;
43    PCELLDBLINE pNext;
44    };
45
46 typedef struct
47    {
48    char szFilename[ MAX_CSDB_PATH ];
49    BOOL fChanged;
50    PCELLDBLINE pFirst;
51    PCELLDBLINE pLast;
52    } CELLSERVDB, *PCELLSERVDB;
53
54 typedef struct
55    {
56    char szCell[ cchCELLDBLINE ];
57    char szLinkedCell[ cchCELLDBLINE ];
58    int ipServer;
59    char szComment[ cchCELLDBLINE ];
60    } CELLDBLINEINFO, *PCELLDBLINEINFO;
61
62
63 /*
64  * PROTOTYPES _________________________________________________________________
65  *
66  */
67
68 void CSDB_GetFileName (char *pszFilename);
69
70 BOOL CSDB_ReadFile (PCELLSERVDB pCellServDB, const char *pszFilename);
71 BOOL CSDB_WriteFile (PCELLSERVDB pCellServDB);
72 void CSDB_FreeFile (PCELLSERVDB pCellServDB);
73
74 BOOL CSDB_CrackLine (PCELLDBLINEINFO pInfo, const char *pszLine);
75 BOOL CSDB_FormatLine (char *pszLine, const char *pszCell, const char *pszLinkedCell, const char *pszComment, BOOL fIsCell);
76
77 PCELLDBLINE CSDB_FindCell (PCELLSERVDB pCellServDB, const char *pszCell);
78
79 BOOL CSDB_RemoveCell (PCELLSERVDB pCellServDB, PCELLDBLINE pCellLine);
80 BOOL CSDB_RemoveCellServers (PCELLSERVDB pCellServDB, PCELLDBLINE pCellLine);
81
82 PCELLDBLINE CSDB_AddCell (PCELLSERVDB pCellServDB, const char *pszCell, const char *pszLinkedCell, const char *pszComment);
83 PCELLDBLINE CSDB_AddCellServer (PCELLSERVDB pCellServDB, PCELLDBLINE pAddAfter, const char *pszAddress, const char *pszComment);
84
85 PCELLDBLINE CSDB_AddLine (PCELLSERVDB pCellServDB, PCELLDBLINE pAddAfter, const char *pszLine);
86 PCELLDBLINE CSDB_RemoveLine (PCELLSERVDB pCellServDB, PCELLDBLINE pRemove);
87
88
89 #ifdef __cplusplus
90 } /* extern "C" */
91 #endif /* __cplusplus */
92
93 #endif
94