Commit 30635842 authored by claes's avatar claes

*** empty log message ***

parent fbb5cc4b
...@@ -14,7 +14,7 @@ extern "C" { ...@@ -14,7 +14,7 @@ extern "C" {
#define CNV__UNKNOWN_LINETYPE 2 #define CNV__UNKNOWN_LINETYPE 2
int ClassRead::read( char *filename) int ClassRead::read( char *filename)
{ {
int sts; int sts;
int return_sts = 1; int return_sts = 1;
...@@ -22,12 +22,14 @@ int ClassRead::read( char *filename) ...@@ -22,12 +22,14 @@ int ClassRead::read( char *filename)
char line_part[4][80]; char line_part[4][80];
int nr; int nr;
int object_level = 0; int object_level = 0;
int classdef_level = 0;
char *s; char *s;
char line_cnt = 0; int line_cnt = 0;
doc_init(); doc_init();
// Get source directory // Get source directory
strcpy( current_file, filename);
strcpy( source_dir, filename); strcpy( source_dir, filename);
if ( (s = strrchr( source_dir, '/'))) if ( (s = strrchr( source_dir, '/')))
*(s+1) = 0; *(s+1) = 0;
...@@ -232,6 +234,7 @@ int ClassRead::read( char *filename) ...@@ -232,6 +234,7 @@ int ClassRead::read( char *filename)
break; break;
case cread_eLine_ClassDef: case cread_eLine_ClassDef:
state |= cread_mState_ClassDef; state |= cread_mState_ClassDef;
classdef_level = object_level;
object_state = cread_mState_ClassDef; object_state = cread_mState_ClassDef;
class_init(); class_init();
if ( line_part[1][0] == '$') if ( line_part[1][0] == '$')
...@@ -382,9 +385,9 @@ int ClassRead::read( char *filename) ...@@ -382,9 +385,9 @@ int ClassRead::read( char *filename)
} }
else if ( state & cread_mState_ClassDef) { else if ( state & cread_mState_ClassDef) {
state &= ~cread_mState_ClassDef; state &= ~cread_mState_ClassDef;
if ( generate_html && html_class_open) if ( generate_html && html_class_open && classdef_level == object_level)
html_class_close(); html_class_close();
if ( generate_struct && struct_class_open) if ( generate_struct && struct_class_open && classdef_level == object_level)
struct_class_close(); struct_class_close();
} }
else if ( state & cread_mState_TypeDef) { else if ( state & cread_mState_TypeDef) {
......
...@@ -109,6 +109,7 @@ class ClassRead { ...@@ -109,6 +109,7 @@ class ClassRead {
int state; int state;
int object_state; int object_state;
char source_dir[200]; char source_dir[200];
char current_file[200];
char attr_name[80]; char attr_name[80];
char attr_flags[200]; char attr_flags[200];
char attr_type[80]; char attr_type[80];
......
...@@ -40,7 +40,7 @@ int ClassRead::src_read( char *filename) ...@@ -40,7 +40,7 @@ int ClassRead::src_read( char *filename)
if ( strcmp( line, "") == 0) if ( strcmp( line, "") == 0)
continue; continue;
if ( strncmp( line, "/**", 3) != 0 && if ( strncmp( line, "/*_*", 4) != 0 &&
!(state & cread_mState_Doc)) !(state & cread_mState_Doc))
{ {
src_html_line( orig_line); src_html_line( orig_line);
...@@ -51,7 +51,7 @@ int ClassRead::src_read( char *filename) ...@@ -51,7 +51,7 @@ int ClassRead::src_read( char *filename)
sizeof( line_part) / sizeof( line_part[0]), sizeof( line_part) / sizeof( line_part[0]),
sizeof( line_part[0]), 0); sizeof( line_part[0]), 0);
if ( strcmp( low( line_part[0]), "/**") == 0) if ( strcmp( low( line_part[0]), "/*_*") == 0)
linetype = cread_eLine_Doc; linetype = cread_eLine_Doc;
else if ( strcmp( low( line_part[0]), "*/") == 0) else if ( strcmp( low( line_part[0]), "*/") == 0)
linetype = cread_eLine_DocEnd; linetype = cread_eLine_DocEnd;
......
...@@ -180,7 +180,7 @@ endl; ...@@ -180,7 +180,7 @@ endl;
} }
fp_struct << fp_struct <<
"/** Class: " << class_name << endl << "/*_* Class: " << class_name << endl <<
" Body: " << body_name << endl << " Body: " << body_name << endl <<
" @Aref " << class_name << " " << struct_name << endl << " @Aref " << class_name << " " << struct_name << endl <<
"*/" << endl; "*/" << endl;
...@@ -571,17 +571,11 @@ int ClassRead::struct_volname_to_id() ...@@ -571,17 +571,11 @@ int ClassRead::struct_volname_to_id()
fp = fopen( fname, "r"); fp = fopen( fname, "r");
if ( !fp) { if ( !fp) {
strcpy( fname, source_dir); strcpy( fname, current_file);
strcat( fname, "usertypes.wb_load");
fp = fopen( fname, "r"); fp = fopen( fname, "r");
if ( !fp) { if ( !fp) {
strcpy( fname, source_dir); printf( "** Unable to find Volume declaration\n");
strcat( fname, "userclasses.wb_load"); return 0;
fp = fopen( fname, "r");
if ( !fp) {
printf( "** Unable to open volume wb_load file\n");
return 0;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment