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):
|
|
|
|
//
|
|
|
|
|
2003-10-03 06:46:22 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
2003-06-16 19:06:08 +00:00
|
|
|
#include <string>
|
2004-03-06 09:45:25 +00:00
|
|
|
using namespace std;
|
2004-03-04 11:41:43 +00:00
|
|
|
|
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);
|
2003-11-28 19:19:11 +00:00
|
|
|
extern bool parse_str(const char* buf, const char* tag, 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);
|
2003-11-28 19:19:11 +00:00
|
|
|
extern int copy_element_contents(FILE* in, const char* end_tag, string&);
|
2003-06-17 01:03:45 +00:00
|
|
|
extern int read_file_malloc(const char* pathname, char*& str);
|
2002-12-20 02:12:27 +00:00
|
|
|
extern void replace_element(char* buf, char* start, char* end, char* replacement);
|
2003-05-20 00:03:39 +00:00
|
|
|
extern char* sgets(char* buf, int len, char* &in);
|
2004-02-02 19:44:47 +00:00
|
|
|
extern void xml_escape(string&, string&);
|
|
|
|
extern void xml_unescape(string&, string&);
|
2004-03-31 06:07:17 +00:00
|
|
|
extern void extract_venue(char*, char*, char*);
|