-
Notifications
You must be signed in to change notification settings - Fork 1
/
icalroutines.h
executable file
·84 lines (73 loc) · 2.31 KB
/
icalroutines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* #$Id: icalroutines.h,v 1.2 2000/05/11 19:43:23 inan Exp $
*
* Libmcal - Modular Calendar Access Library
* Copyright (C) 1999 Mark Musone and Andrew Skalski
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Contact Information:
*
* Mark Musone
* musone@chek.com
*
* Andrew Skalski
* askalski@chek.com
*
* mcal@lists.chek.com
*/
#ifndef _ICALROUTINES_H
#define _ICALROUTINES_H
#include <stdio.h>
#include "mcal.h"
typedef enum {
ICALTOK_ID,
ICALTOK_COLON,
ICALTOK_PARAMETER,
ICALTOK_VALUE,
ICALTOK_LF,
ICALTOK_JUNK,
ICALTOK_EOF
} icaltoken_t;
/* ICAL parser. */
extern char *ical_yytext;
extern size_t ical_yyleng;
int ical_yylex(void);
void ical_usebuf(const char *buf, size_t size);
void ical_preprocess(char *buf, size_t *size);
bool ical_parse(CALEVENT **event, const char *buf, size_t size);
bool ical_parse_vevent(CALEVENT *event);
/* ICAL output. */
FILE* icalout_begin(void);
bool icalout_event(FILE *tmp, const CALEVENT *event);
char* icalout_end(FILE *tmp);
void icalout_label(FILE *out, const char *label);
void icalout_number(FILE *out, unsigned long value);
void icalout_string(FILE *out, const char *value);
void icalout_datetime(FILE *out, const datetime_t *value);
void ical_encode_base64( FILE *out,
const unsigned char *buf,
size_t size);
/* ICAL formatting. */
#define BYDAY_INIT {0, {0,0,0,0,0,0,0}}
typedef struct {
unsigned int weekdays;
int ordwk[7];
} byday_t;
void ical_set_byday(char *output, const byday_t *input);
void ical_get_byday(byday_t *output, const char *input);
void ical_get_recur_freq( recur_t *output, const char *input, const char *byday);
#endif