Skip to content

Commit 3e8c116

Browse files
committed
cleanup and doxify src/express
1 parent a63ac73 commit 3e8c116

19 files changed

Lines changed: 816 additions & 1651 deletions

File tree

include/express/error.h

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#ifndef ERROR_H
22
#define ERROR_H
33

4-
/* $Id: error.h,v 1.8 1997/01/21 19:16:55 dar Exp $ */
5-
6-
/************************************************************************
7-
** Module: Error
4+
/** **********************************************************************
5+
** Module: Error \file error.h
86
** Description: This module implements the ERROR abstraction.
97
************************************************************************/
108

@@ -32,7 +30,7 @@
3230

3331
#include <scl_export.h>
3432
#include "basic.h" /* get basic definitions */
35-
#include "setjmp.h"
33+
#include <setjmp.h>
3634

3735
/*************/
3836
/* constants */
@@ -137,31 +135,23 @@ extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
137135

138136
#if supports_inline_functions || defined(ERROR_C)
139137

140-
static_inline
141-
void
142-
ERRORdisable( Error error ) {
138+
static_inline void ERRORdisable( Error error ) {
143139
if( error != ERROR_none ) {
144140
error->enabled = false;
145141
}
146142
}
147143

148-
static_inline
149-
void
150-
ERRORenable( Error error ) {
144+
static_inline void ERRORenable( Error error ) {
151145
if( error != ERROR_none ) {
152146
error->enabled = true;
153147
}
154148
}
155149

156-
static_inline
157-
bool
158-
ERRORis_enabled( Error error ) {
150+
static_inline bool ERRORis_enabled( Error error ) {
159151
return error->enabled;
160152
}
161153

162-
static_inline
163-
void
164-
ERRORbuffer_messages( bool flag ) {
154+
static_inline void ERRORbuffer_messages( bool flag ) {
165155
#if !defined(__MSVC__) && !defined(__BORLAND__)
166156
extern void ERROR_start_message_buffer( void ),
167157
ERROR_flush_message_buffer( void );
@@ -174,9 +164,7 @@ ERRORbuffer_messages( bool flag ) {
174164
}
175165
}
176166

177-
static_inline
178-
void
179-
ERRORflush_messages( void ) {
167+
static_inline void ERRORflush_messages( void ) {
180168
#if !defined(__MSVC__) && !defined(__BORLAND__)
181169
extern void ERROR_start_message_buffer( void ),
182170
ERROR_flush_message_buffer( void );
@@ -200,8 +188,7 @@ extern SCL_EXPRESS_EXPORT void ERRORnospace PROTO( ( void ) );
200188
extern SCL_EXPRESS_EXPORT void ERRORabort PROTO( ( int ) );
201189
extern SCL_EXPRESS_EXPORT Error ERRORcreate PROTO( ( char *, Severity ) );
202190
extern SCL_EXPRESS_EXPORT void ERRORreport PROTO( ( Error, ... ) );
203-
/*SUPPRESS 652*/ /* 1.? */
204-
/*SUPPRESS 842*/ /* 4.0.2 */
191+
205192
struct Symbol_; /* mention Symbol to avoid warning on following line */
206193
extern SCL_EXPRESS_EXPORT void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
207194
extern SCL_EXPRESS_EXPORT void ERRORreport_with_line PROTO( ( Error, int, ... ) );
@@ -221,10 +208,4 @@ extern SCL_EXPRESS_EXPORT void ERRORset_all_warnings PROTO( ( int ) );
221208
extern SCL_EXPRESS_EXPORT void ERRORsafe PROTO( ( jmp_buf env ) );
222209
extern SCL_EXPRESS_EXPORT void ERRORunsafe PROTO( ( void ) );
223210

224-
#if deprecated
225-
extern void ERRORdisable PROTO( ( Error ) );
226-
extern void ERRORenable PROTO( ( Error ) );
227-
extern Boolean ERRORis_enabled PROTO( ( Error ) );
228-
#endif
229-
230211
#endif /* ERROR_H */

include/express/object.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#ifndef OBJECT_H
22
#define OBJECT_H
33

4-
/* $Id: object.h,v 1.9 1997/01/21 19:17:11 dar Exp $ */
5-
6-
/************************************************************************
7-
** Module: Object
4+
/** **********************************************************************
5+
** Module: Object \file object.h
86
** Description: This module implements the Object abstraction.
97
** Constants:
108
** OBJECT_NULL - the null class
@@ -113,15 +111,5 @@ GLOBAL SCL_EXPRESS_EXPORT struct Object * OBJ;
113111
extern SCL_EXPRESS_EXPORT void OBJinitialize PROTO( ( void ) );
114112
extern SCL_EXPRESS_EXPORT void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
115113
extern SCL_EXPRESS_EXPORT Symbol * UNK_get_symbol PROTO( ( Generic x ) );
116-
#if 0
117-
extern void OBJcreate( char, struct Symbol * ( * )( Generic ), char *, int );
118-
#endif
119-
120-
/********************/
121-
/* inline functions */
122-
/********************/
123-
124-
#if supports_inline_functions || defined(OBJECT_C)
125-
#endif /* supports_inline_functions || defined(OBJECT_C) */
126114

127115
#endif /*OBJECT_H*/

include/express/symbol.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#ifndef SYMBOL_H
22
#define SYMBOL_H
33

4-
/* $Id: symbol.h,v 1.8 1997/01/21 19:17:11 dar Exp $ */
5-
6-
/************************************************************************
7-
** Module: Symbol
4+
/** **********************************************************************
5+
** Module: Symbol \file symbol.h
86
** Description: This module implements the Symbol abstraction.
97
** Constants:
108
** SYMBOL_NULL - the null Symbol
@@ -45,9 +43,6 @@
4543
/* packages used */
4644
/*****************/
4745

48-
#ifdef SYMBOL_C
49-
#endif /* SYMBOL_C */
50-
5146
#include <scl_export.h>
5247
#include "basic.h" /* get basic definitions */
5348
#include "memory.h"
@@ -96,15 +91,13 @@ GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SYMBOL_fl;
9691

9792
#define SYMBOLset(obj) obj->symbol.line = yylineno; \
9893
obj->symbol.filename = current_filename
99-
/* for backwards compatibility only, no one should ever need this */
100-
#define SYMBOLget_name(sym) ((sym)->name)
10194

10295
/***********************/
10396
/* function prototypes */
10497
/***********************/
10598

106-
extern SCL_EXPRESS_EXPORT void SYMBOLinitialize PROTO( ( void ) );
107-
SCL_EXPRESS_EXPORT Symbol * SYMBOLcreate PROTO( ( char *, int, char * ) );
99+
extern SCL_EXPRESS_EXPORT void SYMBOLinitialize( void );
100+
SCL_EXPRESS_EXPORT Symbol * SYMBOLcreate( char * name, int line, char * filename );
108101

109102
/********************/
110103
/* inline functions */

src/express/alg.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

3-
/************************************************************************
4-
** Module: Algorithm
5-
** Description: This module implements the Algorithm abstraction. An
3+
/** **********************************************************************
4+
** Module: Algorithm \file alg.c
5+
** This module implements the Algorithm abstraction. An
66
** algorithm can be a procedure, a function, or a rule. It consists
77
** of a name, a return type (for functions and rules), a list of
88
** formal parameters, and a list of statements (body).
@@ -43,8 +43,7 @@
4343
#include "express/object.h"
4444
#include "express/schema.h"
4545

46-
Scope
47-
ALGcreate( char type ) {
46+
Scope ALGcreate( char type ) {
4847
Scope s = SCOPEcreate( type );
4948

5049
switch( type ) {
@@ -61,20 +60,12 @@ ALGcreate( char type ) {
6160
return s;
6261
}
6362

64-
/*
65-
** Procedure: ALGinitialize
66-
** Parameters: -- none --
67-
** Returns: void
68-
** Description: Initialize the Algorithm module.
69-
*/
70-
71-
Symbol *
72-
WHERE_get_symbol( Generic w ) {
63+
Symbol * WHERE_get_symbol( Generic w ) {
7364
return( ( ( Where )w )->label );
7465
}
7566

76-
void
77-
ALGinitialize( void ) {
67+
/** Initialize the Algorithm module. */
68+
void ALGinitialize( void ) {
7869
MEMinitialize( &FUNC_fl, sizeof( struct Function_ ), 100, 50 );
7970
MEMinitialize( &RULE_fl, sizeof( struct Rule_ ), 100, 50 );
8071
MEMinitialize( &PROC_fl, sizeof( struct Procedure_ ), 100, 50 );
@@ -85,8 +76,7 @@ ALGinitialize( void ) {
8576
OBJcreate( OBJ_WHERE, WHERE_get_symbol, "where", OBJ_WHERE_BITS );
8677
}
8778

88-
void
89-
ALGput_full_text( Scope s, int start, int end ) {
79+
void ALGput_full_text( Scope s, int start, int end ) {
9080
switch( s->type ) {
9181
case OBJ_FUNCTION:
9282
s->u.func->text.filename = s->symbol.filename;

src/express/caseitem.c

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

3-
/************************************************************************
4-
** Module: Case_Item
5-
** Description: This module implements the Case_Item abstraction. A
3+
/** **********************************************************************
4+
** Module: Case_Item \file caseitem.c
5+
** This module implements the Case_Item abstraction. A
66
** case item represents a single branch in a case statement; it
77
** thus consists of a list of labels and a statement to execute
88
** when one of the labels matches the selector.
@@ -32,32 +32,22 @@
3232
#define CASE_ITEM_C
3333
#include "express/caseitem.h"
3434

35-
/*
36-
** Procedure: CASE_ITinitialize
37-
** Parameters: -- none --
38-
** Returns: void
39-
** Description: Initialize the Case Item module.
40-
*/
41-
42-
void
43-
CASE_ITinitialize( void ) {
35+
/** Initialize the Case Item module. */
36+
void CASE_ITinitialize( void ) {
4437
MEMinitialize( &CASE_IT_fl, sizeof( struct Case_Item_ ), 500, 100 );
4538
}
4639

47-
/*
48-
** Procedure: CASE_ITcreate
49-
** Parameters: Linked_List labels - list of Expressions for case labels
50-
** Statement statement - statement associated with this branch
51-
** Error* experrc - buffer for error code
52-
** Returns: Case_Item - the case item created
53-
** Description: Create and return a new case item.
40+
/**
41+
** \param labels list of Expressions for case labels
42+
** \param statement statement associated with this branch
43+
** \return the case item created
44+
**
45+
** Create and return a new case item.
5446
**
55-
** Notes: If the 'labels' parameter is LIST_NULL, a case item
56-
** matching in the default case is created.
47+
** \note If the 'labels' parameter is LIST_NULL, a case item
48+
** matching in the default case is created.
5749
*/
58-
59-
Case_Item
60-
CASE_ITcreate( Linked_List labels, Statement statement ) {
50+
Case_Item CASE_ITcreate( Linked_List labels, Statement statement ) {
6151
struct Case_Item_ *s = CASE_IT_new();
6252

6353
s->labels = labels;

src/express/dict.c

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
static Error ERROR_duplicate_decl;
4242
static Error ERROR_duplicate_decl_diff_file;
4343

44-
void
45-
DICTprint( Dictionary dict ) {
44+
void DICTprint( Dictionary dict ) {
4645
Element e;
4746
DictionaryEntry de;
4847

@@ -63,19 +62,15 @@ void DICTinitialize( void ) {
6362
"Redeclaration of %s. Previous declaration was on line %d in file %s.", SEVERITY_ERROR );
6463
}
6564

66-
/*
67-
** Procedure: DICTcreate
68-
** Parameters: int size - estimated (initial) max # of entries
69-
** Returns: Dictionary - a new dictionary of the specified size
65+
/** \def DICTcreate
66+
** \param size - estimated (initial) max # of entries
67+
** \return a new dictionary of the specified size
68+
** \note now a macro
7069
*/
71-
/* now a macro */
7270

7371
/**
7472
* Define anything in a dictionary. Generates an
7573
* error directly if there is a duplicate value.
76-
* \param dictionary dictionary to modify
77-
* \param entry entry to be added
78-
* \param experrc buffer for error code
7974
* \return 0 on success, 1 on failure
8075
*/
8176
int DICTdefine( Dictionary dict, char * name, Generic obj, Symbol * sym, char type ) {
@@ -124,6 +119,7 @@ int DICTdefine( Dictionary dict, char * name, Generic obj, Symbol * sym, char ty
124119
* ENUMERATION OF ( A, A ) which has happened!
125120
* This is the way DICTdefine used to look before enumerations gained
126121
* their unusual behavior with respect to scoping and visibility rules
122+
* \sa DICTdefine
127123
*/
128124
int DICT_define( Dictionary dict, char * name, Generic obj, Symbol * sym, char type ) {
129125
struct Element_ e, *e2;
@@ -146,32 +142,26 @@ int DICT_define( Dictionary dict, char * name, Generic obj, Symbol * sym, char t
146142
return( 1 );
147143
}
148144

149-
/*
150-
** Procedure: DICTundefine
151-
** Parameters: Dictionary dictionary - dictionary to modify
152-
** char * name - name to remove
153-
** Returns: Generic - the entry removed, NULL if not found
145+
/**
146+
** \param dict dictionary to modify
147+
** \param name name to remove
148+
** \return the entry removed, NULL if not found
154149
Changed to return void, since the hash code frees the element, there
155150
is no way to return (without godawful casting) the generic itself.
156151
*/
157-
158-
void
159-
DICTundefine( Dictionary dict, char * name ) {
152+
void DICTundefine( Dictionary dict, char * name ) {
160153
struct Element_ e;
161154

162155
e.key = name;
163156
HASHsearch( dict, &e, HASH_DELETE );
164157
}
165158

166-
/*
167-
** Procedure: DICTlookup
168-
** Parameters: Dictionary dictionary - dictionary to look in
169-
** char * name - name to look up
170-
** Returns: Generic - the value found, NULL if not found
159+
/**
160+
** \param dictionary dictionary to look in
161+
** \param name name to look up
162+
** \return the value found, NULL if not found
171163
*/
172-
173-
Generic
174-
DICTlookup( Dictionary dictionary, char * name ) {
164+
Generic DICTlookup( Dictionary dictionary, char * name ) {
175165
struct Element_ e, *ep;
176166

177167
if( !dictionary ) {
@@ -187,9 +177,10 @@ DICTlookup( Dictionary dictionary, char * name ) {
187177
return( NULL );
188178
}
189179

190-
/* like DICTlookup but returns symbol, too */
191-
Generic
192-
DICTlookup_symbol( Dictionary dictionary, char * name, Symbol ** sym ) {
180+
/** like DICTlookup but returns symbol, too
181+
* \sa DICTlookup
182+
*/
183+
Generic DICTlookup_symbol( Dictionary dictionary, char * name, Symbol ** sym ) {
193184
struct Element_ e, *ep;
194185

195186
if( !dictionary ) {
@@ -206,8 +197,7 @@ DICTlookup_symbol( Dictionary dictionary, char * name, Symbol ** sym ) {
206197
return( NULL );
207198
}
208199

209-
Generic
210-
DICTdo( DictionaryEntry * dict_entry ) {
200+
Generic DICTdo( DictionaryEntry * dict_entry ) {
211201
if( 0 == HASHlist( dict_entry ) ) {
212202
return 0;
213203
}

0 commit comments

Comments
 (0)