source: branches/libc-0.6/src/emx/include/dyn-string.h

Last change on this file was 1506, checked in by bird, 21 years ago

@unixroot. header reviews. ++

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.4 KB
Line 
1/* dyn-string.h,v 1.2 2004/09/14 22:27:32 bird Exp */
2/** @file
3 * GNU, -liberty.
4 */
5
6/* An abstract string datatype.
7 Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
8 Contributed by Mark Mitchell (mark@markmitchell.com).
9
10This file is part of GCC.
11
12GCC is free software; you can redistribute it and/or modify
13it under the terms of the GNU General Public License as published by
14the Free Software Foundation; either version 2, or (at your option)
15any later version.
16
17GCC is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with GCC; see the file COPYING. If not, write to
24the Free Software Foundation, 59 Temple Place - Suite 330,
25Boston, MA 02111-1307, USA. */
26
27
28typedef struct dyn_string
29{
30 int allocated; /* The amount of space allocated for the string. */
31 int length; /* The actual length of the string. */
32 char *s; /* The string itself, NUL-terminated. */
33}* dyn_string_t;
34
35/* The length STR, in bytes, not including the terminating NUL. */
36#define dyn_string_length(STR) \
37 ((STR)->length)
38
39/* The NTBS in which the contents of STR are stored. */
40#define dyn_string_buf(STR) \
41 ((STR)->s)
42
43/* Compare DS1 to DS2 with strcmp. */
44#define dyn_string_compare(DS1, DS2) \
45 (strcmp ((DS1)->s, (DS2)->s))
46
47
48/* dyn_string functions are used in the demangling implementation
49 included in the G++ runtime library. To prevent collisions with
50 names in user programs, the functions that are used in the
51 demangler are given implementation-reserved names. */
52
53#if defined(IN_LIBGCC2) || defined(IN_GLIBCPP_V3)
54
55#define dyn_string_init __cxa_dyn_string_init
56#define dyn_string_new __cxa_dyn_string_new
57#define dyn_string_delete __cxa_dyn_string_delete
58#define dyn_string_release __cxa_dyn_string_release
59#define dyn_string_resize __cxa_dyn_string_resize
60#define dyn_string_clear __cxa_dyn_string_clear
61#define dyn_string_copy __cxa_dyn_string_copy
62#define dyn_string_copy_cstr __cxa_dyn_string_copy_cstr
63#define dyn_string_prepend __cxa_dyn_string_prepend
64#define dyn_string_prepend_cstr __cxa_dyn_string_prepend_cstr
65#define dyn_string_insert __cxa_dyn_string_insert
66#define dyn_string_insert_cstr __cxa_dyn_string_insert_cstr
67#define dyn_string_insert_char __cxa_dyn_string_insert_char
68#define dyn_string_append __cxa_dyn_string_append
69#define dyn_string_append_cstr __cxa_dyn_string_append_cstr
70#define dyn_string_append_char __cxa_dyn_string_append_char
71#define dyn_string_substring __cxa_dyn_string_substring
72#define dyn_string_eq __cxa_dyn_string_eq
73
74#endif /* IN_LIBGCC2 || IN_GLIBCPP_V3 */
75
76
77extern int dyn_string_init PARAMS ((struct dyn_string *, int));
78extern dyn_string_t dyn_string_new PARAMS ((int));
79extern void dyn_string_delete PARAMS ((dyn_string_t));
80extern char *dyn_string_release PARAMS ((dyn_string_t));
81extern dyn_string_t dyn_string_resize PARAMS ((dyn_string_t, int));
82extern void dyn_string_clear PARAMS ((dyn_string_t));
83extern int dyn_string_copy PARAMS ((dyn_string_t, dyn_string_t));
84extern int dyn_string_copy_cstr PARAMS ((dyn_string_t, const char *));
85extern int dyn_string_prepend PARAMS ((dyn_string_t, dyn_string_t));
86extern int dyn_string_prepend_cstr PARAMS ((dyn_string_t, const char *));
87extern int dyn_string_insert PARAMS ((dyn_string_t, int,
88 dyn_string_t));
89extern int dyn_string_insert_cstr PARAMS ((dyn_string_t, int,
90 const char *));
91extern int dyn_string_insert_char PARAMS ((dyn_string_t, int, int));
92extern int dyn_string_append PARAMS ((dyn_string_t, dyn_string_t));
93extern int dyn_string_append_cstr PARAMS ((dyn_string_t, const char *));
94extern int dyn_string_append_char PARAMS ((dyn_string_t, int));
95extern int dyn_string_substring PARAMS ((dyn_string_t,
96 dyn_string_t, int, int));
97extern int dyn_string_eq PARAMS ((dyn_string_t, dyn_string_t));
Note: See TracBrowser for help on using the repository browser.