Developer

API Reference

AEEVRRule

Brew Release
Brew MP 1.0.2
See Also
None
Description
Specifies the Recurrence rule. The structure used for Recurrence rule supports a subset of recurrence rules specified in vCalendar 1.0 & vCalendar 2.0.
AEEVRRule Usage examples
   vCalendar 1.0:

   (I)   To specify the associated event occurs every day:
         VCALENDAR_INITRULE(AEEVRule *recRule);
            nFrequency  = AEEVFREQUENCY_DAILY;
            dwCount     = 0;
   
   (II)  To specify the associated event occurs every day for the next five
         days:
            nFrequency  = AEEVFREQUENCY_DAILY;
            dwCount     = 5;

   (III) To specifiy the event occurs Daily for 10 occurrences:
         D1 #10
            nFrequency  = AEEVFREQUENCY_DAILY;
            dwInterval  = 1;
            dwCount     = 10;

   (IV)  To specify the event occurs Daily until 12/24/94:
         D1 19941224T000000Z
            nFrequency  = AEEVFREQUENCY_DAILY;
            dwInterval  = 1;
            enddate     = ..set the date here.

   (V)   To specify the event occurs Every other day - forever:
         D2 #0
            nFrequency  = AEEVFREQUENCY_DAILY;
            dwInterval  = 2;
            dwCount     = 0;

   (VI)  To specify the event occurs Every 10 days, 5 occruuences:
         D10 #5
            nFrequency  = AEEVFREQUENCY_DAILY;
            dwInterval  = 10;
            dwCount     = 5;

   (VII) To specify the event occurs Weekly for 10 occurrences:
         W1 #10
            nFrequency  = AEEVFREQUENCY_WEEKLY;
            dwInterval  = 1;
            dwCount     = 10;

   (VIII)To specify the event occurs Weekly until 12/24/94:
         W1 19941224T000000Z
            nFrequency  = AEEVFREQUENCY_WEEKLY
            dwInterval  = 1;
            enddate     = ..set the date here.

   (IX)  To specify the event occurs Every other week - forever:
         W2 #0
            nFrequency  = AEEVFREQUENCY_WEEKLY;
            dwInteval   = 2;
            dwCount     = 0;

   (X)   To specify the event occurs Weekly on Tuesday and Thursady for 5 Weeks:
         W1 TU TH #5
            nFrequency  = AEEVFREQUENCY_WEEKLY;
            dwInterval  =  1;
            dwWeekDay   = AEEVDAY_TUE | AEEVDAY_THU;
            dwCount     = 5;

   (XI)  To specify the event occurs Monthly on the 1st Friday for ten
         occurrences:MP1 1+ FR #10
            nFrequency  = AEEVFREQUENCY_MONTHLY;
            dwInterval  = 1;
            pnWeekDayList[5] = (int32 *)MALLOC(2*sizeof(int32));
            *pnWeekDayList[5]        = 1;
            *(pnWeekDayList[5] + 1)  = 0;
            dwCount     = 10;

   (XII) To specify the event occurs Every other month on the 1st and last 
         Sunday of the month for 10 occurrences.
         MP2 1+ Su 1- Su #10
            nFrequency  = AEEVFREQUENCY_MONTHLY;
            dwInterval  = 2;
            pnWeekDayList[0] = (int32 *)MALLOC(3*sizeof(int32));
            *pnWeekDayList[0]= 1;
            *(pnWeekDayList[0] + 1) = -1;
            *(pnWeekDayList[0] + 2) = 0;
            dwCount     = 10;

   (XIII)To specify Monthly on the 1st and last day of the month for 10
         occurrences.
         MD1 1 1- #10
            nFrequency          = AEEVFREQUENCY_MONTHLY;
            dwInterval          = 1;
            pnDayInMonth        = (int32 *)MALLOC(3*sizeof(int32));
            *pnDayInMonth       = 1;
            *(pnDayInMonth + 1) = -1;
            *(pnDayInMonth + 2) = 0;
            dwCount             = 10;


   (XIV) To specify this event occurs every week on Monday and Tuesday:
            nFrequency = AEEVFREQUENCY_WEEKLY;
            dwWeekDay = AEEVDAY_MON | AEEVDAY_TUE;

   (XV)  To specify the associated event occurs every third week on Friday:
            nFrequency  = AEEVFREQUENCY_WEEKLY;
            dwInterval  = 3;
            dwWeekDay = AEEVDAY_FRI;


   
   (XVI) To specify the associated event occurs every month on 10th, 11th,
         and 15th.
            nFrequency   = AEEVFREQUENCY_MONTHLY;
            pnDayInMonth = (int32 *)MALLOC(4*sizeof(int32));
            pnDayInMonth[0] = 10;
            pnDayInMonth[1] = 11;
            pnDayInMonth[2] = 15;
            pnDayInMonth[3] = 0; 

   (XVII)To specify a rule a like "W2 MO WE FR #10", you would say,
            nFrequency  =  AEEVFREQUENCY_WEEKLY;
            dwCount     =  10;
            dwInterval  =  2;
            dwWeekDay   =  AEEVDAY_MON | AEEVDAY_WED | AEEVDAY_FRI;

   (XVIII)To specify a rule like "MD1 12 3- #5", you would fill the structure as 
          follows,
            nFrequency = AEEVFREQUENCY_MONTHLY;
            dwCount    = 5;
            dwInterval = 1;
            pnDayInMonth =(int32 *)MALLOC(3*sizeof(int32));
            pnDayInMonth[0] = -3;
            pnDayInMonth[1] = 12;
            pnDayInMonth[3] = 0; 

   vCalendar 2.0:
   (I)   Daily for 10 occurrences. RRULE:FREQ=DAILY;COUNT=10
            nFrequency = AEEVFREQUENCY_DAILY;
            dwCount    = 10;

   (II)  Daily until December 24, 1997: RRULE:FREQ=DAILY;UNTIL=19971224T000000Z
            nFrequency = AEEVFREQUENCY_DAILY;
            endDate    =  .. //set the date here.

   (III) Every other day - forever:RRULE:FREQ=DAILY;INTERVAL=2
            nFrequency = AEEVFREQUENCY_DAILY
            dwInterval = 2;

   (IV)   Weekly on Tuesday and Thursday for 5 weeks:
         RRULE:FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH
            nFrequency = AEEVFREQUENCY_WEEKLY;
            dwCount    = 10;
            dwWKST     = AEEVDATY_SUN;
            dwWeekDay  = AEEVDAY_TUE | AEEVDAY_THU; 

   (V)   Every other week on Monday, Wednesday and Friday until December 24:
         RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,
         WE,FR
            nFrequency = AEEVFREQUENCY_WEEKLY;
            dwInterval = 2;
            endDate    = ..//Set the date here from UNTIL.
            dwWKST     = AEEVDAY_SUN;
            dwWeekDay  = AEEVDAY_MON | AEEVDAY_WED | AEEVDAY_FRI;

   (VI)  Monthly on the 1st Friday for ten occurrences:
         RRULE:FREQ=MONTHLY;COUNT=10;BYDAY=1FR
            nFrequency = AEEVFREQUENCY_MONTHLY;
            dwCount    = 10;
            pnWeekDayList[5] = (int32 *)MALLOC(2 * sizeof(int32));
            *pnWeekDayList[5] = 1;
            *(pnWeekDayList[5] + 1) = 0;

   (VII) Every other month on the 1st and last Sunday of the month for 10
         occurrences:RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU
            nFrequency = AEEVFREQUENCY_MONTHLY;
            dwInterval = 2;
            dwCount    = 10;
            pnWeekDayList[0] = (int32 *)MALLOC(3 * sizeof(int32));
            *pnWeekDayList[0] = 1;
            *(pnWeekDayList[0] + 1) = -1;
            *(pnWeekDayList[0] + 2) = 0;
           

   (VIII)Monthly on the third to the last day of the month, forever:
         RRULE:FREQ=MONTHLY;BYMONTHDAY=-3.
            nFrequency      = AEEVFREQUENCY_MONTHLY;
            pnDayInMonth    = (int32 *)MALLOC(2 * sizeof(int32));
            pnDayInMonth[0] = -3;
            pnDayInMonth[1] = 0; 

   (IX)  Every 18 months on the 10th thru 15th of the month for 10
         occurrences:
         RRULE:FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15
            nFrequency      = AEEVFREQUENCY_MONTHLY;
            dwInterval      = 18;
            dwCount         = 10;
            pnDayInMonth    = (int32 *)MALLOC(7* sizeof(int32));
            pnDayInMonth[0] = 10;
            pnDayInMonth[1] = 11;
            pnDayInMonth[2] = 12;
            pnDayInMonth[3] = 13;
            pnDayInMonth[4] = 14;
            pnDayInMonth[5] = 15;
            pnDayInMonth[6] = 0;  

   (X)   Everyday in January, for 3 years:
         RRULE:FREQ=YEARLY;UNTIL=20000131T090000Z;BYMONTH=1;BYDAY=SU,MO,TU,WE,
         TH,FR,SA
            nFrequency        = AEEVFREQUENCY_YEARLY;
            endDate           = ..//Set the date here from UNTIL.
            dwMonthInYear     = 1;
            dwWeekDay         = AEEVDAY_SUN | AEEVDAY_MON | AEEVDAY_TUE |
                                AEEVDAY_WED | AEEVDAY_THU | AEEVDAY_FRI |
                                AEEVDAY_SAT;

   (XI)  Yearly in June and July for 10 occurrences:
         RRULE:FREQ=YEARLY;COUNT=10;BYMONTH=6,7
             nFrequency       = AEEVFREQUENCY_YEARLY;
             dwCount          = 10;
             dwMonthInYear    = AEEVMONTH_JUN | AEEVMONTH_JUL;
  

