Back to index

lightning-sunbird  0.9+nobinonly
icalparser.h
Go to the documentation of this file.
00001 /* -*- Mode: C -*- */
00002 /*======================================================================
00003   FILE: icalparser.h
00004   CREATOR: eric 20 April 1999
00005   
00006   $Id: icalparser.h,v 1.7 2002/06/28 08:55:23 acampi Exp $
00007 
00008 
00009  (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
00010 
00011  This program is free software; you can redistribute it and/or modify
00012  it under the terms of either: 
00013 
00014     The LGPL as published by the Free Software Foundation, version
00015     2.1, available at: http://www.fsf.org/copyleft/lesser.html
00016 
00017   Or:
00018 
00019     The Mozilla Public License Version 1.0. You may obtain a copy of
00020     the License at http://www.mozilla.org/MPL/
00021 
00022   The original code is icalparser.h
00023 
00024 ======================================================================*/
00025 
00026 
00027 #ifndef ICALPARSER_H
00028 #define ICALPARSER_H
00029 
00030 #include "icalenums.h"
00031 #include "icaltypes.h"
00032 #include"icalcomponent.h"
00033 
00034 #include <stdio.h> /* For FILE* */
00035 
00036 typedef struct icalparser_impl icalparser;
00037 
00038 
00048 typedef enum icalparser_state {
00049     ICALPARSER_ERROR,
00050     ICALPARSER_SUCCESS,
00051     ICALPARSER_BEGIN_COMP,
00052     ICALPARSER_END_COMP,
00053     ICALPARSER_IN_PROGRESS
00054 } icalparser_state;
00055 
00056 icalparser* icalparser_new(void);
00057 icalcomponent* icalparser_add_line(icalparser* parser, char* str );
00058 icalcomponent* icalparser_clean(icalparser* parser);
00059 icalparser_state icalparser_get_state(icalparser* parser);
00060 void icalparser_free(icalparser* parser);
00061 
00062 
00070 icalcomponent* icalparser_parse(icalparser *parser,
00071        char* (*line_gen_func)(char *s, size_t size, void *d));
00072 
00077 void icalparser_set_gen_data(icalparser* parser, void* data);
00078 
00079 
00080 icalcomponent* icalparser_parse_string(const char* str);
00081 
00082 
00083 /***********************************************************************
00084  * Parser support functions
00085  ***********************************************************************/
00086 
00088 icalvalue*  icalparser_parse_value(icalvalue_kind kind, 
00089                                const char* str, icalcomponent** errors);
00090 
00092 char* icalparser_get_line(icalparser* parser, char* (*line_gen_func)(char *s, size_t size, void *d));
00093 
00094 char* icalparser_string_line_generator(char *out, size_t buf_size, void *d);
00095 
00096 #endif /* !ICALPARSE_H */