attr.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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: attr.h /main/1 1996/04/21 19:21:44 drk $ */
  24. /*
  25. * (c) Copyright 1993, 1994 Hewlett-Packard Company
  26. * (c) Copyright 1993, 1994 International Business Machines Corp.
  27. * (c) Copyright 1993, 1994 Novell, Inc.
  28. * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  29. */
  30. #ifndef _ATTR_H
  31. #define _ATTR_H
  32. #include <EUSCompat.h>
  33. #include "ansi_c.h"
  34. #include "csa.h"
  35. #include "cm.h"
  36. /*
  37. * types of reminder used by old versions
  38. */
  39. #define _DtCM_OLD_ATTR_BEEP_REMINDER "bp"
  40. #define _DtCM_OLD_ATTR_FLASH_REMINDER "fl"
  41. #define _DtCM_OLD_ATTR_MAIL_REMINDER "ml"
  42. #define _DtCM_OLD_ATTR_POPUP_REMINDER "op"
  43. /*
  44. * number of attributes for old and new format calendars
  45. */
  46. #define _DtCM_OLD_CAL_ATTR_SIZE 9
  47. #define _DtCM_OLD_ENTRY_ATTR_SIZE 19
  48. #define _DtCM_DEFINED_CAL_ATTR_SIZE 15
  49. #define _DtCM_DEFINED_ENTRY_ATTR_SIZE 34
  50. /*
  51. * "repeat forever" value used in old format calendars
  52. */
  53. #define _DtCM_OLD_REPEAT_FOREVER 999999999
  54. /*
  55. * Attribute number supported by old backends
  56. */
  57. typedef enum {
  58. _DtCm_old_attr_unknown,
  59. _DtCm_old_attr_id,
  60. _DtCm_old_attr_time,
  61. _DtCm_old_attr_type,
  62. _DtCm_old_attr_type2,
  63. _DtCm_old_attr_duration,
  64. _DtCm_old_attr_what,
  65. _DtCm_old_attr_author,
  66. _DtCm_old_attr_beep_reminder,
  67. _DtCm_old_attr_flash_reminder,
  68. _DtCm_old_attr_mail_reminder,
  69. _DtCm_old_attr_popup_reminder,
  70. _DtCm_old_attr_repeat_type,
  71. _DtCm_old_attr_repeat_times,
  72. _DtCm_old_attr_showtime,
  73. _DtCm_old_attr_status,
  74. _DtCm_old_attr_privacy,
  75. _DtCm_old_attr_repeat_nth_interval,
  76. _DtCm_old_attr_repeat_nth_weeknum,
  77. _DtCm_old_attr_end_date
  78. } _DtCm_old_attrs;
  79. /* attribute information structure */
  80. typedef struct {
  81. int index;
  82. CSA_enum type;
  83. int fst_vers; /* 1st data version supporting this
  84. * attr
  85. */
  86. _DtCm_old_attrs oldattr;
  87. boolean_t nex_ro; /* readonly for non-extensible file
  88. * version
  89. */
  90. boolean_t ex_ro; /* readonly for extensible file version
  91. */
  92. } _DtCmAttrInfo;
  93. /* calendar attribute information */
  94. extern _DtCmAttrInfo _CSA_cal_attr_info[];
  95. /* entry attribute information */
  96. extern _DtCmAttrInfo _CSA_entry_attr_info[];
  97. /*
  98. * external function declarations
  99. */
  100. extern CSA_return_code _DtCm_check_cal_csa_attributes P((
  101. int fvers,
  102. uint num_attrs,
  103. CSA_attribute *attrs,
  104. char *cname,
  105. boolean_t checkreadonly,
  106. boolean_t firsttime,
  107. boolean_t checkattrnum));
  108. extern CSA_return_code _DtCm_check_cal_cms_attributes P((
  109. int fvers,
  110. uint num_attrs,
  111. cms_attribute *attrs,
  112. char *owner,
  113. char *cname,
  114. boolean_t checkreadonly,
  115. boolean_t firsttime,
  116. boolean_t checkattrnum));
  117. extern CSA_return_code _DtCm_check_entry_attributes P((
  118. int fversion,
  119. uint size,
  120. CSA_attribute *attrs,
  121. CSA_flags utype,
  122. boolean_t checkattrnum));
  123. extern CSA_return_code _DtCm_check_entry_cms_attributes P((
  124. int fvers,
  125. uint num_attrs,
  126. cms_attribute *attrs,
  127. CSA_flags utype,
  128. boolean_t checkattrnum));
  129. extern CSA_return_code _DtCm_copy_cms_attributes P((
  130. uint srcsize,
  131. cms_attribute *srcattrs,
  132. uint *dstsize,
  133. cms_attribute **dstattrs));
  134. extern CSA_return_code _DtCm_copy_cms_attribute P((
  135. cms_attribute *to,
  136. cms_attribute *from,
  137. boolean_t copyname));
  138. extern CSA_return_code _DtCm_copy_cms_attr_val P((
  139. cms_attribute_value *from,
  140. cms_attribute_value **to));
  141. extern cms_access_entry *_DtCm_copy_cms_access_list P((
  142. cms_access_entry *alist));
  143. extern CSA_date_time_list _DtCm_copy_date_time_list P((
  144. CSA_date_time_list dlist));
  145. extern CSA_return_code _DtCm_cms2csa_attribute P((
  146. cms_attribute from,
  147. CSA_attribute *to));
  148. extern CSA_return_code _DtCm_cms2csa_attrval P((
  149. cms_attribute_value *from,
  150. CSA_attribute_value **to));
  151. extern CSA_return_code _DtCm_cms2csa_access_list P((
  152. cms_access_entry *cmslist,
  153. CSA_access_rights **csalist));
  154. extern CSA_return_code _DtCm_csa2cms_access_list P((
  155. CSA_access_rights *csalist,
  156. cms_access_entry **cmslist));
  157. extern CSA_return_code _DtCm_copy_reminder P((
  158. CSA_reminder *from,
  159. CSA_reminder **to));
  160. extern CSA_return_code _DtCm_copy_opaque_data P((
  161. CSA_opaque_data *from,
  162. CSA_opaque_data **to));
  163. extern void _DtCm_free_csa_access_list P((CSA_access_list alist));
  164. extern void _DtCm_free_cms_attributes P((
  165. uint size,
  166. cms_attribute *attrs));
  167. extern void _DtCm_free_attributes P((
  168. uint size,
  169. CSA_attribute * attrs));
  170. extern void _DtCm_free_cms_attribute_values P((
  171. uint size,
  172. cms_attribute *attrs));
  173. extern void _DtCm_free_attribute_values P((
  174. uint size,
  175. CSA_attribute *attrs));
  176. extern void _DtCm_free_cms_attribute_value P((
  177. cms_attribute_value *val));
  178. extern void _DtCm_free_attribute_value P((
  179. CSA_attribute_value *val));
  180. extern void _DtCm_free_cms_access_entry P((cms_access_entry *list));
  181. extern void _DtCm_free_date_time_list P((CSA_date_time_list list));
  182. extern void _DtCm_free_reminder P((CSA_reminder *val));
  183. extern void _DtCm_free_opaque_data P((CSA_opaque_data *val));
  184. extern char *_DtCm_old_reminder_name_to_name P((
  185. char *oldname));
  186. extern int _DtCm_old_reminder_name_to_index P((
  187. char *name));
  188. extern CSA_return_code _DtCm_get_old_attr_by_name P((
  189. char *name,
  190. _DtCm_old_attrs *attr));
  191. extern CSA_return_code _DtCm_get_old_attr_by_index P((
  192. int index,
  193. _DtCm_old_attrs *attr));
  194. extern CSA_return_code _DtCm_set_uint32_attrval P((
  195. uint numval,
  196. cms_attribute_value **val));
  197. extern CSA_return_code _DtCm_set_sint32_attrval P((
  198. int numval,
  199. cms_attribute_value **val));
  200. extern CSA_return_code _DtCm_set_string_attrval P((
  201. char *strval,
  202. cms_attribute_value **val,
  203. CSA_enum type));
  204. extern CSA_return_code _DtCm_set_user_attrval P((
  205. char *user,
  206. cms_attribute_value **val));
  207. extern CSA_return_code _DtCm_set_reminder_attrval P((
  208. CSA_reminder *remval,
  209. cms_attribute_value **val));
  210. extern CSA_return_code _DtCm_set_access_attrval P((
  211. cms_access_entry *aval,
  212. cms_attribute_value **val));
  213. extern CSA_return_code _DtCm_set_opaque_attrval P((
  214. CSA_opaque_data *opqval,
  215. cms_attribute_value **val));
  216. extern CSA_return_code _DtCm_set_csa_access_attrval P((
  217. cms_access_entry *aval,
  218. CSA_attribute_value **val));
  219. extern CSA_return_code _DtCm_set_csa_uint32_attrval P((
  220. uint numval,
  221. CSA_attribute_value **attrval));
  222. extern CSA_return_code _DtCm_set_csa_string_attrval P((
  223. char *strval,
  224. CSA_attribute_value **attrval,
  225. CSA_enum type));
  226. extern void _DtCm_get_attribute_types(uint size, int *types);
  227. #endif