Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtSvc / DtUtil1 / DbUtil.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*
24  * File:         DbUtil.h $XConsortium: DbUtil.h /main/4 1995/10/26 15:04:04 rswiston $
25  * Language:     C
26  *
27  * (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
28  *
29  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
30  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
31  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
32  * (c) Copyright 1993, 1994 Novell, Inc.                                *
33  */
34
35 #ifndef _Dt_DbUtil_h
36 #define _Dt_DbUtil_h
37
38 #include <X11/Intrinsic.h>              /* Boolean */
39
40 /* 
41  * This structure is used by many of the database functions.  It is used to
42  * specify a collection of filenames or directory names.  Each file/directory
43  * name is returned in two forms:
44  *
45  *  dirs[n]   The fully host-qualified pathname for the file or directory,
46  *            in "host:/path" format.
47  *
48  *  paths[n]  The internal format of the file or directory anme, which
49  *            can be passed to any of the standard tools which expect a
50  *            valid filename; i.e. /nfs/host/path.
51  *
52  *  Both of the arrays are NULL-terminated.
53  */
54 typedef struct {
55    char ** dirs;
56    char ** paths;
57 } DtDirPaths;
58
59
60
61 /*****************************************************************************
62  *
63  *
64  *
65  ****************************************************************************/
66 extern DtDirPaths * _DtFindMatchingFiles( DtDirPaths * dirs, 
67                                            char * suffix, 
68                                            Boolean sortFiles );
69
70 /*****************************************************************************
71  *
72  * _DtGetDatabaseDirPaths() returns a NULL-terminated array of directories,
73  * which are to be searched for database files.  The paths are obtained by
74  * querying the DTDATABASESEARCHPATH environment variable, which specifies
75  * a set of comma separated pathnames, int "host:/path" format.  The
76  * return structure should be freed up, when no longer needed, by invoking
77  * _DtFreeDatabaseDirPaths().
78  *
79  * The returned directory names are represented in two formats:
80  *
81  *     1) Fully host qualified; i.e. "host:/path"
82  *     2) Internal format; i.e. "/nfs/host/path"
83  *
84  ****************************************************************************/
85 extern DtDirPaths * _DtGetDatabaseDirPaths( void );
86
87 /*****************************************************************************
88  *
89  * _DtFreeDatabaseDirPaths() is used to free the memory occupied by the
90  * passed-in instance of the DtDirPaths structure.  Typically, this
91  * information was originally obtained by a call to DtGetDatabasePaths()
92  * or _DtFindMatchingFiles().
93  *
94  * Parameters:
95  *
96  *      dirs       The structure which is to be freed up.
97  *
98  ****************************************************************************/
99 extern void _DtFreeDatabaseDirPaths( DtDirPaths * dirs );
100
101 #endif /* _Dt_DbUtil_h */
102
103 /* DON'T ADD ANYTHING AFTER THIS #endif */