2003-07-01 20:37:09 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
2002-04-30 22:22:54 +00:00
|
|
|
// Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
// compliance with the License. You may obtain a copy of the License at
|
2003-07-01 20:37:09 +00:00
|
|
|
// http://boinc.berkeley.edu/license_1.0.txt
|
2003-10-03 06:46:22 +00:00
|
|
|
//
|
2002-04-30 22:22:54 +00:00
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
2003-10-03 06:46:22 +00:00
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
2002-04-30 22:22:54 +00:00
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
2003-10-03 06:46:22 +00:00
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
2002-04-30 22:22:54 +00:00
|
|
|
// Contributor(s):
|
|
|
|
//
|
|
|
|
|
2004-06-12 18:44:53 +00:00
|
|
|
#ifndef PARSE_H
|
|
|
|
#define PARSE_H
|
|
|
|
|
2004-06-10 07:49:50 +00:00
|
|
|
#ifndef _WIN32
|
2003-10-03 06:46:22 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
2003-06-16 19:06:08 +00:00
|
|
|
#include <string>
|
2004-06-10 07:49:50 +00:00
|
|
|
#endif
|
2003-10-03 06:46:22 +00:00
|
|
|
|
2003-06-17 01:03:45 +00:00
|
|
|
extern bool parse(char* , char* );
|
|
|
|
extern bool parse_int(const char* buf, const char*tag, int&);
|
|
|
|
extern bool parse_double(const char*, const char*, double&);
|
|
|
|
extern bool parse_str(const char*, const char*, char*, int);
|
2004-06-30 18:17:21 +00:00
|
|
|
extern bool parse_str(const char* buf, const char* tag, std::string& dest);
|
2003-06-17 18:43:13 +00:00
|
|
|
extern void parse_attr(const char* buf, const char* attrname, char* out, int len);
|
2003-06-17 01:03:45 +00:00
|
|
|
extern bool match_tag(const char*, const char*);
|
|
|
|
extern bool match_tag(const std::string &, const char*);
|
2002-04-30 22:22:54 +00:00
|
|
|
extern void copy_stream(FILE* in, FILE* out);
|
2002-07-05 05:33:40 +00:00
|
|
|
extern void strcatdup(char*& p, char* buf);
|
2003-06-17 01:03:45 +00:00
|
|
|
extern int dup_element_contents(FILE* in, const char* end_tag, char** pp);
|
|
|
|
extern int copy_element_contents(FILE* in, const char* end_tag, char* p, int len);
|
2004-06-30 18:17:21 +00:00
|
|
|
extern int copy_element_contents(FILE* in, const char* end_tag, std::string&);
|
2003-06-17 01:03:45 +00:00
|
|
|
extern int read_file_malloc(const char* pathname, char*& str);
|
2004-09-13 18:05:54 +00:00
|
|
|
extern void replace_element_contents(
|
|
|
|
char* buf, char* start, char* end, char* replacement
|
|
|
|
);
|
|
|
|
extern bool str_replace(char* str, char* old, char* neww);
|
2003-05-20 00:03:39 +00:00
|
|
|
extern char* sgets(char* buf, int len, char* &in);
|
2004-06-30 18:17:21 +00:00
|
|
|
extern void xml_escape(std::string&, std::string&);
|
2004-07-15 18:54:17 +00:00
|
|
|
extern void xml_escape(char*, std::string&);
|
2004-06-30 18:17:21 +00:00
|
|
|
extern void xml_unescape(std::string&, std::string&);
|
2004-03-31 06:07:17 +00:00
|
|
|
extern void extract_venue(char*, char*, char*);
|
2004-06-12 18:44:53 +00:00
|
|
|
|
|
|
|
#endif
|