summaryrefslogtreecommitdiffstats
path: root/libkcal/libical/examples/parse_text.c
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-14 02:06:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-05-14 02:06:47 +0000
commitacc2b77512ce0d8d708dda14dec1464f3eed830c (patch)
tree7917cc141e67ba40a4d4b06c752b66ede069b3da /libkcal/libical/examples/parse_text.c
parent54887c51b14c7707178d43d39413bf1bc7a17472 (diff)
downloadtdepim-acc2b77512ce0d8d708dda14dec1464f3eed830c.tar.gz
tdepim-acc2b77512ce0d8d708dda14dec1464f3eed830c.zip
Second batch of kdepim stability and functionality repairs
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1126473 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/libical/examples/parse_text.c')
-rw-r--r--libkcal/libical/examples/parse_text.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/libkcal/libical/examples/parse_text.c b/libkcal/libical/examples/parse_text.c
deleted file mode 100644
index b7eba43b..00000000
--- a/libkcal/libical/examples/parse_text.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* parse_text.c
-
- */
-#include <stdio.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include "ical.h"
-
-#include <stdlib.h>
-
-/* The icalparser_get_line routine will create a single *content* line
-out of one or more input lines. The content line is all of the
-properties and values for a single property, and it can span several
-input lines. So, icalparser_get_line will need to be able to get more
-data on its own. Read_string is a routine that does this. You can
-write your own version of read stream to get data from other types of
-files, sockets, etc. */
-
-char* read_stream(char *s, size_t size, void *d)
-{
- char *c = fgets(s,size, (FILE*)d);
-
- return c;
-
-}
-
-void parse_text(int argc, char* argv[])
-{
-
- char* line;
- FILE* stream;
- icalcomponent *c;
-
- /* Create a new parser object */
- icalparser *parser = icalparser_new();
-
- stream = fopen(argv[1],"r");
-
- assert(stream != 0);
-
- /* Tell the parser what input routie it should use. */
- icalparser_set_gen_data(parser,stream);
-
- do{
-
- /* Get a single content line by making one or more calls to
- read_stream()*/
- line = icalparser_get_line(parser,read_stream);
-
- /* Now, add that line into the parser object. If that line
- completes a component, c will be non-zero */
- c = icalparser_add_line(parser,line);
-
-
- if (c != 0){
- printf("%s",icalcomponent_as_ical_string(c));
-
- printf("\n---------------\n");
-
- icalcomponent_free(c);
- }
-
- } while ( line != 0);
-
-
- icalparser_free(parser);
-}