Annotation of parser3/src/include/pa_common.h, revision 1.16
1.15 paf 1: /** @file
1.16 ! paf 2: Parser: commonly used functions.
! 3:
1.4 paf 4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.16 ! paf 5:
1.5 paf 6: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
1.4 paf 7:
1.16 ! paf 8: $Id: pa_common.h,v 1.15 2001/03/19 15:29:37 paf Exp $
1.1 paf 9: */
10:
11: #ifndef PA_COMMON_H
12: #define PA_COMMON_H
13:
1.14 paf 14: #ifdef HAVE_CONFIG_H
15: # include "pa_config.h"
16: #endif
1.11 paf 17:
1.1 paf 18: #include <stdarg.h>
1.2 paf 19: #include "pa_pool.h"
1.1 paf 20:
1.14 paf 21: class String;
22: class Value;
1.11 paf 23:
1.1 paf 24: #ifdef WIN32
1.12 paf 25:
26: #define open _open
27: #define close _close
28: #define read _read
29: #define stat _stat
30:
1.1 paf 31: #define vsnprintf __vsnprintf
32: #define snprintf __snprintf
33:
34: int __vsnprintf(char *, size_t, const char *, va_list);
35: int __snprintf(char *, size_t, const char *, ...);
1.11 paf 36:
1.1 paf 37: #endif
1.2 paf 38:
1.15 paf 39: /**
40: read specified file using pool,
41: if fail_on_read_problem is true[default] throws an exception
42: */
1.8 paf 43: char *file_read(Pool& pool, const char *fname, bool fail_on_read_problem=true);
1.15 paf 44:
45: /**
46: scans for \a delim[default \n] in \a *row_ref,
47: \return piece of line before it or end of string, if no \a delim found
48: assigns \a *row_ref to point right after delimiter if there were one
49: or to zero if no \a delim were found.
50: */
1.7 paf 51: char *getrow(char **row_ref,char delim='\n');
52: //char *lsplit(char *,char);
53: char *lsplit(char **string_ref,char delim);
1.8 paf 54: char *rsplit(char *string, char delim);
1.9 paf 55: char *format(Pool& pool, double value, char *fmt);
1.10 paf 56:
57: #ifndef max
58: inline int max(int a,int b) { return a>b?a:b; }
59: inline int min(int a,int b){ return a<b?a:b; }
60: #endif
61:
1.13 paf 62: size_t stdout_write(const char *buf, size_t size);
1.14 paf 63:
64: const char *unescape_chars(Pool& pool, const char *cp, int len);
65:
66: const String& attributed_meaning_string(Value *meaning);
1.1 paf 67:
68: #endif
E-mail: