DbUtil.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 libraries 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. #ifndef _Dt_DbUtil_h
  35. #define _Dt_DbUtil_h
  36. #include <X11/Intrinsic.h> /* Boolean */
  37. /*
  38. * This structure is used by many of the database functions. It is used to
  39. * specify a collection of filenames or directory names. Each file/directory
  40. * name is returned in two forms:
  41. *
  42. * dirs[n] The fully host-qualified pathname for the file or directory,
  43. * in "host:/path" format.
  44. *
  45. * paths[n] The internal format of the file or directory anme, which
  46. * can be passed to any of the standard tools which expect a
  47. * valid filename; i.e. /nfs/host/path.
  48. *
  49. * Both of the arrays are NULL-terminated.
  50. */
  51. typedef struct {
  52. char ** dirs;
  53. char ** paths;
  54. } DtDirPaths;
  55. /*****************************************************************************
  56. *
  57. *
  58. *
  59. ****************************************************************************/
  60. extern DtDirPaths * _DtFindMatchingFiles( DtDirPaths * dirs,
  61. char * suffix,
  62. Boolean sortFiles );
  63. /*****************************************************************************
  64. *
  65. * _DtGetDatabaseDirPaths() returns a NULL-terminated array of directories,
  66. * which are to be searched for database files. The paths are obtained by
  67. * querying the DTDATABASESEARCHPATH environment variable, which specifies
  68. * a set of comma separated pathnames, int "host:/path" format. The
  69. * return structure should be freed up, when no longer needed, by invoking
  70. * _DtFreeDatabaseDirPaths().
  71. *
  72. * The returned directory names are represented in two formats:
  73. *
  74. * 1) Fully host qualified; i.e. "host:/path"
  75. * 2) Internal format; i.e. "/nfs/host/path"
  76. *
  77. ****************************************************************************/
  78. extern DtDirPaths * _DtGetDatabaseDirPaths( void );
  79. /*****************************************************************************
  80. *
  81. * _DtFreeDatabaseDirPaths() is used to free the memory occupied by the
  82. * passed-in instance of the DtDirPaths structure. Typically, this
  83. * information was originally obtained by a call to DtGetDatabasePaths()
  84. * or _DtFindMatchingFiles().
  85. *
  86. * Parameters:
  87. *
  88. * dirs The structure which is to be freed up.
  89. *
  90. ****************************************************************************/
  91. extern void _DtFreeDatabaseDirPaths( DtDirPaths * dirs );
  92. #endif /* _Dt_DbUtil_h */
  93. /* DON'T ADD ANYTHING AFTER THIS #endif */