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