Dts.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. /* $XConsortium: Dts.h /main/5 1996/03/05 13:30:59 drk $ */
  24. /*
  25. * (c) Copyright 1993, 1994 Hewlett-Packard Company
  26. * (c) Copyright 1993, 1994 International Business Machines Corp.
  27. * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  28. * (c) Copyright 1993, 1994 Novell, Inc.
  29. */
  30. #ifndef _Dt_Dts_h
  31. #define _Dt_Dts_h
  32. #include <sys/stat.h>
  33. #include <X11/Intrinsic.h>
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /*
  38. * Constants
  39. */
  40. #define DtDTS_DC_NAME "DATA_CRITERIA"
  41. #define DtDTS_NAME_PATTERN "NAME_PATTERN"
  42. #define DtDTS_PATH_PATTERN "PATH_PATTERN"
  43. #define DtDTS_CONTENT "CONTENT"
  44. #define DtDTS_MODE "MODE"
  45. #define DtDTS_LINK_PATH "LINK_PATH"
  46. #define DtDTS_LINK_NAME "LINK_NAME"
  47. #define DtDTS_DATA_ATTRIBUTES_NAME "DATA_ATTRIBUTES_NAME"
  48. #define DtDTS_DT_RECURSIVE_LINK "RECURSIVE_LINK"
  49. #define DtDTS_DT_BROKEN_LINK "BROKEN_LINK"
  50. #define DtDTS_DT_UNKNOWN "UNKNOWN"
  51. #define DtDTS_DA_IS_SYNTHETIC "IS_SYNTHETIC"
  52. #define DtDTS_DA_LABEL "LABEL"
  53. #define DtDTS_DA_NAME "DATA_ATTRIBUTES"
  54. #define DtDTS_DA_DESCRIPTION "DESCRIPTION"
  55. #define DtDTS_DA_DATA_HOST "DATA_HOST"
  56. #define DtDTS_DA_ICON "ICON"
  57. #define DtDTS_DA_INSTANCE_ICON "INSTANCE_ICON"
  58. #define DtDTS_DA_PROPERTIES "PROPERTIES"
  59. #define DtDTS_DA_ACTION_LIST "ACTIONS"
  60. #define DtDTS_DA_NAME_TEMPLATE "NAME_TEMPLATE"
  61. #define DtDTS_DA_MODE_TEMPLATE "MODE_TEMPLATE"
  62. #define DtDTS_DA_MOVE_TO_ACTION "MOVE_TO_ACTION"
  63. #define DtDTS_DA_COPY_TO_ACTION "COPY_TO_ACTION"
  64. #define DtDTS_DA_LINK_TO_ACTION "LINK_TO_ACTION"
  65. #define DtDTS_DA_IS_TEXT "IS_TEXT"
  66. #define DtDTS_DA_MEDIA "MEDIA"
  67. #define DtDTS_DA_MIME_TYPE "MIME_TYPE"
  68. #define DtDTS_DA_MIME_TO_MEDIA_FILTER "MIME_TO_MEDIA_FILTER"
  69. #define DtDTS_DA_MEDIA_TO_MIME_FILTER "MEDIA_TO_MIME_FILTER"
  70. #define DtDTS_DA_X400_TYPE "X400_TYPE"
  71. #define DtDTS_DA_X400_TO_MEDIA_FILTER "X400_TO_MEDIA_FILTER"
  72. #define DtDTS_DA_MEDIA_TO_X400_FILTER "MEDIA_TO_X400_FILTER"
  73. #define DtDTS_DA_IS_ACTION "IS_ACTION"
  74. #define DtDTS_DA_IS_EXECUTABLE "IS_EXECUTABLE"
  75. #define DtDTS_DT_DIR ".DtDirDataType"
  76. /*
  77. * Types
  78. */
  79. typedef struct _DtDtsAttribute
  80. {
  81. char *name;
  82. char *value;
  83. } DtDtsAttribute;
  84. /*
  85. * Functions
  86. */
  87. extern void DtDtsLoadDataTypes(void);
  88. extern void DtDtsRelease(void);
  89. extern char *DtDtsDataToDataType(
  90. const char *filepath,
  91. const void *buffer,
  92. const int size,
  93. const struct stat *stat_buff,
  94. const char *link_name,
  95. const struct stat *link_stat_buff,
  96. const char *opt_name);
  97. extern char *DtDtsFileToDataType(
  98. const char *filepath);
  99. extern char *DtDtsFileToAttributeValue(
  100. const char *filepath,
  101. const char *attr);
  102. extern DtDtsAttribute **DtDtsFileToAttributeList(
  103. const char *filepath);
  104. extern char *DtDtsBufferToDataType(
  105. const void *buffer,
  106. const int size,
  107. const char *opt_name);
  108. extern char *DtDtsBufferToAttributeValue(
  109. const void *buffer,
  110. const int size,
  111. const char *attr,
  112. const char *opt_name);
  113. extern DtDtsAttribute **DtDtsBufferToAttributeList(
  114. const void *buffer,
  115. const int size,
  116. const char *opt_name);
  117. extern char *DtDtsDataTypeToAttributeValue(
  118. const char *datatype,
  119. const char *attr,
  120. const char *opt_name);
  121. extern DtDtsAttribute **DtDtsDataTypeToAttributeList(
  122. const char *datatype,
  123. const char *opt_name);
  124. extern void DtDtsFreeDataTypeNames(
  125. char **namelist);
  126. extern void DtDtsFreeAttributeList(
  127. DtDtsAttribute **attr_list);
  128. extern void DtDtsFreeAttributeValue(
  129. char *attr_value);
  130. extern void DtDtsFreeDataType(
  131. char *datatype);
  132. extern char **DtDtsDataTypeNames(void);
  133. extern char **DtDtsFindAttribute(
  134. const char *name,
  135. const char *value);
  136. extern char *DtDtsSetDataType(
  137. const char *filepath,
  138. const char *datatype,
  139. const int override);
  140. extern int DtDtsDataTypeIsAction(
  141. const char *datatype);
  142. extern Boolean DtDtsIsTrue(
  143. const char *str);
  144. #ifdef __cplusplus
  145. }
  146. #endif
  147. #endif /* _Dt_Dts_h */