1 #ifndef CLIB_CALENDAR_PROTOS_H
    2 #define CLIB_CALENDAR_PROTOS_H
    3 
    4 /***************************************************************************/
    5 
    6 /*
    7 **  $VER: calendar_protos.h 1.0 (01.03.2023)
    8 **
    9 **   Copyright (C) 2023 Guido Mersmann <geit@gmx.de>
   10 **   All rights reserved.
   11 */
   12 
   13 /***************************************************************************/
   14 
   15 #ifndef  EXEC_TYPES_H
   16 #include <exec/types.h>
   17 #endif
   18 #ifndef  UTILITY_TAGITEM_H
   19 #include <utility/tagitem.h>
   20 #endif
   21 #ifndef  UTILITY_HOOKS_H
   22 #include <utility/hooks.h>
   23 #endif
   24 
   25 #ifdef __cplusplus
   26 extern "C" {
   27 #endif /* __cplusplus */
   28 
   29 /***************************************************************************/
   30 IPTR                         Calendar_ReadDateTime( struct CalendarDate *cd );
   31 IPTR                         Calendar_ValidateDate( struct CalendarDate *cd, BOOL FixDate );
   32 IPTR                         Calendar_ValidateDateRange( struct CalendarDate *start, struct CalendarDate *end, BOOL FixDate );
   33 
   34 IPTR                         Calendar_ConvertToJulianDay( struct CalendarDate *cd );
   35 void                         Calendar_ConvertFromJulianDay( struct CalendarDate *cd, IPTR JulianDay );
   36 UWORD                        Calendar_GetDaysInMonth( UWORD month, UWORD year );
   37 UWORD                        Calendar_GetWeeksInYear( UWORD year );
   38 IPTR                         Calendar_GetWeekOfYear( struct CalendarDate *cd );
   39 UWORD                        Calendar_GetDayOfWeek( struct CalendarDate *cd );
   40 IPTR                         Calendar_GetDayOfYear( struct CalendarDate *cd );
   41 UWORD                        Calendar_GetLastDayOfWeek( UWORD month, UWORD year, UWORD weekday );
   42 UWORD                        Calendar_GetFirstDayOfWeek( UWORD month, UWORD year, UWORD weekday );
   43 UWORD                        Calendar_CalendarDateAdd( struct LibBase *MyLibBase, struct CalendarDate *cd, UWORD days, UWORD months, UWORD years );
   44 UWORD                        Calendar_CalendarDateSub( struct LibBase *MyLibBase, struct CalendarDate *cd, UWORD days, UWORD months, UWORD years );
   45 IPTR                         Calendar_Reserved1( void );
   46 IPTR                         Calendar_Reserved2( void );
   47 IPTR                         Calendar_Reserved3( void );
   48 IPTR                         Calendar_Reserved4( void );
   49 
   50 APTR                         Calendar_DatabaseOpenTagList( STRPTR name, struct TagItem *tags );
   51 #if !defined(USE_INLINE_STDARG)
   52 APTR                         Calendar_DatabaseOpenTags( STRPTR name, IPTR tag, ... );
   53 #endif
   54 void                         Calendar_DatabaseClose( APTR cdb );
   55 IPTR                         Calendar_EventAddTagList( APTR cdb, struct TagItem *tags );
   56 #if !defined(USE_INLINE_STDARG)
   57 IPTR                         Calendar_EventAddTags( APTR cdb, IPTR tag, ... );
   58 #endif
   59 IPTR                         Calendar_EventRemove( APTR cdb, IPTR EventID );
   60 IPTR                         Calendar_EventRemoveAll( APTR cdb );
   61 IPTR                         Calendar_EventCheck( APTR cdb, IPTR EventID );
   62 IPTR                         Calendar_EventSetTagList( APTR cdb, struct TagItem *tags );
   63 #if !defined(USE_INLINE_STDARG)
   64 IPTR                         Calendar_EventSetTags( APTR cdb, IPTR tag, ... );
   65 #endif
   66 APTR                         Calendar_EventQueryBeginTagList( APTR cdb, struct TagItem *tags );
   67 #if !defined(USE_INLINE_STDARG)
   68 APTR                         Calendar_EventQueryBeginTags( APTR cdb, IPTR tag, ... );
   69 #endif
   70 IPTR                         Calendar_EventQueryTagList( APTR QueryHandle, struct TagItem *tags );
   71 #if !defined(USE_INLINE_STDARG)
   72 IPTR                         Calendar_EventQueryTags( APTR QueryHandle, IPTR tag, ... );
   73 #endif
   74 IPTR                         Calendar_EventQueryDayTagList( APTR QueryHandle, struct TagItem *tags );
   75 #if !defined(USE_INLINE_STDARG)
   76 IPTR                         Calendar_EventQueryDayTags( APTR QueryHandle, IPTR tag, ... );
   77 #endif
   78 void                         Calendar_EventQueryEnd( APTR QueryHandle );
   79 APTR                         Calendar_NotificationAddTagList( APTR cdb, IPTR NotifyFlags, struct TagItem *tags );
   80 #if !defined(USE_INLINE_STDARG)
   81 IPTR                         Calendar_NotificationAddTags( APTR cdb, IPTR NotifyFlags, IPTR tag, ... );
   82 #endif
   83 IPTR                         Calendar_NotificationRemove( APTR cdb, APTR notificationhandle );
   84 
   85 /***************************************************************************/
   86 
   87 #ifdef __cplusplus
   88 }
   89 #endif
   90 
   91 #endif /* CLIB_CALENDAR_PROTOS_H */