/* This module provides some helper APIs for creating a VCalendar object. Note on APIs: 1. The APIs does not attempt to verify if the arguments passed are correct. 2. Where the argument to an API is not applicable, pass the value 0. 3. See the test program at the bottom of this file as an example of usage. 4. This code calls APIs in vobject.c. */ /*************************************************************************** (C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International Business Machines Corporation and Siemens Rolm Communications Inc. For purposes of this license notice, the term Licensors shall mean, collectively, Apple Computer, Inc., AT&T Corp., International Business Machines Corporation and Siemens Rolm Communications Inc. The term Licensor shall mean any of the Licensors. Subject to acceptance of the following conditions, permission is hereby granted by Licensors without the need for written agreement and without license or royalty fees, to use, copy, modify and distribute this software for any purpose. The above copyright notice and the following four paragraphs must be reproduced in all copies of this software and any software including this software. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS. IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The software is provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the government are subject to restrictions set forth in DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. ***************************************************************************/ #include #include #include "vcaltmp.h" DLLEXPORT(VObject*) vcsCreateVCal( char *date_created, char *location, char *product_id, char *time_zone, char *version ) { VObject *vcal = newVObject(VCCalProp); #define Z(p,v) if (v) addPropValue(vcal,p,v); Z(VCDCreatedProp, date_created); Z(VCLocationProp, location) Z(VCProdIdProp, product_id) Z(VCTimeZoneProp, time_zone) Z(VCVersionProp, version) #undef Z return vcal; } DLLEXPORT(VObject*) vcsAddEvent( VObject *vcal, char *start_date_time, char *end_date_time, char *description, char *summary, char *categories, char *classification, char *status, char *transparency, char *uid, char *url ) { VObject *vevent = addProp(vcal,VCEventProp); #define Z(p,v) if (v) addPropValue(vevent,p,v); Z(VCDTstartProp,start_date_time); Z(VCDTendProp,end_date_time); if (description) { VObject *p = addPropValue(vevent,VCDescriptionProp,description); if (strchr(description,'\n')) addProp(p,VCQuotedPrintableProp); } Z(VCSummaryProp,summary); Z(VCCategoriesProp,categories); Z(VCClassProp,classification); Z(VCStatusProp,status); Z(VCTranspProp,transparency); Z(VCUniqueStringProp,uid); Z(VCURLProp,url); #undef Z return vevent; } DLLEXPORT(VObject*) vcsAddTodo( VObject *vcal, char *start_date_time, char *due_date_time, char *date_time_complete, char *description, char *summary, char *priority, char *classification, char *status, char *uid, char *url ) { VObject *vtodo = addProp(vcal,VCTodoProp); #define Z(p,v) if (v) addPropValue(vtodo,p,v); Z(VCDTstartProp,start_date_time); Z(VCDueProp,due_date_time); Z(VCCompletedProp,date_time_complete); if (description) { VObject *p = addPropValue(vtodo,VCDescriptionProp,description); if (strchr(description,'\n')) addProp(p,VCQuotedPrintableProp); } Z(VCSummaryProp,summary); Z(VCPriorityProp,priority); Z(VCClassProp,classification); Z(VCStatusProp,status); Z(VCUniqueStringProp,uid); Z(VCURLProp,url); #undef Z return vtodo; } DLLEXPORT(VObject*) vcsAddAAlarm( VObject *vevent, char *run_time, char *snooze_time, char *repeat_count, char *audio_content ) { VObject *aalarm= addProp(vevent,VCAAlarmProp); #define Z(p,v) if (v) addPropValue(aalarm,p,v); Z(VCRunTimeProp,run_time); Z(VCSnoozeTimeProp,snooze_time); Z(VCRepeatCountProp,repeat_count); Z(VCAudioContentProp,audio_content); #undef Z return aalarm; } DLLEXPORT(VObject*) vcsAddMAlarm( VObject *vevent, char *run_time, char *snooze_time, char *repeat_count, char *email_address, char *note ) { VObject *malarm= addProp(vevent,VCMAlarmProp); #define Z(p,v) if (v) addPropValue(malarm,p,v); Z(VCRunTimeProp,run_time); Z(VCSnoozeTimeProp,snooze_time); Z(VCRepeatCountProp,repeat_count); Z(VCEmailAddressProp,email_address); Z(VCNoteProp,note); #undef Z return malarm; } DLLEXPORT(VObject*) vcsAddDAlarm( VObject *vevent, char *run_time, char *snooze_time, char *repeat_count, char *display_string ) { VObject *dalarm= addProp(vevent,VCDAlarmProp); #define Z(p,v) if (v) addPropValue(dalarm,p,v); Z(VCRunTimeProp,run_time); Z(VCSnoozeTimeProp,snooze_time); Z(VCRepeatCountProp,repeat_count); Z(VCDisplayStringProp,display_string); #undef Z return dalarm; } DLLEXPORT(VObject*) vcsAddPAlarm( VObject *vevent, char *run_time, char *snooze_time, char *repeat_count, char *procedure_name ) { VObject *palarm= addProp(vevent,VCPAlarmProp); #define Z(p,v) if (v) addPropValue(palarm,p,v); Z(VCRunTimeProp,run_time); Z(VCSnoozeTimeProp,snooze_time); Z(VCRepeatCountProp,repeat_count); Z(VCProcedureNameProp,procedure_name); #undef Z return palarm; } #ifdef _TEST #if 0 This testcase would generate a file call "frankcal.vcf" with the following content: BEGIN:VCALENDAR DCREATED:19960523T100522 GEO:37.24,-17.87 PRODID:-//Frank Dawson/Hand Crafted In North Carolina//NONSGML Made By Hand//EN VERSION:0.3 BEGIN:VEVENT DTSTART:19960523T120000 DTEND:19960523T130000 DESCRIPTION;QUOTED-PRINTABLE:VERSIT PDI PR Teleconference/Interview =0A= With Tom Streeter and Frank Dawson - Discuss VERSIT PDI project and vCard and vCalendar=0A= activities with European Press representatives. SUMMARY:VERSIT PDI PR Teleconference/Interview CATEGORIES:PHONE CALL STATUS:CONFIRMED TRANSP:19960523T100522-4000F100582713-009251 UID:http://www.ibm.com/raleigh/fdawson/~c:\or2\orgfiles\versit.or2 DALARM:19960523T114500;5;3;Your Telecon Starts At Noon!!!; MALARM:19960522T120000;;;fdawson@raleigh.ibm.com;Remember 05/23 Noon Telecon!!!; PALARM:19960523T115500;;;c:\or2\organize.exe c:\or2\orgfiles\versit.or2; X-LDC-OR2-OLE:c:\temp\agenda.doc END:VEVENT BEGIN:VTODO DUE:19960614T0173000 DESCRIPTION:Review VCalendar helper API. END:VTODO END:VCALENDAR #endif void testVcalAPIs() { FILE *fp; VObject *vcal = vcsCreateVCal( "19960523T100522", "37.24,-17.87", "-//Frank Dawson/Hand Crafted In North Carolina//NONSGML Made By Hand//EN", 0, "0.3" ); VObject *vevent = vcsAddEvent( vcal, "19960523T120000", "19960523T130000", "VERSIT PDI PR Teleconference/Interview \nWith Tom Streeter and Frank Dawson - Discuss VERSIT PDI project and vCard and vCalendar\nactivities with European Press representatives.", "VERSIT PDI PR Teleconference/Interview", "PHONE CALL", 0, "CONFIRMED", "19960523T100522-4000F100582713-009251", "http://www.ibm.com/raleigh/fdawson/~c:\\or2\\orgfiles\\versit.or2", 0 ); vcsAddDAlarm(vevent, "19960523T114500", "5", "3", "Your Telecon Starts At Noon!!!"); vcsAddMAlarm(vevent, "19960522T120000", 0, 0, "fdawson@raleigh.ibm.com", "Remember 05/23 Noon Telecon!!!"); vcsAddPAlarm(vevent, "19960523T115500", 0 ,0, "c:\\or2\\organize.exe c:\\or2\\orgfiles\\versit.or2"); addPropValue(vevent, "X-LDC-OR2-OLE", "c:\\temp\\agenda.doc"); vcsAddTodo( vcal, 0, "19960614T0173000", 0, "Review VCalendar helper API.", 0, 0, 0, 0, 0, 0 ); /* now do something to the resulting VObject */ /* pretty print on stdout for fun */ printVObject(vcal); /* open the output text file */ #define OUTFILE "frankcal.vcf" fp = fopen(OUTFILE, "w"); if (fp) { /* write it in text form */ writeVObject(fp,vcal); fclose(fp); } else { printf("open output file '%s' failed\n", OUTFILE); } } void main() { testVcalAPIs(); } #endif /* end of source file vcaltmp.c */ a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/x11-servers?h=gnome-3.24&id=b227b572d808bc9da030a9f4a079976d44caca94'>- Remove WITH_FBSD10_FIX, is no longer neededmiwi2011-11-093-3/+0 * - Fix build on FreeBSD 10.0miwi2011-10-293-1/+3 * Fix CVE-2011-4028 and CVE-2011-4029.kwm2011-10-192-4/+22 * - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-241-2/+2 * Mark as broken on recent i386-9: fails to compile.linimon2011-08-291-1/+7 * Remove USE_GNOME=gnometarget from ports. It has been a empty keyword sincekwm2011-08-121-1/+0 * Fix the "exaGetPixmapFirstPixel called for invalid bpp" problem. This bugkwm2011-08-072-1/+27 * Unbreak this -- random automake fallout not shown up on amd64 -exp runsade2011-03-212-1/+7 * - Get Rid MD5 supportmiwi2011-03-194-5/+0 * - point x2x to its new homebapt2011-03-113-2/+3 * Revert "dix: use the event mask of the grab for TryClientEvents."naddy2011-02-282-0/+90 * - Please welcome Xorg 7.5.1miwi2011-02-2613-41/+15 * - There's no nv(4x) manpage in xorg-server distribution anymore.stas2011-01-251-1/+0 * - Fix build on powerpc64.stas2011-01-251-1/+1 * - DISTNAME= ${PORTNAME}-${PORTVERSION} is the default and not needed.pgollucci2010-12-301-1/+0 * Sync to new bsd.autotools.mkade2010-12-041-1/+1 * Punt autoconf267->autoconf268ade2010-10-161-1/+1 * Autotools update. Read ports/UPDATING 20100915 for details.ade2010-09-161-2/+2 * - Fix build on ppcmiwi2010-05-051-11/+0 * - Update to Xorg 7.5miwi2010-05-0113-46/+37 * Given that HAL doesn't work on sparc64 and always needs to be disabledmarius2010-02-081-2/+11 * Update xorg-server and friends to 1.6.5.rnoland2010-02-0711-44/+20 * For ports maintained by ports@FreeBSD.org, remove names and/ordougb2009-12-211-3/+0 * Mark BROKEN on 9.x: does not builderwin2009-12-161-0/+4 * -Repocopy devel/libtool15 -> libtool22 and libltdl15 -> libltdl22.mezz2009-08-031-1/+1 * Allow building on ia64. This does not make it functional, becausemarcel2009-06-202-1/+229 * Convert most of remaining ports that depend on xorg-libraries toamdmi32009-06-091-1/+2 * Update Xserver and friends to 1.6.1rnoland2009-05-0812-41/+35 * Update Xorg server to 1.6.0rnoland2009-04-0419-625/+111 * Given that the x86-centric approach of mmap(2)'ing PCI memory viamarius2009-04-012-1/+14 * Add the patch that I missed in the last commit.rnoland2009-03-091-0/+90 * Add a patch from git to fix issues with gnome-2.25.rnoland2009-03-092-2/+1 * Add a patch to handle memory barriers on amd64 the same as linux.rnoland2009-03-032-1/+12 * Add a patch to deal with the hald/xorg startup race. With this patchrnoland2009-02-082-1/+144 * - Replace open(2)/close(2) pairs with stat(2). Closing mouse device hasjkim2009-02-052-28/+62 * - Partially back out the previous attempt to fix PS/2 protocol support.jkim2009-02-032-14/+23 * Add dependency on dri2proto to more server components.rnoland2009-01-283-3/+6 * Build record and xtrap extensions.flz2009-01-272-2/+7 * add dri2proto depend here as wellrnoland2009-01-261-1/+2 * Add dependency on dri2protornoland2009-01-261-1/+2 * - Update X.org ports to 7.4+ (few ports are more recent than the katamari).flz2009-01-2419-566/+60 * Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-211-1/+0 * Conversion from (now defunct) autoconf-2.61 to autoconf-2.62ade2008-08-201-1/+1 * Reset grog@FreeBSD.org: last commit was more than 6 months ago, andlinimon2008-08-071-1/+1 * - fix typo -> plist for -DNOPORTDOCSitetcu2008-07-042-7/+10 * Remove x11-servers/xorg-server-snap as it has been unmaintained for a while.flz2008-06-1916-698/+0 * Update x11-servers/xorg-server to 1.4.2 (security update).flz2008-06-155-681/+4 * Explicitely disable dtrace support for now.flz2008-06-094-4/+4 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-064-3/+4 * Add upstream patch (don't free not-allocated dbus socket).flz2008-05-292-1/+15 * Disable dtrace support for now as userland tracing isn't supported yet.flz2008-05-271-1/+1 * Add xephyr, a kdrive-based X server. Xephyr will ultimately replace Xnest.flz2008-05-204-0/+55 * Mark xorg-server-snap as DEPRECATED and set EXPIRATION_DATE to next month.flz2008-05-201-0/+2 * Retire xorg-printserver.flz2008-05-165-972/+0 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-207-11/+12 * - Auto-detect and use native extended PS/2 protocols with the latest psm(4).jkim2008-04-163-33/+102 * Fix mouse probing issues with HAL support:jkim2008-04-023-1/+154 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-261-1/+1 * Add inputproto and xtrans to USE_XORG.flz2008-03-151-2/+3 * Add inputproto and xtrans to USE_XORG.flz2008-03-151-2/+3 * Add patch that fixes xmodmap use in .xinitrc.flz2008-03-132-1/+148 * Remove support for XFree8-4.flz2008-03-0850-2241/+0 * - Check correct POSIX spec. date for clock_gettime(2) whetherjkim2008-03-063-1/+26 * Fix xserver multiple vulnerabilities.flz2008-01-232-1/+516 * - Add local patch to fix alpha build. [1]flz2008-01-023-2/+40 * - OPTIONS'ify.flz2007-12-133-1/+40 * - OPTIONS'ify (HAL, AIGLX, SUID).flz2007-12-131-20/+24 * Fix plist for sparc64. Should be a no-op on other archs, but bumplinimon2007-11-202-13/+14 * Add temporary fix for LEDs. Proper fix will be available in nextflz2007-10-292-1/+21 * Restore default optimization on RELENG_7.flz2007-10-241-4/+0 * - Explicit some configure arguments.flz2007-10-101-11/+7 * Change to new x11-drivers category.nork2007-10-069-382/+0 * Teach xorg-server that FreeBSD >= 700053 supports PCI domains andmarius2007-09-303-0/+395 * Switch autoconf dependencies from 2.53 or 2.59 to 2.61.linimon2007-09-301-2/+2 * - Update X.org ports to 7.3.flz2007-09-1427-406/+147 * - Consistencify descriptionsdanfe2007-07-031-4/+2 * Fix missing Xlibs dependency.danfe2007-07-031-0/+1 * - Fix the build with recent GCC [1]danfe2007-07-013-10/+135 * Band-aid over memory hungry gcc 4.2 when compiling xf86ScanPci.c.lesi2007-06-222-0/+15 * Clenup share/X11 directory upon deinstall.lesi2007-05-312-0/+2 * xorg-fontserver moved from x11-servers to x11-fonts (xfs).flz2007-05-209-160/+0