/[ascend]/trunk/base/generic/compiler/braced.h
ViewVC logotype

Contents of /trunk/base/generic/compiler/braced.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1063 - (show annotations) (download) (as text)
Sun Jan 7 07:54:06 2007 UTC (17 years, 9 months ago) by johnpye
File MIME type: text/x-chdr
File size: 3097 byte(s)
Changed ASC_DLLSPEC(TYPE) to ASC_DLLSPEC TYPE, because it was causing havoc with doxygen and ctags.
1 /* ASCEND modelling environment
2 Copyright (C) 1998 Carnegie Mellon University
3 Copyright (C) 2006 Carnegie Mellon University
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 *//** @file
20 Module for storing braced text of notes and some other
21 BRACEDTEXT_T applications.
22
23 What we're calling "braced text" is just a regular C char* augmented with a
24 language attribute and string length, and with reference counting.
25
26 Not everything that is defined as BRACEDTEXT_T in the grammar is necessarily
27 kept by using this module. For example, some units END up in the symbol
28 table.
29
30 'struct bracechar' is defined first in compiler.h, to hide the details of
31 whatever it is we do with braced text in composing NOTES and other
32 persistent forms.
33
34 Braced text may be very long.
35 *//*
36 By Benjamin Allan, March 20, 1998.
37 Last in CVS:$Revision: 1.5 $ $Date: 1998/06/16 16:38:39 $ $Author: mthomas $
38 */
39
40 #ifndef ASC_BRACED_H
41 #define ASC_BRACED_H
42
43 #include <utilities/ascConfig.h>
44 #include "compiler.h"
45
46 /**
47 * Creates a bracechar from a string. We do not keep the string.
48 * If a lang is given, it is kept.
49 */
50 extern struct bracechar *AddBraceChar(CONST char *string, symchar *lang);
51
52 /**
53 * Increments a reference count and returns bc.
54 */
55 extern struct bracechar *CopyBraceChar(struct bracechar *bc);
56
57 /**
58 * Frees memory associated with bc (subject to refcounting).
59 */
60 extern void DestroyBraceChar(struct bracechar *bc);
61
62 /**
63 * Returns a string of the bracechar content for READ-ONLY
64 * use. Since we frequently want to use this inside
65 * printf and the like, a short macro form is provided.
66 */
67 ASC_DLLSPEC CONST char *BraceCharString(struct bracechar *sbc);
68 /** Shortcut to BraceCharString(). */
69 #define BCS(sbc) BraceCharString(sbc)
70
71 /**
72 * Returns a 'language' of the bracechar content for READ-ONLY
73 * use. Since we frequently want to use this inside
74 * printf and the like, a short macro form is provided.
75 * Will not be NULL. To print, wrap in SCP.
76 */
77 extern symchar *BraceCharLang(struct bracechar *sbc);
78 /** Shortcut to BraceCharLang(). */
79 #define BCLANG(sbc) BraceCharLang(sbc)
80
81 /**
82 * Returns length of the bracechar content for READ-ONLY
83 * use. Since we frequently want to use this inside
84 * printf and the like, a short macro form is provided.
85 * will not be NULL. (This is not the length of lang).
86 */
87 ASC_DLLSPEC int BraceCharLen(struct bracechar *sbc);
88 /** Shortcut to BraceCharLen(). */
89 #define BCL(sbc) BraceCharLen(sbc)
90
91 #endif /* ASC_BRACED_H */

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22