2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 /* $XConsortium: convert5-4.c /main/2 1996/10/07 15:57:11 drk $ */
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.
31 #include <EUSCompat.h>
35 #include "convert4-5.h"
36 #include "convert5-4.h"
42 * Routines to convert data types used in version 5 to version 4.
45 /*****************************************************************************
47 *****************************************************************************/
50 * attributes are checked before calling this routine
51 * so all attributes should be supported in v4
53 extern CSA_return_code
54 _DtCm_cmsattrs_to_apptdata(uint size, cms_attribute *attrs, Appt_4 *appt)
56 CSA_return_code stat = CSA_SUCCESS;
63 * this routine is called to convert valid v2 to v4 attributes
64 * so no checking of CSA_E_INVALID_ATTRIBUTE and
65 * CSA_E_UNSUPPORTED_ATTRIBUTE is necessary
68 /* assuming all appt data is available */
71 if (_csa_iso8601_to_tick(
72 attrs[CSA_ENTRY_ATTR_START_DATE_I].value->item.date_time_value,
74 return (CSA_E_INVALID_DATE_TIME);
77 aptr = &attrs[CSA_ENTRY_ATTR_END_DATE_I];
78 if (aptr->value && aptr->value->item.date_time_value &&
79 *(aptr->value->item.date_time_value))
81 if (_csa_iso8601_to_tick(aptr->value->item.date_time_value,
83 return (CSA_E_INVALID_DATE_TIME);
85 appt->duration = endtick - appt->appt_id.tick;
89 aptr = &attrs[CSA_ENTRY_ATTR_REFERENCE_IDENTIFIER_I];
90 if (aptr->value && aptr->value->item.opaque_data_value &&
91 aptr->value->item.opaque_data_value->size > 0)
93 strncpy(buf, (char *)aptr->value->item.opaque_data_value->data,
94 aptr->value->item.opaque_data_value->size);
95 buf[aptr->value->item.opaque_data_value->size] = '\0';
97 ptr = strchr(buf, ':');
101 appt->appt_id.key = atol(buf);
104 return (CSA_E_INVALID_ATTRIBUTE_VALUE);
106 /* _DtCm_old_attr_type */
107 if ((stat = _DtCm_attrs_to_eventtype4(
108 attrs[CSA_ENTRY_ATTR_TYPE_I].value,
109 attrs[CSA_ENTRY_ATTR_SUBTYPE_I].value, appt->tag)) != CSA_SUCCESS)
112 /* _DtCm_old_attr_what */
113 aptr = &attrs[CSA_ENTRY_ATTR_SUMMARY_I];
114 if (aptr->value->item.string_value) {
115 if ((string = strdup(aptr->value->item.string_value)) == NULL)
116 return (CSA_E_INSUFFICIENT_MEMORY);
124 /* _DtCm_old_attr_author */
125 aptr = &attrs[CSA_ENTRY_ATTR_ORGANIZER_I];
126 if (aptr->value && aptr->value->item.calendar_user_value) {
127 if ((string = strdup(aptr->value->item.calendar_user_value))
129 return (CSA_E_INSUFFICIENT_MEMORY);
133 appt->author = string;
137 /* _DtCm_old_attr_beep_reminder */
138 aptr = &attrs[CSA_ENTRY_ATTR_AUDIO_REMINDER_I];
139 if (aptr->value && aptr->value->item.reminder_value) {
140 if ((stat = _DtCm_add_reminder(_DtCM_OLD_ATTR_BEEP_REMINDER,
141 aptr->value->item.reminder_value, appt)) != CSA_SUCCESS)
145 /* _DtCm_old_attr_flash_reminder */
146 aptr = &attrs[CSA_ENTRY_ATTR_FLASHING_REMINDER_I];
147 if (aptr->value && aptr->value->item.reminder_value) {
148 if ((stat = _DtCm_add_reminder(_DtCM_OLD_ATTR_FLASH_REMINDER,
149 aptr->value->item.reminder_value, appt)) != CSA_SUCCESS)
153 /* _DtCm_old_attr_mail_reminder */
154 aptr = &attrs[CSA_ENTRY_ATTR_MAIL_REMINDER_I];
155 if (aptr->value && aptr->value->item.reminder_value) {
156 if ((stat = _DtCm_add_reminder(_DtCM_OLD_ATTR_MAIL_REMINDER,
157 aptr->value->item.reminder_value, appt)) != CSA_SUCCESS)
161 /* _DtCm_old_attr_popup_reminder */
162 aptr = &attrs[CSA_ENTRY_ATTR_POPUP_REMINDER_I];
163 if (aptr->value && aptr->value->item.reminder_value) {
164 if ((stat = _DtCm_add_reminder(_DtCM_OLD_ATTR_POPUP_REMINDER,
165 aptr->value->item.reminder_value, appt)) != CSA_SUCCESS)
169 /* _DtCm_old_attr_repeat_type */
170 if (_DtCm_rtype_to_interval4(
171 attrs[CSA_X_DT_ENTRY_ATTR_REPEAT_TYPE_I].value->item.sint32_value,
172 &appt->period.period))
173 return (CSA_E_INVALID_ATTRIBUTE_VALUE);
175 /* _DtCm_old_attr_repeat_times */
176 aptr = &attrs[CSA_X_DT_ENTRY_ATTR_REPEAT_TIMES_I];
178 appt->ntimes = aptr->value->item.uint32_value;
180 if (appt->period.period != single_4 &&
181 appt->ntimes == CSA_X_DT_DT_REPEAT_FOREVER) {
182 appt->ntimes = _DtCM_OLD_REPEAT_FOREVER;
185 /* _DtCm_old_attr_showtime */
186 aptr = &attrs[CSA_X_DT_ENTRY_ATTR_SHOWTIME_I];
188 appt->tag->showtime = aptr->value->item.sint32_value;
190 /* _DtCm_old_attr_status */
191 if (_DtCm_status_to_apptstatus4(
192 attrs[CSA_ENTRY_ATTR_STATUS_I].value->item.uint32_value,
194 return (CSA_E_INVALID_ATTRIBUTE_VALUE);
196 /* _DtCm_old_attr_privacy */
197 if (_DtCm_classification_to_privacy4(
198 attrs[CSA_ENTRY_ATTR_CLASSIFICATION_I].value->item.uint32_value,
200 return (CSA_E_INVALID_ATTRIBUTE_VALUE);
202 /* _DtCm_old_attr_end_date */
203 aptr = &attrs[CSA_X_DT_ENTRY_ATTR_SEQUENCE_END_DATE_I];
204 if (aptr->value && aptr->value->item.date_time_value &&
205 *(aptr->value->item.date_time_value))
207 if (_csa_iso8601_to_tick(aptr->value->item.date_time_value,
208 &appt->period.enddate))
209 return (CSA_E_INVALID_DATE_TIME);
212 switch (appt->period.period) {
214 /* _DtCm_old_attr_repeat_nth_weeknum */
215 aptr = &attrs[CSA_X_DT_ENTRY_ATTR_REPEAT_OCCURRENCE_NUM_I];
217 appt->period.nth = aptr->value->item.sint32_value;
221 case everyNthMonth_4:
222 /* _DtCm_old_attr_repeat_nth_interval */
223 aptr = &attrs[CSA_X_DT_ENTRY_ATTR_REPEAT_INTERVAL_I];
225 appt->period.nth = aptr->value->item.uint32_value;
228 appt->period.nth = 0;
235 * ** need to check whether value is valid
237 extern CSA_return_code
238 _DtCm_attrs_to_apptdata(uint size, CSA_attribute *attrs, Appt_4 *appt)
240 CSA_return_code stat = CSA_SUCCESS;
241 _DtCm_old_attrs oldattr;
243 int interval = 0, week_num = 0, i;
244 boolean_t set_interval = B_FALSE, set_weeknum = B_FALSE;
246 int tindex = 0, stindex = 0;
247 CSA_attribute_value otype;
249 for (i = 0; i < size && stat == CSA_SUCCESS; i++) {
251 if (attrs[i].name == NULL)
254 if ((stat = _DtCm_get_old_attr_by_name(attrs[i].name, &oldattr))
259 case _DtCm_old_attr_id:
260 stat = CSA_E_READONLY;
263 case _DtCm_old_attr_time:
264 if (attrs[i].value == NULL ||
265 attrs[i].value->item.date_time_value == NULL ||
266 _csa_iso8601_to_tick(
267 attrs[i].value->item.date_time_value,
268 &appt->appt_id.tick))
269 stat = CSA_E_INVALID_DATE_TIME;
271 case _DtCm_old_attr_type:
272 if (attrs[i].value == NULL)
273 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
277 case _DtCm_old_attr_type2:
280 case _DtCm_old_attr_duration:
281 if (attrs[i].value == NULL)
283 else if (attrs[i].value->item.date_time_value
284 == NULL || _csa_iso8601_to_tick(
285 attrs[i].value->item.date_time_value,
287 stat = CSA_E_INVALID_DATE_TIME;
289 case _DtCm_old_attr_what:
290 if (attrs[i].value && attrs[i].value->item.string_value)
292 if ((string = strdup(
293 attrs[i].value->item.string_value))
295 stat = CSA_E_INSUFFICIENT_MEMORY;
303 case _DtCm_old_attr_author:
304 stat = CSA_E_READONLY;
307 case _DtCm_old_attr_beep_reminder:
308 if (attrs[i].value == NULL)
309 stat = _DtCm_remove_reminder(
310 _DtCM_OLD_ATTR_BEEP_REMINDER, appt);
311 else if (attrs[i].value->item.reminder_value == NULL)
312 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
314 stat = _DtCm_add_reminder(
315 _DtCM_OLD_ATTR_BEEP_REMINDER,
316 attrs[i].value->item.reminder_value,
320 case _DtCm_old_attr_flash_reminder:
321 if (attrs[i].value == NULL)
322 stat = _DtCm_remove_reminder(
323 _DtCM_OLD_ATTR_FLASH_REMINDER, appt);
324 else if (attrs[i].value->item.reminder_value == NULL)
325 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
327 stat = _DtCm_add_reminder(
328 _DtCM_OLD_ATTR_FLASH_REMINDER,
329 attrs[i].value->item.reminder_value,
333 case _DtCm_old_attr_mail_reminder:
334 if (attrs[i].value == NULL)
335 stat = _DtCm_remove_reminder(
336 _DtCM_OLD_ATTR_MAIL_REMINDER, appt);
337 else if (attrs[i].value->item.reminder_value == NULL)
338 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
340 stat = _DtCm_add_reminder(
341 _DtCM_OLD_ATTR_MAIL_REMINDER,
342 attrs[i].value->item.reminder_value,
346 case _DtCm_old_attr_popup_reminder:
347 if (attrs[i].value == NULL)
348 stat = _DtCm_remove_reminder(
349 _DtCM_OLD_ATTR_POPUP_REMINDER, appt);
350 else if (attrs[i].value->item.reminder_value == NULL)
351 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
353 stat = _DtCm_add_reminder(
354 _DtCM_OLD_ATTR_POPUP_REMINDER,
355 attrs[i].value->item.reminder_value,
359 case _DtCm_old_attr_repeat_type:
360 if (attrs[i].value == NULL)
361 appt->period.period = single_4;
362 else if (_DtCm_rtype_to_interval4(
363 attrs[i].value->item.sint32_value,
364 &appt->period.period))
365 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
367 case _DtCm_old_attr_repeat_times:
368 if (attrs[i].value == NULL)
372 attrs[i].value->item.uint32_value;
374 case _DtCm_old_attr_showtime:
375 if (attrs[i].value == NULL)
376 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
378 appt->tag->showtime =
379 attrs[i].value->item.sint32_value;
381 case _DtCm_old_attr_status:
382 if (attrs[i].value == NULL)
383 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
384 else if (_DtCm_status_to_apptstatus4(
385 attrs[i].value->item.sint32_value,
387 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
389 case _DtCm_old_attr_privacy:
390 if (attrs[i].value == NULL)
391 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
392 else if (_DtCm_classification_to_privacy4(
393 attrs[i].value->item.sint32_value,
395 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
397 case _DtCm_old_attr_repeat_nth_interval:
398 if (attrs[i].value != NULL) {
399 set_interval = B_TRUE;
400 interval = attrs[i].value->item.uint32_value;
403 case _DtCm_old_attr_repeat_nth_weeknum:
404 if (attrs[i].value != NULL) {
405 set_weeknum = B_TRUE;
406 week_num = attrs[i].value->item.sint32_value;
409 case _DtCm_old_attr_end_date:
410 if (attrs[i].value == NULL)
411 appt->period.enddate = 0;
412 else if (attrs[i].value->item.date_time_value == NULL ||
413 _csa_iso8601_to_tick(
414 attrs[i].value->item.date_time_value,
415 &appt->period.enddate))
416 stat = CSA_E_INVALID_DATE_TIME;
419 stat = CSA_E_INVALID_PARAMETER;
423 if (stat == CSA_SUCCESS) {
425 if (tindex || stindex) {
427 otype.type = CSA_VALUE_SINT32;
428 switch (appt->tag->tag) {
431 otype.item.sint32_value =
435 otype.item.sint32_value = CSA_TYPE_TODO;
439 otype.item.sint32_value =
444 stat = _DtCm_attrs_to_eventtype4(
445 (cms_attribute_value *)
446 (tindex ? attrs[tindex].value : &otype),
447 (cms_attribute_value *)
448 (stindex ? attrs[stindex].value : NULL),
452 if (stat == CSA_SUCCESS) {
454 appt->duration = endtick - appt->appt_id.tick;
455 /* make sure duration is positive */
456 if (appt->duration < 0)
457 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
460 if (appt->period.period != single_4 &&
461 appt->ntimes == CSA_X_DT_DT_REPEAT_FOREVER) {
462 appt->ntimes = _DtCM_OLD_REPEAT_FOREVER;
465 switch (appt->period.period) {
467 if (set_weeknum == B_TRUE)
468 appt->period.nth = week_num;
472 case everyNthMonth_4:
473 if (set_interval == B_TRUE)
474 appt->period.nth = interval;
477 appt->period.nth = 0;
485 extern CSA_return_code
486 _DtCm_cms_entry_to_appt4(cms_entry *entry, Appt_4 **appt4_r)
488 CSA_return_code stat;
491 if (entry == NULL || appt4_r == NULL)
492 return (CSA_E_INVALID_PARAMETER);
494 if ((appt = _DtCm_make_appt4(B_TRUE)) == NULL)
495 return (CSA_E_INSUFFICIENT_MEMORY);
497 if ((stat = _DtCm_cmsattrs_to_apptdata(entry->num_attrs, entry->attrs,
498 appt)) != CSA_SUCCESS) {
499 _DtCm_free_appt4(appt);
503 return (CSA_SUCCESS);
507 extern CSA_return_code
508 _DtCm_attrs_to_appt4(uint num_attrs, CSA_attribute *attrs, Appt_4 **appt4_r)
510 CSA_return_code stat;
514 return (CSA_E_INVALID_PARAMETER);
516 if ((appt = _DtCm_make_appt4(B_TRUE)) == NULL)
517 return (CSA_E_INSUFFICIENT_MEMORY);
519 if ((stat = _DtCm_attrs_to_apptdata(num_attrs, attrs, appt)) != CSA_SUCCESS) {
520 _DtCm_free_appt4(appt);
524 return (CSA_SUCCESS);
528 extern CSA_return_code
529 _DtCm_scope_to_options4(CSA_enum scope, Options_4 *opt)
532 return (CSA_E_INVALID_PARAMETER);
541 case CSA_SCOPE_FORWARD:
545 return (CSA_E_INVALID_ENUM);
548 return (CSA_SUCCESS);
551 extern CSA_return_code
552 _DtCm_csaaccesslist_toaccessentry4(CSA_access_list alist, Access_Entry_4 **a4)
554 CSA_return_code stat = CSA_SUCCESS;
555 Access_Entry_4 *to, *prev, *head;
558 while (alist != NULL) {
559 if ((to = (Access_Entry_4 *)calloc(1, sizeof(Access_Entry_4)))
561 stat = CSA_E_INSUFFICIENT_MEMORY;
565 if ((to->access_type = _DtCmAccessRightToV4AccessType(
566 alist->rights)) < 0) {
567 stat = CSA_E_INVALID_FLAG;
571 if (alist->user == NULL || alist->user->user_name == NULL) {
572 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
576 if ((to->who = strdup(alist->user->user_name)) == NULL) {
578 stat = CSA_E_INSUFFICIENT_MEMORY;
592 if (stat != CSA_SUCCESS) {
593 _DtCm_free_access_list4(head);
602 _DtCm_rtype_to_interval4(int val, Interval_4 *period)
605 case CSA_X_DT_REPEAT_ONETIME:
608 case CSA_X_DT_REPEAT_WEEKLY:
611 case CSA_X_DT_REPEAT_DAILY:
614 case CSA_X_DT_REPEAT_BIWEEKLY:
615 *period = biweekly_4;
617 case CSA_X_DT_REPEAT_MONTHLY_BY_DATE:
620 case CSA_X_DT_REPEAT_YEARLY:
623 case CSA_X_DT_REPEAT_MONTHLY_BY_WEEKDAY:
624 *period = nthWeekday_4;
626 case CSA_X_DT_REPEAT_EVERY_NDAY:
627 *period = everyNthDay_4;
629 case CSA_X_DT_REPEAT_EVERY_NWEEK:
630 *period = everyNthWeek_4;
632 case CSA_X_DT_REPEAT_EVERY_NMONTH:
633 *period = everyNthMonth_4;
635 case CSA_X_DT_REPEAT_MON_TO_FRI:
636 *period = monThruFri_4;
638 case CSA_X_DT_REPEAT_MONWEDFRI:
639 *period = monWedFri_4;
641 case CSA_X_DT_REPEAT_TUETHUR:
644 case CSA_X_DT_REPEAT_WEEKDAYCOMBO:
645 *period = daysOfWeek_4;
647 case CSA_X_DT_REPEAT_OTHER:
648 *period = otherPeriod_4;
657 _DtCm_status_to_apptstatus4(int val, Appt_Status_4 *astat)
660 case CSA_X_DT_STATUS_ACTIVE:
663 case CSA_STATUS_COMPLETED:
664 *astat = completed_4;
666 case CSA_X_DT_STATUS_CANCELLED:
667 *astat = cancelled_4;
669 case CSA_X_DT_STATUS_COMMITTED:
670 *astat = committed_4;
672 case CSA_X_DT_STATUS_ADD_PENDING:
673 *astat = pendingAdd_4;
675 case CSA_X_DT_STATUS_DELETE_PENDING:
676 *astat = pendingDelete_4;
686 _DtCm_classification_to_privacy4(int val, Privacy_Level_4 *privacy)
689 case CSA_CLASS_PUBLIC:
692 case CSA_CLASS_CONFIDENTIAL:
693 *privacy = semiprivate_4;
695 case CSA_CLASS_PRIVATE:
696 *privacy = private_4;
705 extern CSA_return_code
706 _DtCm_attrs_to_eventtype4(
707 cms_attribute_value *type,
708 cms_attribute_value *stype,
711 CSA_return_code stat = CSA_SUCCESS;
714 switch (type->item.uint32_value) {
717 if (stype && stype->item.string_value) {
718 if (strcmp(stype->item.string_value,
719 CSA_SUBTYPE_APPOINTMENT) == 0)
720 tag->tag = appointment_4;
721 else if (strcmp(stype->item.string_value,
722 CSA_SUBTYPE_HOLIDAY) == 0)
723 tag->tag = holiday_4;
725 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
727 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
733 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
738 case CSA_X_DT_TYPE_OTHER:
741 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
743 tag->tag = otherTag_4;
747 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
750 stat = CSA_E_INVALID_ATTRIBUTE_VALUE;
756 * Get rid of the given reminder in the appt.
758 extern CSA_return_code
759 _DtCm_remove_reminder(char *rem, Appt_4 *appt)
761 Attribute_4 *attr, *prev;
763 for (attr = prev = appt->attr; attr != NULL; attr = attr->next) {
764 if (strcmp(attr->attr, rem) == 0) {
766 appt->attr = attr->next;
768 prev->next = attr->next;
771 _DtCm_free_attr4(attr);
776 return (CSA_SUCCESS);
780 * If the corresponding attribute exists already, replace it.
782 extern CSA_return_code
783 _DtCm_add_reminder(char *rem, CSA_reminder * val, Appt_4 *appt)
785 Attribute_4 *newattr, *attrs, *prev = NULL;
790 if ((val->snooze_time && val->snooze_time[0] != NULL)
791 || val->repeat_count > 1)
792 return (CSA_E_INVALID_ATTRIBUTE_VALUE);
795 if ((newattr = calloc(1, sizeof(Attribute_4))) == NULL)
796 return (CSA_E_INSUFFICIENT_MEMORY);
798 if ((newattr->attr = strdup(rem)) == NULL) {
800 return (CSA_E_INSUFFICIENT_MEMORY);
803 /* convert lead_time to advance value */
805 _csa_iso8601_to_duration(val->lead_time, <ime);
806 sprintf(adv, "%d", ltime);
808 if ((newattr->value = strdup(adv)) == NULL) {
809 _DtCm_free_attr4(newattr);
810 return (CSA_E_INSUFFICIENT_MEMORY);
813 if (val->reminder_data.size > 0) {
814 if ((newattr->clientdata = malloc(val->reminder_data.size + 1))
816 _DtCm_free_attr4(newattr);
817 return (CSA_E_INSUFFICIENT_MEMORY);
819 memcpy(newattr->clientdata, val->reminder_data.data,
820 val->reminder_data.size);
821 newattr->clientdata[val->reminder_data.size] = '\0';
823 } else if ((newattr->clientdata = calloc(1,1)) == NULL) {
824 _DtCm_free_attr4(newattr);
825 return (CSA_E_INSUFFICIENT_MEMORY);
828 for (attrs = appt->attr; attrs != NULL; attrs = attrs->next) {
829 if (strcmp(attrs->attr, rem) == 0) {
831 newattr->next = attrs->next;
833 appt->attr = newattr;
835 prev->next = newattr;
838 _DtCm_free_attr4(attrs);
846 newattr->next = appt->attr;
847 appt->attr = newattr;
850 return (CSA_SUCCESS);
854 _DtCmAccessRightToV4AccessType(unsigned int access)
856 int newaccess = access_none_4;
859 access & ~(CSA_X_DT_BROWSE_ACCESS | CSA_X_DT_INSERT_ACCESS |
860 CSA_X_DT_DELETE_ACCESS))
863 if (access & CSA_X_DT_BROWSE_ACCESS)
864 newaccess |= access_read_4;
865 if (access & CSA_X_DT_INSERT_ACCESS)
866 newaccess |= access_write_4;
867 if (access & CSA_X_DT_DELETE_ACCESS)
868 newaccess |= access_delete_4;