[PVFS2-CVS]
commit by rbross in pvfs2/src/common/statecomp: codegen.c emalloc.c
parser.y scanner.l statecomp-symbol.c statecomp-symbol.h
statecomp.c stringtbl.c
CVS commit program
cvs at parl.clemson.edu
Tue Jan 11 09:00:28 EST 2005
Update of /projects/cvsroot/pvfs2/src/common/statecomp
In directory parlweb:/tmp/cvs-serv31090/src/common/statecomp
Modified Files:
codegen.c emalloc.c parser.y scanner.l statecomp-symbol.c
statecomp-symbol.h statecomp.c stringtbl.c
Log Message:
doxygen updates.
Index: codegen.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/codegen.c,v
diff -p -u -r1.15 -r1.16
--- codegen.c 28 Jul 2004 14:32:38 -0000 1.15
+++ codegen.c 11 Jan 2005 14:00:27 -0000 1.16
@@ -4,6 +4,12 @@
* See COPYING in top-level directory.
*/
+/** \file
+ * \ingroup statecomp
+ *
+ * Code generation routines for statecomp.
+ */
+
#include <stdio.h>
#include <stdlib.h>
@@ -35,9 +41,7 @@ void gen_state_start(char *state_name)
fprintf(out_file,"static union PINT_state_array_values ST_%s[] = {\n", state_name);
}
-/* gen_state_action()
- *
- * generates first two lines in the state machine (I think),
+/** generates first two lines in the state machine (I think),
* the first one indicating what kind of action it is ("run"
* or "jump") and the second being the action itself (either a
* function or a nested state machine).
@@ -69,8 +73,6 @@ void gen_state_action(char *run_func, in
}
}
-/* gen_return_code()
- */
void gen_return_code(char *return_code)
{
fprintf(out_file,
@@ -78,8 +80,6 @@ void gen_return_code(char *return_code)
return_code);
}
-/* gen_next_state()
- */
void gen_next_state(int flag, char *new_state)
{
switch (flag) {
Index: emalloc.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/emalloc.c,v
diff -p -u -r1.3 -r1.4
--- emalloc.c 28 Jan 2003 19:29:26 -0000 1.3
+++ emalloc.c 11 Jan 2005 14:00:27 -0000 1.4
@@ -4,25 +4,41 @@
* See COPYING in top-level directory.
*/
+/** \file
+ * \ingroup statecomp
+ *
+ * Malloc function with error handling capability, used in statecomp.
+ *
+ * \todo Merge into statecomp.c or something.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
void *emalloc(unsigned int size);
-/*
- * emalloc --- error checking malloc routine
+/** error checking malloc routine
*/
void *emalloc(unsigned int size)
{
- void *p;
+ void *p;
- if (!(p = malloc(size)))
- {
- fprintf(stderr,"no more dynamic storage - aborting\n");
- exit(1);
- }
+ if (!(p = malloc(size)))
+ {
+ fprintf(stderr,"no more dynamic storage - aborting\n");
+ exit(1);
+ }
- return(p);
+ return(p);
}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
Index: parser.y
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/parser.y,v
diff -p -u -r1.24 -r1.25
--- parser.y 28 Jul 2004 14:32:38 -0000 1.24
+++ parser.y 11 Jan 2005 14:00:27 -0000 1.25
@@ -7,6 +7,12 @@
* See COPYING in top-level directory.
*/
+/** \file
+ * \ingroup statecomp
+ *
+ * Parser for statecomp source-to-source translator.
+ */
+
#include <stdlib.h>
#include <stdio.h>
Index: scanner.l
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/scanner.l,v
diff -p -u -r1.14 -r1.15
--- scanner.l 28 Jul 2004 14:32:39 -0000 1.14
+++ scanner.l 11 Jan 2005 14:00:27 -0000 1.15
@@ -6,6 +6,12 @@
* See COPYING in top-level directory.
*/
+/** \file
+ * \ingroup statecomp
+ *
+ * Lexical analyzer for statecomp source-to-source translator.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Index: statecomp-symbol.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/statecomp-symbol.c,v
diff -p -u -r1.2 -r1.3
--- statecomp-symbol.c 28 Jul 2004 14:32:39 -0000 1.2
+++ statecomp-symbol.c 11 Jan 2005 14:00:27 -0000 1.3
@@ -4,9 +4,12 @@
* See COPYING in top-level directory.
*/
-/*
-* symbol --- symbol table and mapping routines
-*/
+/** \file
+ * \ingroup statecomp
+ *
+ * Symbol table and mapping routines for state machine source-to-source
+ * translator.
+ */
#include <stdio.h>
#include <string.h>
@@ -16,17 +19,13 @@ extern int line;
void *emalloc(unsigned int size);
-/*
- * MAXHASH --- determines the hash table width.
- * symtab --- the symbol table structure
- */
-
+/** hash table width */
#define MAXHASH 311
+/** the symbol table structure */
static sym_ent_p symtab[MAXHASH];
-/*
- * hash --- scramble a name (hopefully) uniformly to fit in a table
+/** scramble a name (hopefully) uniformly to fit in a table
*/
static unsigned int hash(char *name)
{
@@ -39,8 +38,7 @@ static unsigned int hash(char *name)
return(h % MAXHASH);
}
-/*
- * symenter --- enter a name into the symbol table
+/** enter a name into the symbol table
*/
sym_ent_p symenter(char *name)
{
@@ -57,11 +55,8 @@ sym_ent_p symenter(char *name)
return(p);
}
-/*
- * symlook --- lookup a symbol in the symbol table
- *
- * symlook scans the symbol table and returns a pointer to
- * the symbol table entry
+/** lookup a symbol in the symbol table. scans the symbol table and returns a
+ * pointer to the symbol table entry
*/
sym_ent_p symlook(char *name)
{
@@ -75,6 +70,9 @@ sym_ent_p symlook(char *name)
return(p);
}
+/** initializes data structures prior to additions into symbol table.
+ * \note there is no matching finalize for the symbol table.
+ */
void init_symbol_table(void)
{
memset(symtab, 0, MAXHASH * sizeof(sym_ent_p));
Index: statecomp-symbol.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/statecomp-symbol.h,v
diff -p -u -r1.1 -r1.2
--- statecomp-symbol.h 7 Jul 2003 20:20:51 -0000 1.1
+++ statecomp-symbol.h 11 Jan 2005 14:00:27 -0000 1.2
@@ -4,12 +4,14 @@
* See COPYING in top-level directory.
*/
+/** \file
+ * \ingroup statecomp
+ *
+ * Defines and prototypes for statecomp symbol table.
+ */
+
#ifndef _SYMBOL_H_
#define _SYMBOL_H_
-
-/*
- * symbol.h --- declarations for all the public types
- */
#define TYPE_MACHINE 0x1
#define TYPE_STATE 0x2
Index: statecomp.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/statecomp.c,v
diff -p -u -r1.14 -r1.15
--- statecomp.c 28 Jul 2004 14:32:39 -0000 1.14
+++ statecomp.c 11 Jan 2005 14:00:27 -0000 1.15
@@ -4,6 +4,24 @@
* See COPYING in top-level directory.
*/
+/** \defgroup statecomp statecomp source-to-source translator
+ *
+ * statecomp is a source-to-source translator. It takes state machine
+ * descriptions (.sm extension) as input and creates a corresponding C
+ * source file for compilation. Both clients and servers rely on these
+ * state machines for concurrent processing. This executable is built at
+ * compile time and used only during compilation of PVFS2.
+ *
+ * @{
+ */
+
+/** \file
+ *
+ * Core of state machine source-to-source translator executable, statecomp,
+ * including processing arguments, calling the parser, and producing
+ * warning and error messages.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -186,6 +204,8 @@ void produce_listing(int line, char *lis
if (list_flag)
fprintf(list_file, "[%d]\t%s\n", line, listing);
}
+
+/* @} */
/*
* Local variables:
Index: stringtbl.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/statecomp/stringtbl.c,v
diff -p -u -r1.3 -r1.4
--- stringtbl.c 28 Jan 2003 19:29:26 -0000 1.3
+++ stringtbl.c 11 Jan 2005 14:00:28 -0000 1.4
@@ -4,6 +4,14 @@
* See COPYING in top-level directory.
*/
+/** \file
+ * \ingroup statecomp
+ *
+ * String storage routine for statecomp.
+ *
+ * \todo Merge into statecomp.c.
+ */
+
#include <stdio.h>
#include <string.h>
@@ -11,8 +19,17 @@ void *emalloc(unsigned int size);
char *enter_string(char *oldstring)
{
- char *newstring;
- newstring = (char *)emalloc((unsigned)strlen(oldstring)+1);
- strcpy(newstring, oldstring);
- return newstring;
+ char *newstring;
+ newstring = (char *)emalloc((unsigned)strlen(oldstring)+1);
+ strcpy(newstring, oldstring);
+ return newstring;
}
+
+/*
+ * Local variables:
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
More information about the PVFS2-CVS
mailing list