Members
  • nFrequency    : Specifies the frequency of occurence.
  • dwCount       : Specifies the count of occurence.
  • dwInterval    : Specifies the interval. 0 when not specified
  • endDate       : End date. 0 when not specified. The UNTIL rule part defines
                       a date-time value which bounds the recurrence rule in an
                       inclusive manner.
  • dwWeekDay     : Specifies days in Week.
  • dwMonthInYear : Represent months of the year (in logical Bitwise OR).
  • dwWKST        : Specifies the day on which the workweek starts. Valid values
                       are MO, TU, WE, TH, FR, SA and SU.
  • dwSize        : Size of the structure.
  • pnBySecList   : Specifies seperated list of seconds within a minute.
                       NULL terminated.
  • pnByMinList   : Specifies seperated list of minutes within a hour.
                       NULL terminated.
  • pnByHrList    : specifies seperated list of hours of the day.
                       NULL terminated.
    
  • pnWeekDayList : Specifies the list of occurrences of speicific day in week
                       or month or year depends on nFrequency. It is specific to
                       BYDAY rule part.
  • pnWeekdayList[0] : Specific to Sunday.
  • pnWeekdayList[1] : Specific to Monday. Similarly 
                       2nd, 3rd, 4th, 5Th, 6th & 7Th arrays are corresponds to 
                       Tuesday, Wednesday, Thursday, Friday & Saturday respectively.
  • pnDayInMonth  : Pointer to an array containing Day in Month , NULL 
                       terminated Changed the above Data Type of pDayInMonth
                       from uint32 to int32 as some times, the rule may be
                       something like "MD1 3- #5" which means third to the last
                       day of the month for 5 occurences for every month. Here 
                       3- would be stored as -3 to indicate the third to the last
                       day of the month. valid values are 1 to 31 or -31 to -1.
  • pnDayInYear   : Pointer to an array containing Days in Year, Valid values are
                       1 to 366 or -366 to -1. For example -1 represents the last
                       day of the year. NULL terminated.
  • pnWeekNoList  : Specifies the weeks of the year. Valid values are 1 to 53 or
                       -53 to -1. Week number one of the calendar year is the first
    week which contains at least four (4) days in that calendar year. For example, 3 represents the third week of the year. NULL terminated.

  • pnBySpList    : Pointe to array containg values which corresponds to the nth
                       occurrence within the set of events specified by the rule.
                       Valid values are 1 to 366 or -366 to -1. NULL terminated.
Definition
   typedef struct
   {
      AEEVFrequency   nFrequency;
      uint32          dwCount;
      uint32          dwInterval;  
      AEEVUTCDate     endDate;
      uint32          dwWeekDay;
      uint32          dwMonthInYear;
      uint32          dwWKST;
      uint32          dwSize;
      uint32          *pnBySecList;
      uint32          *pnByMinList;
      uint32          *pnByHrList;
      int32           *pnWeekDayList[AEEV_NR_WEEKDAYS];
      int32           *pnDayInMonth;
      int32           *pnDayInYear;
      int32           *pnWeekNoList;
      int32           *pnBySpList;

   } AEEVRRule;
Comment
User should free the memory allocated for any members once he is done
  • Follow