CSACSA(5)
π csa/csa.h π β calendar and appointment services definitions
okay so real talk, this is csa/csa.h from section 5, the file formats girlies β¨ (yes, that's the manual section, we're in header-file territory, iykyk). Consider this your little tour of the calendar and appointment services definitions β the header that makes all the calendar magic possible ποΈπ¦
πΈ NAME πΈ
csa/csa.h β calendar and appointment services definitions π
that's it. that's the whole vibe. it's the header where the calendar-and-appointment-services of it all gets defined. iconic, honestly π
β¨ SYNOPSIS β¨
okay bestie, the way you actually summon this thing into your code is literally one line, no cap:
#include <csa/csa.h>
one #include, that's the whole ritual π pop it at the top of your file and you're in. so clean. so slay. the compiler does the rest, that's its job, not yours π«Ά
π¦ DESCRIPTION π¦
so here's the tea β β the csa/csa.h header defines the following data types through typedef:
β¦and that's where the actual list of types lives, which is coming up in the next bit β¨ keep scrolling bestie, your girl would never leave you hanging on the type list π
π§ tiny lil note: the whole point of this header is definitions β it's the place where the types get their names via typedef, so your code can just say the type name instead of spelling out the ugly underlying thing. very much giving "let me handle it for you, babe" energy π
typedef short int CSA_sint16;
typedef long int CSA_sint32;
typedef unsigned char CSA_uint8;
typedef unsigned short int CSA_uint16;
typedef unsigned long int CSA_uint32;
typedef void * CSA_buffer;
typedef CSA_uint32 CSA_entry_handle;
typedef CSA_uint32 CSA_session_handle;
typedef char * CSA_string;
typedef CSA_string CSA_attribute_reference;
typedef CSA_uint32 CSA_boolean;
typedef CSA_string CSA_date_time;
typedef CSA_string CSA_date_time_range;
typedef CSA_sint32 CSA_enum;
typedef CSA_uint32 CSA_flags;
typedef CSA_uint32 CSA_return_code;
typedef CSA_string CSA_service_reference;
typedef CSA_string CSA_time_duration;
#define CSA_FALSE ((CSA_boolean)0)
#define CSA_TRUE ((CSA_boolean)1)
okay so this is the whole cast list π
like every type you're ever gonna meet in this API. <pink>CSA_sint16</pink>? a small signed boy. <pink>CSA_buffer</pink>? literally void *, it's giving "I contain multitudes". <pink>CSA_boolean</pink> is a CSA_uint32 with exactly two moods and they are CSA_FALSE (((CSA_boolean)0)) and CSA_TRUE (((CSA_boolean)1)). no in-between, no "it's complicated", periodt.
everything date/time/duration-ish is just a CSA_string bestie β the stringification is someone else's problem, not ours π«Ά.
β¨ EXTENSION FLAGS β¨
/* EXTENSION FLAGS */
#define CSA_EXT_REQUIRED ((CSA_flags)0x10000)
#define CSA_EXT_OUTPUT ((CSA_flags)0x20000)
#define CSA_EXT_LAST_ELEMENT ((CSA_flags)0x40000)
these are the "hey I'm using an extension, don't @ me" bits. CSA_EXT_REQUIRED says you need it, CSA_EXT_OUTPUT marks output, and CSA_EXT_LAST_ELEMENT is the little "this is the last one, we're done here" flag π₯.
π§ CALENDAR USER TYPE π§
/* CALENDAR USER TYPE */
#define CSA_USER_TYPE_INDIVIDUAL ((CSA_enum)0)
#define CSA_USER_TYPE_GROUP ((CSA_enum)1)
#define CSA_USER_TYPE_RESOURCE ((CSA_enum)2)
three flavours of calendar user: an INDIVIDUAL (main character), a GROUP (the group chat), and a RESOURCE (the conference room that everyone fights over, lowkey iconic).
πΈ CLASSIFICATION πΈ
/* CLASSIFICATION
#define CSA_CLASS_PUBLIC ((CSA_enum)0)
#define CSA_CLASS_PRIVATE ((CSA_enum)1)
#define CSA_CLASS_CONFIDENTIAL ((CSA_enum)2)
public, private, confidential β the three levels of "who gets to see this". and yes, the original comment is missing its closing */, ngl that's just how it lives, I'm not touching it π.
π ACCESS RIGHTS FLAGS π
/* ACCESS RIGHTS FLAGS */
#define CSA_FREE_TIME_SEARCH ((CSA_flags)0x1)
#define CSA_VIEW_PUBLIC_ENTRIES ((CSA_flags)0x2)
#define CSA_VIEW_CONFIDENTIAL_ENTRIES ((CSA_flags)0x4)
#define CSA_VIEW_PRIVATE_ENTRIES ((CSA_flags)0x8)
#define CSA_INSERT_PUBLIC_ENTRIES ((CSA_flags)0x10)
#define CSA_INSERT_CONFIDENTIAL_ENTRIES ((CSA_flags)0x20)
#define CSA_INSERT_PRIVATE_ENTRIES ((CSA_flags)0x40)
#define CSA_CHANGE_PUBLIC_ENTRIES ((CSA_flags)0x80)
#define CSA_CHANGE_CONFIDENTIAL_ENTRIES ((CSA_flags)0x100)
#define CSA_CHANGE_PRIVATE_ENTRIES ((CSA_flags)0x200)
#define CSA_VIEW_CALENDAR_ATTRIBUTES ((CSA_flags)0x400)
#define CSA_INSERT_CALENDAR_ATTRIBUTES ((CSA_flags)0x800)
#define CSA_CHANGE_CALENDAR_ATTRIBUTES ((CSA_flags)0x1000)
#define CSA_ORGANIZER_RIGHTS ((CSA_flags)0x2000)
#define CSA_SPONSOR_RIGHTS ((CSA_flags)0x4000)
#define CSA_OWNER_RIGHTS ((CSA_flags)0x8000)
okay this is the permission grid and it's a whole mood board π. three visibility levels (PUBLIC, CONFIDENTIAL, PRIVATE) crossed with three verbs (view π, insert β, change βοΈ) = nine flags, plus CSA_FREE_TIME_SEARCH (0x1) for the "are they free tho" search, plus the three calendar-attribute ones (VIEW / INSERT / CHANGE), plus the three special power flags: CSA_ORGANIZER_RIGHTS (0x2000), CSA_SPONSOR_RIGHTS (0x4000), CSA_OWNER_RIGHTS (0x8000). owner is the final boss fr π.
π ATTENDEE PRIORITIES π
/* ATTENDEE PRIORITIES */
#define CSA_FOR_YOUR_INFORMATION ((CSA_enum)0)
#define CSA_ATTENDANCE_REQUESTED ((CSA_enum)1)
#define CSA_ATTENDANCE_REQUIRED ((CSA_enum)2)
#define CSA_IMMEDIATE_RESPONSE ((CSA_enum)3)
from "no pressure, just FYI" (CSA_FOR_YOUR_INFORMATION) all the way up to "answer me RIGHT NOW" (CSA_IMMEDIATE_RESPONSE). the escalation is real π«Ά.
π ATTENDEE STATUS π
/* ATTENDEE STATUS */
#define CSA_STATUS_ACCEPTED ((CSA_enum)0)
#define CSA_STATUS_NEEDS_ACTION ((CSA_enum)1)
#define CSA_STATUS_SENT ((CSA_enum)2)
#define CSA_STATUS_TENTATIVE ((CSA_enum)3)
#define CSA_STATUS_CONFIRMED ((CSA_enum)4)
#define CSA_STATUS_REJECTED ((CSA_enum)5)
#define CSA_STATUS_COMPLETED ((CSA_enum)6)
#define CSA_STATUS_DELEGATED ((CSA_enum)7)
the full emotional journey of an invitation: accepted π, needs action π, sent π€, tentative π¬, confirmed β , rejected π, completed π, delegated ("not me, them") π.
π¦ ATTRIBUTE VALUE TYPE π¦
/* ATTRIBUTE VALUE TYPE */
#define CSA_VALUE_BOOLEAN ((CSA_enum) 0)
#define CSA_VALUE_ENUMERATED ((CSA_enum) 1)
#define CSA_VALUE_FLAGS ((CSA_enum) 2)
#define CSA_VALUE_SINT32 ((CSA_enum) 3)
#define CSA_VALUE_UINT32 ((CSA_enum) 4)
#define CSA_VALUE_STRING ((CSA_enum) 5)
#define CSA_VALUE_CALENDAR_USER ((CSA_enum) 6)
#define CSA_VALUE_DATE_TIME ((CSA_enum) 7)
#define CSA_VALUE_DATE_TIME_RANGE ((CSA_enum) 8)
#define CSA_VALUE_TIME_DURATION ((CSA_enum) 9)
#define CSA_VALUE_ACCESS_LIST ((CSA_enum) 10)
#define CSA_VALUE_ATTENDEE_LIST ((CSA_enum) 11)
#define CSA_VALUE_DATE_TIME_LIST ((CSA_enum) 12)
#define CSA_VALUE_REMINDER ((CSA_enum) 13)
#define CSA_VALUE_OPAQUE_DATA ((CSA_enum) 14)
every attribute value has a β¨typeβ¨ and here's the entire zodiac: boolean, enumerated, flags, sint32, uint32, string, calendar user, date-time, date-time range, time duration, access list, attendee list, date-time list, reminder, and opaque data (the mystery box, we don't look inside π). 0 through 14, no gaps, slay.
π₯ CROSS FUNCTION FLAGS + SCOPE + OPERATORS π₯
/* CROSS FUNCTION FLAGS */
/* SCOPE */
#define CSA_SCOPE_ALL ((CSA_enum)0)
#define CSA_SCOPE_ONE ((CSA_enum)1)
#define CSA_SCOPE_FORWARD ((CSA_enum)2)
scope: ALL, ONE, or FORWARD β the "how far do I reach" dial. (and yeah, the CROSS FUNCTION FLAGS comment is just vibing there with nothing under it, that's canon π« )
/* OPERATORS */
#define CSA_MATCH_ANY ((CSA_enum)0)
#define CSA_MATCH_EQUAL_TO ((CSA_enum)1)
#define CSA_MATCH_NOT_EQUAL_TO ((CSA_enum)2)
#define CSA_MATCH_GREATER_THAN ((CSA_enum)3)
#define CSA_MATCH_LESS_THAN ((CSA_enum)4)
#define CSA_MATCH_GREATER_THAN_OR_EQUAL_TO ((CSA_enum)5)
#define CSA_MATCH_LESS_THAN_OR_EQUAL_TO ((CSA_enum)6)
#define CSA_MATCH_CONTAIN ((CSA_enum)7)
the matching operators, i.e. the search grammar. CSA_MATCH_ANY, EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL_TO, LESS_THAN_OR_EQUAL_TO, CONTAIN. yes CONTAIN is spelled without the S, no I will not be fixing it π
.
#define CSA_LOOKUP_RESOLVE_PREFIX_SEARCH ((CSA_flags)0x1)
#define CSA_LOOKUP_RESOLVE_IDENTITY ((CSA_flags)0x2)
lookup resolve flags: prefix search (0x1) and identity (0x2).
π CONFIGURATION ENUMS π
#define CSA_CONFIG_CHARACTER_SET ((CSA_enum)0)
#define CSA_CONFIG_LINE_TERM ((CSA_enum)1)
#define CSA_CONFIG_DEFAULT_SERVICE ((CSA_enum)2)
#define CSA_CONFIG_DEFAULT_USER ((CSA_enum)3)
#define CSA_CONFIG_REQ_PASSWORD ((CSA_enum)4)
#define CSA_CONFIG_REQ_SERVICE ((CSA_enum)5)
#define CSA_CONFIG_REQ_USER ((CSA_enum)6)
#define CSA_CONFIG_UI_AVALI ((CSA_enum)7)
#define CSA_CONFIG_VER_IMPLEM ((CSA_enum)8)
#define CSA_CONFIG_VER_SPEC ((CSA_enum)9)
the config knobs: character set, line terminator, default service, default user, whether a password/service/user is required, plus CSA_CONFIG_UI_AVALI, CSA_CONFIG_VER_IMPLEM and CSA_CONFIG_VER_SPEC. AVALI and IMPLEM are absolutely abbreviated to the point of chaos but they're the real names, iykyk π.
β CHARACTER SET IDENTIFIERS β
/* CHARACTER SET IDENTIFIERS */
#define CSA_CHARSET_437 "-//XAPIA//CHARSET IBM 437//EN"
#define CSA_CHARSET_850 "-//XAPIA//CHARSET IBM 850//EN"
#define CSA_CHARSET_1252 "-//XAPIA//CHARSET Microsoft 1252//EN"
#define CSA_CHARSET_ISTRING "-//XAPIA//CHARSET Apple ISTRING//EN"
#define CSA_CHARSET_UNICODE "-//XAPIA//CHARSET UNICODE//EN"
#define CSA_CHARSET_T61 "-//XAPIA//CHARSET TSS T61//EN"
#define CSA_CHARSET_IA5 "-//XAPIA//CHARSET TSS IA5//EN"
#define CSA_CHARSET_ISO_10646 "-//XAPIA//CHARSET ISO 10646//EN"
#define CSA_CHARSET_ISO_646 "-//XAPIA//CHARSET ISO 646//EN"
#define CSA_CHARSET_ISO_8859_1 "-//XAPIA//CHARSET ISO 8859-1//EN"
these are the actual strings you pass around to name a charset β quote them exactly, character for character, because these bad boys are literal string macros and one wrong dash is a whole bug hunt π.
π CALLBACK FLAGS π
#define CSA_CB_CALENDAR_LOGON ((CSA_flags)0x0
#define CSA_CB_CALENDAR_DELETED ((CSA_flags)0x1)
#define CSA_CB_CALENDAR_ATTRIBUTE_UPDATED ((CSA_flags)0x2)
#define CSA_CB_ENTRY_ADDED ((CSA_flags)0x4)
#define CSA_CB_ENTRY_DELETED ((CSA_flags)0x8)
#define CSA_CB_ENTRY_UPDATED ((CSA_flags)0x10)
what you can get pinged about: logon (0x0), calendar deleted (0x1), calendar attribute updated (0x2), entry added (0x4), entry deleted (0x8), entry updated (0x10). also β heads up bestie β CSA_CB_CALENDAR_LOGON is written in the source with an unclosed paren: ((CSA_flags)0x0. that's literally how it appears, I'm reporting the crime, not committing it π.
π§ ENTRY TYPES π§
/* Entry Types */
#define CSA_TYPE_EVENT ((CSA_enum)0)
#define CSA_TYPE_TODO ((CSA_enum)1)
#define CSA_TYPE_MEMO ((CSA_enum)2)
three kinds of entry: EVENT (the party), TODO (the homework), MEMO (the notes app screenshot). iconic trio π.
π RETURN ERROR FLAGS π
/* RETURN ERROR FLAGS */
#define CSA_ERROR_RSV_MASK ((CSA_return_code)0x0000FFFF)
#define CSA_ERROR_IMPL_MASK ((CSA_return_code)0xFFFF0000)
two masks for slicing up a CSA_return_code: the reserved half 0x0000FFFF and the implementation half 0xFFFF0000. so you can tell "the spec said no" from "this implementation said no" π΅οΈ.
π RETURN CODES (the whole list, no skips) π
/* RETURN CODES */
#define CSA_SUCCESS ((CSA_return_code)0)
#define CSA_E_AMBIGUOUS_USER ((CSA_return_code)1)
#define CSA_E_CALENDAR_EXISTS ((CSA_return_code)2)
#define CSA_E_CALENDAR_NOT_EXIST ((CSA_return_code)3)
#define CSA_E_CALLBACK_NOT_REGISTERED ((CSA_return_code)4)
#define CSA_E_DISK_FULL ((CSA_return_code)5)
#define CSA_E_FAILURE ((CSA_return_code)6)
#define CSA_E_FILE_EXIST ((CSA_return_code)7)
#define CSA_E_FILE_NOT_EXIST ((CSA_return_code)8)
#define CSA_E_INSUFFICIENT_MEMORY ((CSA_return_code)9)
#define CSA_E_INVALID_ATTRIBUTE ((CSA_return_code)10)
#define CSA_E_INVALID_ATTRIBUTE_VALUE ((CSA_return_code)11)
#define CSA_E_INVALID_CALENDAR_SERVICE ((CSA_return_code)12)
#define CSA_E_INVALID_CONFIGURATION ((CSA_return_code)13)
#define CSA_E_INVALID_DATA_EXT ((CSA_return_code)14)
#define CSA_E_INVALID_DATE_TIME ((CSA_return_code)15)
#define CSA_E_INVALID_ENTRY_HANDLE ((CSA_return_code)16)
#define CSA_E_INVALID_ENUM ((CSA_return_code)17)
#define CSA_E_INVALID_FILE_NAME ((CSA_return_code)18)
#define CSA_E_INVALID_FLAG ((CSA_return_code)19)
#define CSA_E_INVALID_FUNCTION_EXT ((CSA_return_code)20)
#define CSA_E_INVALID_MEMORY ((CSA_return_code)21)
#define CSA_E_INVALID_PARAMETER ((CSA_return_code)22)
#define CSA_E_INVALID_PASSWORD ((CSA_return_code)23)
#define CSA_E_INVALID_RETURN_CODE ((CSA_return_code)24)
#define CSA_E_INVALID_SESSION_HANDLE ((CSA_return_code)25)
#define CSA_E_INVALID_USER ((CSA_return_code)26)
#define CSA_E_LOCALE_MISMATCH ((CSA_return_code)27)
#define CSA_E_LOGON_FAILURE ((CSA_return_code)28)
#define CSA_E_NO_AUTHORITY ((CSA_return_code)29)
#define CSA_E_NOT_SUPPORTED ((CSA_return_code)30)
#define CSA_E_PASSWORD_REQUIRED ((CSA_return_code)31)
#define CSA_E_READONLY ((CSA_return_code)32)
#define CSA_E_SERVICE_UNAVAILABLE ((CSA_return_code)33)
#define CSA_E_TEXT_TOO_LARGE ((CSA_return_code)34)
#define CSA_E_TOO_MANY_USERS ((CSA_return_code)35)
#define CSA_E_UNABLE_TO_OPEN_FILE ((CSA_return_code)36)
#define CSA_E_UNSUPPORTED_ATTRIBUTE ((CSA_return_code)37)
#define CSA_E_UNSUPPORTED_CHARACTER_SET ((CSA_return_code)38)
#define CSA_E_UNSUPPORTED_DATA_EXT ((CSA_return_code)39)
#define CSA_E_UNSUPPORTED_FLAG ((CSA_return_code)40)
#define CSA_E_UNSUPPORTED_FUNCTION_EXT ((CSA_return_code)41)
#define CSA_E_UNSUPPORTED_PARAMETER ((CSA_return_code)42)
#define CSA_E_UNSUPPORTED_VERSION ((CSA_return_code)43)
#define CSA_E_USER_NOT_FOUND ((CSA_return_code)44)
every possible way things can go right (one way: CSA_SUCCESS, 0) or wrong (44 ways, 1 through 44) π. yes I listed all of them, we don't do "etc." in this house. you got ambiguous users, calendars that exist, calendars that don't, unregistered callbacks, a full disk, generic failure, files that exist and files that don't, memory problems both insufficient (9) and invalid (21), a whole fleet of CSA_E_INVALID_* (10β26), a locale mismatch, logon failure, no authority, not supported, password required, readonly, service unavailable, text too large, too many users, unable to open file, and then the beautiful CSA_E_UNSUPPORTED_* saga (37β43), finishing with CSA_E_USER_NOT_FOUND (44). a journey π.
π CALENDAR ATTRIBUTES (names) π
/* CALENDAR ATTRIBUTES */
/* CALENDAR ATTRIBUTE NAMES */
#define CSA_CAL_ATTR_ACCESS_LIST "-//XAPIA/CSA/CALATTR//NONSGML Access List//EN"
#define CSA_CAL_ATTR_CALENDAR_NAME "-//XAPIA/CSA/CALATTR//NONSGML Calendar Name//EN"
#define CSA_CAL_ATTR_CALENDAR_OWNER "-//XAPIA/CSA/CALATTR//NONSGML Calendar Owner//EN"
the first three calendar attribute names: access list, calendar name, calendar owner β and again, these are literal strings, so copy them exactly, hyphens and all π .
okay so first up: the calendar attribute names. every single one of these is a long string constant β an OID-looking thing ending in //EN β and they're the β¨officialβ¨ names for calendar-level attributes. don't retype them from memory, bestie, copy them exactly or the whole thing vibe-checks itself into the void π
#define CSA_CAL_ATTR_CALENDAR_SIZE "-//XAPIA/CSA/CALATTR//NONSGML Calendar Size//EN"
#define CSA_CAL_ATTR_CODE_PAGE "-//XAPIA/CSA/CALATTR//NONSGML Character Set//EN"
#define CSA_CAL_ATTR_COUNTRY "-//XAPIA/CSA/CALATTR//NONSGML Country//EN"
#define CSA_CAL_ATTR_DATE_CREATED "-//XAPIA/CSA/CALATTR//NONSGML Date Created//EN"
#define CSA_CAL_ATTR_LANGUAGE "-//XAPIA/CSA/CALATTR//NONSGML Language//EN"
#define CSA_CAL_ATTR_NUMBER_ENTRIES "-//XAPIA/CSA/CALATTR//NONSGML Number Entries//EN"
#define CSA_CAL_ATTR_PRODUCT_IDENTIFIER "-//XAPIA/CSA/CALATTR//NONSGML Product Identifier//EN"
#define CSA_CAL_ATTR_TIME_ZONE "-//XAPIA/CSA/CALATTR//NONSGML Time Zone//EN"
#define CSA_CAL_ATTR_VERSION "-//XAPIA/CSA/CALATTR//NONSGML Version//EN"
#define CSA_CAL_ATTR_WORK_SCHEDULE "-//XAPIA/CSA/CALATTR//NONSGML Work Schedule//EN"
then we get to the entry attributes, which is the same deal but for individual entries. look at the header's own little comment markers, they're doing their own sectioning and we respect the icon's formatting:
/* ENTRY ATTRIBUTES */
/* ENTRY ATTRIBUTES NAMES */
#define CSA_ENTRY_ATTR_ATTENDEE_LIST "-//XAPIA/CSA/ENTRYATTR//NONSGML Attendee List//EN"
#define CSA_ENTRY_ATTR_AUDIO_REMINDER "-//XAPIA/CSA/ENTRYATTR//NONSGML Audio Reminder//EN"
#define CSA_ENTRY_ATTR_CLASSIFICATION "-//XAPIA/CSA/ENTRYATTR//NONSGML Classification//EN"
#define CSA_ENTRY_ATTR_DATE_COMPLETED "-//XAPIA/CSA/ENTRYATTR//NONSGML Date Complated//EN"
#define CSA_ENTRY_ATTR_DATE_CREATED "-//XAPIA/CSA/ENTRYATTR//NONSGML Date Created//EN"
#define CSA_ENTRY_ATTR_DESCRIPTION "-//XAPIA/CSA/ENTRYATTR//NONSGML Description//EN"
#define CSA_ENTRY_ATTR_DUE_DATE "-//XAPIA/CSA/ENTRYATTR//NONSGML Due Date//EN"
#define CSA_ENTRY_ATTR_END_DATE "-//XAPIA/CSA/ENTRYATTR//NONSGML End Date//EN"
#define CSA_ENTRY_ATTR_EXCEPTION_DATES "-//XAPIA/CSA/ENTRYATTR//NONSGML Exception Dates//EN"
#define CSA_ENTRY_ATTR_EXCEPTION_RULE "-//XAPIA/CSA/ENTRYATTR//NONSGML Exception Rule//EN"
#define CSA_ENTRY_ATTR_FLASHING_REMINDER "-//XAPIA/CSA/ENTRYATTR//NONSGML Flashing Reminder//EN"
#define CSA_ENTRY_ATTR_LAST_UPDATE "-//XAPIA/CSA/ENTRYATTR//NONSGML Last Update//EN"
#define CSA_ENTRY_ATTR_MAIL_REMINDER "-//XAPIA/CSA/ENTRYATTR//NONSGML Mail Reminder//EN"
#define CSA_ENTRY_ATTR_NUMBER_RECURRENCES "-//XAPIA/CSA/ENTRYATTR//NONSGML Number Recurrences//EN"
#define CSA_ENTRY_ATTR_ORGANIZER "-//XAPIA/CSA/ENTRYATTR//NONSGML Organizer//EN"
#define CSA_ENTRY_ATTR_POPUP_REMINDER "-//XAPIA/CSA/ENTRYATTR//NONSGML Popup Reminder//EN"
#define CSA_ENTRY_ATTR_PRIORITY "-//XAPIA/CSA/ENTRYATTR//NONSGML Priority//EN"
#define CSA_ENTRY_ATTR_RECURRENCE_RULE "-//XAPIA/CSA/ENTRYATTR//NONSGML Recurrence Rule//EN"
#define CSA_ENTRY_ATTR_RECURREING_DATES "-//XAPIA/CSA/ENTRYATTR//NONSGML Recurring Dates//EN"
#define CSA_ENTRY_ATTR_REFERENCE_IDENTIFIER "-//XAPIA/CSA/ENTRYATTR//NONSGML Reference_identifier//EN"
#define CSA_ENTRY_ATTR_SEQUENCE_NUMBER "-//XAPIA/CSA/ENTRYATTR//NONSGML Sequence Number//EN"
#define CSA_ENTRY_ATTR_SPONSOR "-//XAPIA/CSA/ENTRYATTR//NONSGML Sponsor//EN"
#define CSA_ENTRY_ATTR_START_DATE "-//XAPIA/CSA/ENTRYATTR//NONSGML Start Date//EN"
#define CSA_ENTRY_ATTR_STATUS "-//XAPIA/CSA/ENTRYATTR//NONSGML Status//EN"
#define CSA_ENTRY_ATTR_SUBTYPE "-//XAPIA/CSA/ENTRYATTR//NONSGML Subtype//EN"
#define CSA_ENTRY_ATTR_SUMMARY "-//XAPIA/CSA/ENTRYATTR//NONSGML Summary//EN"
#define CSA_ENTRY_ATTR_TIME_TRANSPARENCY "-//XAPIA/CSA/ENTRYATTR//NONSGML Transparency//EN"
#define CSA_ENTRY_ATTR_TYPE "-//XAPIA/CSA/ENTRYATTR//NONSGML Type//EN"
okay real talk, some of these strings have β¨quirksβ¨ baked into the header and we do not silently fix them, because that would change the constant:Date Complated,RECURREING_DATES,Reference_identifier. copy what's there, bestie. exactly what's there. π«Ά
then the extensions era begins. there are extension set IDs (one for the common set, one for the bilateral set), then the function extensions, then the flags, then the return codes β and the whole thing is numbers, so type them like your life depends on it:
/* COMMON EXTENSIONS DECLARATIONS */
/* EXTENSION SET ID */
/* Common Extension Set */
#define CSA_XS_COM ((CSA_uint32) 0)
/* Bilateral Extension Set */
#define CSA_XS_BLT ((CSA_uint32) 256)
/* FUNCTION EXTENSIONS */
/* Query for extension support in implementation */
#define CSA_X_COM_SUPPORT_EXT ((CSA_uint32) 1)
#define CSA_X_COM_SUPPORTED ((CSA_flags) 1)
#define CSA_X_COM_NOT_SUPPORTED ((CSA_flags) 2)
#define CSA_X_COM_DATA_EXT_SUPPORTED ((CSA_flags) 4)
#define CSA_X_COM_FUNC_EXT_SUPPORTED ((CSA_flags) 8)
#define CSA_X_COM_SUP_EXCLUDE ((CSA_flags) 16)
#define CSA_X_UI_ID_EXT ((CSA_uint32)2)
/* EXTENSION FLAGS */
#define CSA_X_LOGON_UI_ALLOWED ((CSA_flags)0x1)
#define CSA_X_ERROR_UI_ALLOWED ((CSA_flags)0x2)
#define CSA_X_LOOKUP_RESOLVE_UI ((CSA_flags)0x4)
#define CSA_X_LOOKUP_DETAILS_UI ((CSA_flags)0x8)
#define CSA_X_LOOKUP_ADDRESSING_UI ((CSA_flags)0x10)
#define CSA_X_ADD_DEFINE_ENTRY_UI ((CSA_flags)0x20)
/* EXTENSION RETURN CODES */
#define CSA_X_E_INVALID_UI_ID ((CSA_return_code)1025)
#define CSA_X_E_LOGON_FAILURE ((CSA_return_code)1026)
#define CSA_X_E_USER_CANCEL ((CSA_return_code)1027)
#define CSA_X_XT_APP_CONTEXT_EXT ((CSA_uint32)3)
π§ the header declares the following structures
bestie this is the main character part, the actual typedefs. starting with the universal extension wrapper and the calendar user β the little duo everything else is built on top of:
typedef struct CSA_TAG_EXTENSION {
CSA_uint32 item_code;
CSA_uint32 item_data;
CSA_buffer item_reference;
CSA_flags extension_flags;
} CSA_extension;
typedef struct CSA_TAG_CALENDAR_USER {
CSA_string user_name;
CSA_enum user_type;
CSA_string calendar_address;
CSA_extension *calendar_user_extensions;
} CSA_calendar_user;
then access rights (linked list, she has a next, she's giving chain energy π) and attendees, who also chain together:
typedef struct CSA_TAG_ACCESS_RIGHTS {
CSA_calendar_user *user;
CSA_flags rights;
struct CSA_TAG_ACCESS_RIGHTS *next;
} CSA_access_rights, *CSA_access_list;
typedef struct CSA_TAG_ATTENDEE {
CSA_calendar_user attendee;
CSA_enum priority;
CSA_enum status;
CSA_boolean rsvp_requested;
struct CSA_TAG_ATTENDEE *next;
} CSA_attendee, *CSA_attendee_list;
then a chunk of opaque data β size plus a CSA_uint8 *data, that's it, that's the whole vibe, and honestly? iconic:
typedef struct CSA_TAG_OPAQUE_DATA {
CSA_uint32 size;
CSA_uint8 *data;
} CSA_opaque_data;
then the callback signature. she's a function pointer and she takes five things and returns void, and yes you need her parameter list verbatim:
typedef void (*CSA_callback)(
CSA_session_handle session,
CSA_flags reason,
CSA_buffer call_data,
CSA_buffer client_data,
CSA_extension *callback_extensions
);
π¦ the callback data structs, aka the lil payloads
each one of these carries the user and then whatever gossip the callback needs to spill. look at how the delete and update ones both brought scope and date_and_time to the party:
typedef struct CSA_TAG_LOGON_CB_DATA {
CSA_calendar_user *user;
} CSA_logon_callback_data;
typedef struct CSA_TAG_CALENDAR_DELETED_CB_DATA {
CSA_calendar_user *user;
} CSA_calendar_deleted_callback_data;
typedef struct CSA_TAG_CALENDAR_ATTR_UPDATE_CB_DATA {
CSA_calendar_user *user;
CSA_uint32 number_attributes;
CSA_attribute_reference *attribute_names;
} CSA_calendar_attr_update_callback_data;
typedef struct CSA_TAG_ADD_ENTRY_CB_DATA {
CSA_calendar_user *user;
CSA_opaque_data added_entry_id;
} CSA_add_entry_callback_data;
typedef struct CSA_TAG_DELETE_ENTRY_CB_DATA {
CSA_calendar_user *user;
CSA_opaque_data deleted_entry_id;
CSA_enum scope;
CSA_date_time date_and_time;
} CSA_delete_entry_callback_data;
typedef struct CSA_TAG_UPDATE_ENTRY_CB_DATA {
CSA_calendar_user *user;
CSA_opaque_data old_entry_id;
CSA_opaque_data new_entry_id;
CSA_enum scope;
CSA_date_time date_and_time;
} CSA_update_entry_callback_data;
π lists, free time, and reminders
more linked-list goodness (date/time entries literally have a next, we stan a repeatable structure), then a bundle of free-time data, then the reminder + reminder reference twins:
typedef struct CSA_TAG_DATE_TIME_ITEM {
CSA_date_time date_time;
struct CSA_TAG_DATE_TIME_ITEM *next;
} CSA_date_time_entry, *CSA_date_time_list;
typedef struct CSA_TAG_FREE_TIME {
CSA_uint32 number_free_time_data;
CSA_date_time_range *free_time_data;
} CSA_free_time;
typedef struct CSA_TAG_REMINDER {
CSA_time_duration lead_time;
CSA_time_duration snooze_time;
CSA_uint32 repeat_count;
CSA_opaque_data reminder_data;
} CSA_reminder;
typedef struct CSA_TAG_REMINDER_REFERENCE {
CSA_entry_handle entry;
CSA_date_time run_time;
CSA_time_duration snooze_time;
CSA_uint32 repeat_count;
CSA_attribute_reference attribute_name;
} CSA_reminder_reference;
π the big one: attribute values
okay so this is the struct. CSA_attribute_value has a type field and then a big anonymous union named item containing one member per possible value type β booleans, enums, flags, signed and unsigned 32s, calendar users, date/times, date/time ranges, durations, strings, attendee lists, date/time lists, access lists, and pointer-y reminders and opaque data. every single field name is load-bearing, babes, do not abbreviate:
typedef struct CSA_TAG_ATTRIBUTE_ITEM {
CSA_enum type;
union {
CSA_boolean boolean_value;
CSA_enum enumerated_value;
CSA_flags flags_value;
CSA_sint32 sint32_value;
CSA_uint32 uint32_value;
CSA_calendar_user calendar_user_value;
CSA_date_time date_time_value;
CSA_date_time_range date_time_range_value;
CSA_time_duration time_duration_value;
CSA_string string_value;
CSA_attendee_list attendee_list_value;
CSA_date_time_list date_time_list_value;
CSA_access_list access_list_value;
CSA_reminder *reminder_value;
CSA_opaque_data *opaque_data_value;
} item;
} CSA_attribute_value;
and an attribute is just a name, a pointer to a value, plus extensions. elegant. minimal. not a single wasted field.
typedef struct CSA_TAG_ATTRIBUTE {
CSA_string name;
CSA_attribute_value *value;
CSA_extension *attribute_extensions;
} CSA_attribute;
then the work schedule (begin time, the cyclic flag, cycle end time, and the work cycle list) and the little CSA_X_COM_support struct that pairs an item_code with flags:
typedef struct CSA_TAG_WORK_SCHEDULE {
CSA_date_time schedule_begin_time;
CSA_boolean cyclic_definition_flag;
CSA_date_time cycle_end_time;
CSA_date_time_list *work_cycle;
} CSA_work_schedule;
typedef struct CSA_TAG_XCOM {
CSA_uint32 item_code;
CSA_flags flags;
} CSA_X_COM_support;
π the header declares the following as functions
and here's the first one of the function crew. csa_add_calendar takes your session handle, a calendar user pointer, the attribute count, the attribute array, and the extensions β and it hands you back a CSA_return_code:
CSA_return_code csa_add_calendar(CSA_session_handle session,
CSA_calendar_user *user,
CSA_uint32 number_attributes,
CSA_attribute *calendar_attributes,
CSA_extension *add_calendar_extensions);
and there's more coming, bestie β hold that thought π«Ά
okay, deep breath bestie, this is the rest of the call list β the whole crew, one signature at a time π
every single one returns a CSA_return_code, so that part's consistent, we love that for us.
csa_add_entryπ β session, a count of attributes, the attributes themselves, a place to hand back the newentry, plusadd_entry_extensions.
CSA_return_code csa_add_entry(CSA_session_handle session,
CSA_uint32 number_attributes,
CSA_attribute *entry_attributes,
CSA_entry_handle *entry,
CSA_extension *add_entry_extensions);
csa_call_callbacksβ¨ β you pass thesession, areason(it's aCSA_flags), andcall_callbacks_extensions. That's the whole squad, no notes.
CSA_return_code csa_call_callbacks(CSA_session_handle session,
CSA_flags reason,
CSA_extension *call_callbacks_extensions);
csa_delete_calendarπ₯ β justsessionanddelete_calendar_extensions. Minimalist. Iconic.
CSA_return_code csa_delete_calendar(CSA_session_handle session,
CSA_extension *delete_calendar_extensions);
csa_delete_entryπ β here you name theentry, say whatdelete_scopeyou mean (CSA_enum, so pick your vibe), and hand overdelete_entry_extensions.
CSA_return_code csa_delete_entry(CSA_session_handle session,
CSA_entry_handle entry,
CSA_enum delete_scope,
CSA_extension *delete_entry_extensions);
csa_freeπ«Ά β one single argument: thememory(aCSA_buffer). That's it. Sweet and simple.
CSA_return_code csa_free(CSA_buffer memory);
csa_free_time_searchπΈ βsession, adate_time_range, atime_duration,number_users, thecalendar_usersarray, afree_timeout-pointer (double-star, so it'sCSA_free **), andfree_time_search_extensions.
CSA_return_code csa_free_time_search(CSA_session_handle session,
CSA_date_time_range date_time_range,
CSA_time_duration time_duration,
CSA_uint32 number_users,
CSA_calendar_user *calendar_users,
CSA_free_time **free_time,
CSA_extension *free_time_search_extensions);
csa_list_calendar_attributesπ¦ βsession, thennumber_namesandcalendar_attributes_names(both out-params, both pointers), thenlist_calendar_attributes_extensions.
CSA_return_code csa_list_calendar_attributes(CSA_session_handle session,
CSA_uint32 *number_names,
CSA_attribute_reference **calendar_attributes_names,
CSA_extension *list_calendar_attributes_extensions);
csa_list_calendarsπ β note this one has nosession, it takes acalendar_service(CSA_service_reference), thennumber_namesandcalendar_namesas outs, pluslist_calendars_extensions.
CSA_return_code csa_list_calendars(CSA_service_reference calendar_service,
CSA_uint32 *number_names,
CSA_calendar_user **calendar_names,
CSA_extension *list_calendars_extensions);
csa_list_entriesπ β busy girl!session,number_attributes,entry_attributes, alist_operators(CSA_enum *), thennumber_entriesandentriesas outs, thenlist_entries_extensions.
CSA_return_code csa_list_entries(CSA_session_handle session,
CSA_uint32 number_attributes,
CSA_attribute *entry_attributes
CSA_enum *list_operators,
CSA_uint32 *number_entries,
CSA_entry_handle **entries,
CSA_extension *list_entries_extensions);
csa_list_entry_attributesπ βsession, theentry, thennumber_namesandentry_attributes_namesouts, thenlist_entry_attributes_extensions.
CSA_return_code csa_list_entry_attributes(CSA_session_handle session,
CSA_entry_handle entry,
CSA_uint32 *number_names,
CSA_attribute_reference **entry_attributes_names
CSA_extension *list_entry_attributes_extensions);
csa_list_entry_sequenceβ βsession,entry, atime_range, thennumber_entriesandentry_listas outs, thenlist_entry_sequence_extensions.
CSA_return_code csa_list_entry_sequence(CSA_session_handle session,
CSA_entry_handle entry,
CSA_date_time_range time_range,
CSA_uint32 *number_entries,
CSA_entry_handle **entry_list,
CSA_extension *list_entry_sequence_extensions);
csa_logoffπ βsessionandlogoff_extensions. Bye bestie π
CSA_return_code csa_logoff(CSA_session_handle session,
CSA_extension *logoff_extensions);
csa_logonβ¨ β the big one, she's got the whole lineup:calendar_service,user,password,character_set,required_csa_version, an outsession, andlogon_extensions. Six real args before the extensions, no cap.
CSA_return_code csa_logon(CSA_service_reference calendar_service,
CSA_calendar_user *user,
CSA_string password,
CSA_string character_set,
CSA_string required_csa_version,
CSA_session_handle *session,
CSA_extension *logon_extensions);
csa_look_upπ§ βsession,users,look_up_flags, thennumber_usersanduser_listas outs, thenlook_up_extensions.
CSA_return_code csa_look_up(CSA_session_handle session,
CSA_calendar_user *users,
CSA_flags look_up_flags,
CSA_uint32 *number_users,
CSA_calendar_user **user_list,
CSA_extension *look_up_extensions);
csa_query_configurationπ βsession, anitem(CSA_enum), areferenceout-buffer (CSA_buffer *), andquery_configuration_extensions.
CSA_return_code csa_query_configuration(CSA_session_handle session,
CSA_enum item,
CSA_buffer *reference,
CSA_extension *query_configuration_extensions);
csa_read_calendar_attributesπΈ βsession,number_names,attribute_names, thennumber_attributesandcalendar_attributesouts, thenread_calendar_attributes_extensions.
CSA_return_code csa_read_calendar_attributes(CSA_session_handle session,
CSA_uint32 number_names,
CSA_attribute_reference *attribute_names,
CSA_uint32 *number_attributes,
CSA_attribute **calendar_attributes
CSA_extension *read_calendar_attributes_extensions);
csa_read_entry_attributesπ¦ β same shape, but for anentry:session,entry,number_names,attribute_names,number_attributes,entry_attributes,read_entry_attributes_extensions.
CSA_return_code csa_read_entry_attributes(CSA_session_handle session,
CSA_entry_handle entry,
CSA_uint32 number_names,
CSA_attribute_reference *attribute_names,
CSA_uint32 *number_attributes,
CSA_attribute **entry_attributes,
CSA_extension *read_entry_attributes_extensions);
csa_read_next_reminderπ βsession,number_names,reminder_names, agiven_time(CSA_date_time), thennumber_remindersandreminder_referencesouts, thenread_next_reminder_extensions.
CSA_return_code csa_read_next_reminder(CSA_session_handle session,
CSA_uint32 number_names,
CSA_attribute_reference *reminder_names,
CSA_date_time given_time,
CSA_uint32 *number_reminders
CSA_reminder_reference **reminder_references,
CSA_extension *read_next_reminder_extensions);
csa_register_callbackπ βsession,reason(CSA_flags), thecallbackitself, yourclient_databuffer, andregister_callback_extensions.
CSA_return_code csa_register_callback(CSA_session_handle session,
CSA_flags reason,
CSA_callback callback,
CSA_buffer client_data,
CSA_extension *register_callback_extensions);
csa_restoreπ βsession,archive_name,number_attributes,attributes,operators(CSA_enum *), andrestore_extensions.
CSA_return_code csa_restore(CSA_session_handle session,
CSA_string archive_name,
CSA_uint32 number_attributes,
CSA_attribute *attributes,
CSA_enum *operators,
CSA_extension *restore_extensions);
csa_saveπ βsession,archive_name,number_attributes,attributes,operators, adelete_entryboolean (a wholeCSA_boolean, so true/false realness), andsave_extensions.
CSA_return_code csa_save(CSA_session_handle session,
CSA_string archive_name,
CSA_uint32 number_attributes
CSA_attribute *attributes,
CSA_enum *operators,
CSA_boolean delete_entry,
CSA_extension *save_extensions);
csa_unregister_callbackπ β mirrors the register call exactly:session,reason,callback,client_data,unregister_callback_extensions.
CSA_return_code csa_unregister_callback(CSA_session_handle session,
CSA_flags reason,
CSA_callback callback,
CSA_buffer client_data,
CSA_extension *unregister_callback_extensions);
csa_update_calendar_attributesβ βsession,number_attributes,calendar_attributes,update_calendar_attributes_extensions. Clean, no drama.
CSA_return_code csa_update_calendar_attributes(CSA_session_handle session,
CSA_uint32 number_attributes,
CSA_attribute *calendar_attributes,
CSA_extension *update_calendar_attributes_extensions);
csa_update_entry_attributesπ₯ β the finale and she ate:session,entry,update_scope(CSA_enum),update_propagation(CSA_boolean),number_attributes,entry_attributes, anew_entryout-handle, andupdate_entry_attributes_extensions.
CSA_return_code csa_update_entry_attributes(CSA_session_handle session,
CSA_entry_handle entry,
CSA_enum update_scope,
CSA_boolean update_propagation,
CSA_uint32 number_attributes,
CSA_attribute *entry_attributes,
CSA_entry_handle *new_entry,
CSA_extension *update_entry_attributes_extensions);
quick vibe check before you go, bestie: notice how pretty much every call ends in aCSA_extension *pointer β that's the pattern, that's the fingerprint, iykyk. And whenever there's a**-style out-param? That's the function handing you back a pointer. Copy the signatures exactly as they're written here when you're coding against them β don't go "fixing" commas you think are missing, just... trust the header π
and that's the whole page, we did it π this one lives in csa/csa.h and hangs out with the file formats crowd, so when you're citing it, that's your source and that's your section. mwah, go build something cute ππ¦β¨
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms