File: icalroutines.h

package info (click to toggle)
libmcal 0.6-12
  • links: PTS
  • area: main
  • in suites: woody
  • size: 556 kB
  • ctags: 472
  • sloc: ansic: 4,397; makefile: 180; sh: 111
file content (74 lines) | stat: -rw-r--r-- 2,027 bytes parent folder | download | duplicates (4)
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
/*
 *	#$Id: icalroutines.h,v 1.1 2000/01/25 03:08:10 markie 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 int	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);


#endif