Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
02ae14e8
Commit
02ae14e8
authored
Oct 14, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java script orm menu
parent
7be41817
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
266 additions
and
36 deletions
+266
-36
src/exe/co_convert/src/cnv_classread.cpp
src/exe/co_convert/src/cnv_classread.cpp
+7
-2
src/exe/co_convert/src/cnv_classread.h
src/exe/co_convert/src/cnv_classread.h
+8
-1
src/exe/co_convert/src/cnv_classread_html.cpp
src/exe/co_convert/src/cnv_classread_html.cpp
+145
-7
src/exe/co_convert/src/cnv_classread_struct.cpp
src/exe/co_convert/src/cnv_classread_struct.cpp
+100
-26
src/exe/co_convert/src/co_convert.cpp
src/exe/co_convert/src/co_convert.cpp
+6
-0
No files found.
src/exe/co_convert/src/cnv_classread.cpp
View file @
02ae14e8
...
@@ -626,6 +626,7 @@ void ClassRead::attribute_init()
...
@@ -626,6 +626,7 @@ void ClassRead::attribute_init()
attr_array
=
0
;
attr_array
=
0
;
attr_rtvirtual
=
0
;
attr_rtvirtual
=
0
;
attr_elem
=
0
;
attr_elem
=
0
;
attr_isclass
=
0
;
}
}
int
ClassRead
::
attribute_attr
(
char
*
name
,
char
*
value
)
int
ClassRead
::
attribute_attr
(
char
*
name
,
char
*
value
)
...
@@ -654,10 +655,12 @@ int ClassRead::attribute_attr( char *name, char *value)
...
@@ -654,10 +655,12 @@ int ClassRead::attribute_attr( char *name, char *value)
if
(
strcmp
(
value
,
"PWR_MASK_POINTER"
)
==
0
)
if
(
strcmp
(
value
,
"PWR_MASK_POINTER"
)
==
0
)
attr_pointer
=
1
;
attr_pointer
=
1
;
else
if
(
strcmp
(
value
,
"PWR_MASK_ARRAY"
)
==
0
)
if
(
strcmp
(
value
,
"PWR_MASK_ARRAY"
)
==
0
)
attr_array
=
1
;
attr_array
=
1
;
else
if
(
strcmp
(
value
,
"PWR_MASK_RTVIRTUAL"
)
==
0
)
if
(
strcmp
(
value
,
"PWR_MASK_RTVIRTUAL"
)
==
0
)
attr_rtvirtual
=
1
;
attr_rtvirtual
=
1
;
if
(
strcmp
(
value
,
"PWR_MASK_ISCLASS"
)
==
0
)
attr_isclass
=
1
;
}
}
else
{
else
{
int
flags_value
;
int
flags_value
;
...
@@ -676,6 +679,8 @@ int ClassRead::attribute_attr( char *name, char *value)
...
@@ -676,6 +679,8 @@ int ClassRead::attribute_attr( char *name, char *value)
attr_array
=
1
;
attr_array
=
1
;
if
(
flags_value
&
pwr_mAdef_rtvirtual
)
if
(
flags_value
&
pwr_mAdef_rtvirtual
)
attr_rtvirtual
=
1
;
attr_rtvirtual
=
1
;
if
(
flags_value
&
pwr_mAdef_class
)
attr_isclass
=
1
;
}
}
}
}
else
if
(
strcmp
(
low
(
name
),
"elements"
)
==
0
)
else
if
(
strcmp
(
low
(
name
),
"elements"
)
==
0
)
...
...
src/exe/co_convert/src/cnv_classread.h
View file @
02ae14e8
...
@@ -98,7 +98,7 @@ class ClassRead {
...
@@ -98,7 +98,7 @@ class ClassRead {
html_class_open
(
0
),
html_index_open
(
0
),
html_class_open
(
0
),
html_index_open
(
0
),
generate_xtthelp
(
0
),
xtthelp_index_open
(
0
),
xtthelp_in_topic
(
0
),
generate_xtthelp
(
0
),
xtthelp_index_open
(
0
),
xtthelp_in_topic
(
0
),
generate_src
(
0
),
generate_struct
(
0
),
struct_class_open
(
0
),
generate_src
(
0
),
generate_struct
(
0
),
struct_class_open
(
0
),
common_structfile_only
(
0
),
setup_group_cnt
(
0
)
common_structfile_only
(
0
),
hpp
(
0
),
setup_group_cnt
(
0
)
{
strcpy
(
setup_filename
,
""
);};
{
strcpy
(
setup_filename
,
""
);};
~
ClassRead
()
{};
~
ClassRead
()
{};
...
@@ -117,6 +117,7 @@ class ClassRead {
...
@@ -117,6 +117,7 @@ class ClassRead {
int
attr_pointer
;
int
attr_pointer
;
int
attr_array
;
int
attr_array
;
int
attr_rtvirtual
;
int
attr_rtvirtual
;
int
attr_isclass
;
char
attr_elements
[
80
];
char
attr_elements
[
80
];
int
attr_elem
;
int
attr_elem
;
char
attr_pgmname
[
80
];
char
attr_pgmname
[
80
];
...
@@ -199,12 +200,16 @@ class ClassRead {
...
@@ -199,12 +200,16 @@ class ClassRead {
// ofstream fp_html_class;
// ofstream fp_html_class;
CnvFile
*
html_clf
;
CnvFile
*
html_clf
;
ofstream
fp_html_index
;
ofstream
fp_html_index
;
ofstream
fp_js_all
;
ofstream
fp_tmp
;
ofstream
fp_tmp
;
ofstream
fp_html_group
[
MAX_GROUPS
];
ofstream
fp_html_group
[
MAX_GROUPS
];
ofstream
fp_js_group
[
MAX_GROUPS
];
char
html_first
[
80
];
char
html_first
[
80
];
char
html_tmp_name
[
80
];
char
html_tmp_name
[
80
];
int
html_class_open
;
int
html_class_open
;
int
html_index_open
;
int
html_index_open
;
bool
js_all_first
;
bool
js_group_first
[
80
];
int
html_init
(
char
*
first
);
int
html_init
(
char
*
first
);
int
html_close
();
int
html_close
();
...
@@ -252,11 +257,13 @@ class ClassRead {
...
@@ -252,11 +257,13 @@ class ClassRead {
// ofstream fp_cstruc;
// ofstream fp_cstruc;
CnvFile
*
cstruc
;
CnvFile
*
cstruc
;
int
struct_cclass_written
;
int
struct_cclass_written
;
int
struct_cclass_endwritten
;
int
struct_filler_cnt
;
int
struct_filler_cnt
;
char
struct_volid
[
80
];
char
struct_volid
[
80
];
unsigned
int
struct_vid_0
;
unsigned
int
struct_vid_0
;
unsigned
int
struct_vid_1
;
unsigned
int
struct_vid_1
;
int
attr_count
;
int
attr_count
;
int
hpp
;
int
struct_init
();
int
struct_init
();
int
struct_close
();
int
struct_close
();
...
...
src/exe/co_convert/src/cnv_classread_html.cpp
View file @
02ae14e8
...
@@ -82,6 +82,20 @@ int ClassRead::html_init( char *first)
...
@@ -82,6 +82,20 @@ int ClassRead::html_init( char *first)
"</HTML>"
<<
endl
;
"</HTML>"
<<
endl
;
}
}
// Create js index file
strcpy
(
fname
,
dir
);
strcat
(
fname
,
volume_name
);
strcat
(
fname
,
"_allclasses.jsf"
);
cdh_ToLower
(
fname
,
fname
);
fp_js_all
.
open
(
fname
);
js_all_first
=
true
;
fp_js_all
<<
"function "
<<
volume_name
<<
"_AllClasses( parent)"
<<
endl
<<
"{"
<<
endl
<<
"parent.addChildren(["
<<
endl
;
// Create group menu file
// Create group menu file
if
(
setup_group_cnt
)
{
if
(
setup_group_cnt
)
{
strcpy
(
fname
,
dir
);
strcpy
(
fname
,
dir
);
...
@@ -120,12 +134,12 @@ int ClassRead::html_init( char *first)
...
@@ -120,12 +134,12 @@ int ClassRead::html_init( char *first)
"<BR>"
<<
endl
;
"<BR>"
<<
endl
;
for
(
int
i
=
0
;
i
<
setup_group_cnt
;
i
++
)
{
for
(
int
i
=
0
;
i
<
setup_group_cnt
;
i
++
)
{
// Put group index filename in fname
// Put group index filename in fname
strcpy
(
fname
,
volume_name
);
strcpy
(
fname
,
volume_name
);
strcat
(
fname
,
"_group_"
);
strcat
(
fname
,
"_group_"
);
strcat
(
fname
,
setup_groups
[
i
]);
strcat
(
fname
,
setup_groups
[
i
]);
strcat
(
fname
,
"_index.html"
);
strcat
(
fname
,
"_index.html"
);
cdh_ToLower
(
fname
,
fname
);
cdh_ToLower
(
fname
,
fname
);
fp
<<
fp
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
TARGET=
\"
_parent
\"
>"
<<
setup_groups
[
i
]
<<
"</A>"
<<
endl
<<
"<A HREF=
\"
"
<<
fname
<<
"
\"
TARGET=
\"
_parent
\"
>"
<<
setup_groups
[
i
]
<<
"</A>"
<<
endl
<<
...
@@ -235,6 +249,14 @@ int ClassRead::html_init( char *first)
...
@@ -235,6 +249,14 @@ int ClassRead::html_init( char *first)
cdh_ToLower
(
fname
,
fname
);
cdh_ToLower
(
fname
,
fname
);
fp_html_group
[
i
].
open
(
fname
);
fp_html_group
[
i
].
open
(
fname
);
strcpy
(
fname
,
dir
);
strcat
(
fname
,
volume_name
);
strcat
(
fname
,
"_group_"
);
strcat
(
fname
,
setup_groups
[
i
]);
strcat
(
fname
,
".jsf"
);
cdh_ToLower
(
fname
,
fname
);
fp_js_group
[
i
].
open
(
fname
);
fp_html_group
[
i
]
<<
fp_html_group
[
i
]
<<
"<!DOCTYPE HTML PUBLIC
\"
-//W3C//DTD HTML 4.0 Frameset//EN
\"\"
http://www.w3.org/TR/REC-html40/frameset.dtd
\"
>"
<<
endl
<<
"<!DOCTYPE HTML PUBLIC
\"
-//W3C//DTD HTML 4.0 Frameset//EN
\"\"
http://www.w3.org/TR/REC-html40/frameset.dtd
\"
>"
<<
endl
<<
"<!-- Generated by co_convert "
<<
timestr
<<
" -->"
<<
endl
<<
"<!-- Generated by co_convert "
<<
timestr
<<
" -->"
<<
endl
<<
...
@@ -254,7 +276,44 @@ setup_groups[i] << endl <<
...
@@ -254,7 +276,44 @@ setup_groups[i] << endl <<
"<TR>"
<<
endl
<<
"<TR>"
<<
endl
<<
"<TD NOWRAP><FONT CLASS=
\"
FrameItemFont
\"
> "
<<
endl
;
"<TD NOWRAP><FONT CLASS=
\"
FrameItemFont
\"
> "
<<
endl
;
js_group_first
[
i
]
=
true
;
fp_js_group
[
i
]
<<
"function "
<<
volume_name
<<
"_"
<<
setup_groups
[
i
]
<<
"(parent)"
<<
endl
<<
"{"
<<
endl
<<
"parent.addChildren(["
<<
endl
;
}
}
// Create js map for volume
{
strcpy
(
fname
,
dir
);
strcat
(
fname
,
volume_name
);
strcat
(
fname
,
"_groups.jsf"
);
cdh_ToLower
(
fname
,
fname
);
ofstream
fp
(
fname
);
fp
<<
"function "
<<
volume_name
<<
"(parent)"
<<
endl
<<
"{"
<<
endl
<<
" aux = insFld(parent, gFld(
\"
AllClasses
\"
,
\"
"
<<
volume_name
<<
"_index.html
\"
))"
<<
endl
<<
" "
<<
volume_name
<<
"_AllClasses(aux)"
<<
endl
;
for
(
int
i
=
0
;
i
<
setup_group_cnt
;
i
++
)
{
strcpy
(
fname
,
volume_name
);
strcat
(
fname
,
"_group_"
);
strcat
(
fname
,
setup_groups
[
i
]);
strcat
(
fname
,
"_index.html"
);
cdh_ToLower
(
fname
,
fname
);
fp
<<
" aux = insFld(parent, gFld(
\"
"
<<
setup_groups
[
i
]
<<
"
\"
,
\"
"
<<
fname
<<
"
\"
))"
<<
endl
<<
" "
<<
volume_name
<<
"_"
<<
setup_groups
[
i
]
<<
"(aux)"
<<
endl
;
}
fp
<<
"}"
<<
endl
;
}
return
1
;
return
1
;
}
}
...
@@ -270,6 +329,11 @@ int ClassRead::html_close()
...
@@ -270,6 +329,11 @@ int ClassRead::html_close()
"</HTML>"
<<
endl
;
"</HTML>"
<<
endl
;
fp_html_index
.
close
();
fp_html_index
.
close
();
fp_js_all
<<
"])"
<<
endl
<<
"}"
<<
endl
;
fp_js_all
.
close
();
for
(
int
i
=
0
;
i
<
setup_group_cnt
;
i
++
)
{
for
(
int
i
=
0
;
i
<
setup_group_cnt
;
i
++
)
{
fp_html_group
[
i
]
<<
fp_html_group
[
i
]
<<
"</FONT></TD>"
<<
endl
<<
"</FONT></TD>"
<<
endl
<<
...
@@ -279,8 +343,42 @@ int ClassRead::html_close()
...
@@ -279,8 +343,42 @@ int ClassRead::html_close()
"</BODY>"
<<
endl
<<
"</BODY>"
<<
endl
<<
"</HTML>"
<<
endl
;
"</HTML>"
<<
endl
;
fp_html_group
[
i
].
close
();
fp_html_group
[
i
].
close
();
fp_js_group
[
i
]
<<
"])"
<<
endl
<<
"}"
<<
endl
;
fp_js_group
[
i
].
close
();
}
}
#if 0
{
char fname[200];
strcpy( fname, dir);
strcat( fname, "index.jsm");
cdh_ToLower( fname, fname);
ofstream fp( fname);
fp <<
" aux = insFld(foldersTree, gFld(\"<b>pwrs</b>\",\"pwrs_index.html\"))" << endl <<
" pwrs_index(aux)" << endl <<
" aux = insFld(foldersTree, gFld(\"<b>pwrb</b>\",\"pwrb_index.html\"))" << endl <<
" pwrb_index(aux)" << endl <<
" aux = insFld(foldersTree, gFld(\"<b>nmps</b>\",\"nmps_index.html\"))" << endl <<
" nmps_index(aux)" << endl <<
" aux = insFld(foldersTree, gFld(\"<b>ssab</b>\",\"ssab_index.html\"))" << endl <<
" ssab_index(aux)" << endl <<
" aux = insFld(foldersTree, gFld(\"<b>tlog/b>\",\"tlog_index.html\"))" << endl <<
" tlog_index(aux)" << endl;
fp.close();
}
#endif
char
cmd
[
200
];
sprintf
(
cmd
,
"cat %s/*.jsf %s/../orm_menu.js > %s/menu.js"
,
dir
,
dir
,
dir
);
system
(
cmd
);
return
1
;
return
1
;
}
}
...
@@ -292,6 +390,7 @@ int ClassRead::html_class()
...
@@ -292,6 +390,7 @@ int ClassRead::html_class()
char
full_class_name
[
80
];
char
full_class_name
[
80
];
char
ref_name
[
200
];
char
ref_name
[
200
];
char
struct_file
[
100
];
char
struct_file
[
100
];
char
hpp_file
[
100
];
char
low_volume_name
[
80
];
char
low_volume_name
[
80
];
char
low_class_name
[
80
];
char
low_class_name
[
80
];
char
txt
[
200
];
char
txt
[
200
];
...
@@ -305,6 +404,11 @@ int ClassRead::html_class()
...
@@ -305,6 +404,11 @@ int ClassRead::html_class()
struct_get_filename
(
fname
);
struct_get_filename
(
fname
);
src_filename_to_html
(
struct_file
,
fname
);
src_filename_to_html
(
struct_file
,
fname
);
hpp
=
1
;
struct_get_filename
(
fname
);
src_filename_to_html
(
hpp_file
,
fname
);
hpp
=
0
;
strcpy
(
full_class_name
,
volume_name
);
strcpy
(
full_class_name
,
volume_name
);
strcat
(
full_class_name
,
":"
);
strcat
(
full_class_name
,
":"
);
strcat
(
full_class_name
,
class_name
);
strcat
(
full_class_name
,
class_name
);
...
@@ -318,6 +422,15 @@ int ClassRead::html_class()
...
@@ -318,6 +422,15 @@ int ClassRead::html_class()
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<BR>"
<<
endl
;
"<BR>"
<<
endl
;
// Add into AllClasses js file
if
(
!
js_all_first
)
fp_js_all
<<
","
;
else
js_all_first
=
false
;
fp_js_all
<<
"[
\"
"
<<
class_name
<<
"
\"
,
\"
"
<<
html_file_name
<<
".html
\"
]"
<<
endl
;
// Add into group file
// Add into group file
for
(
int
i
=
0
;
i
<
doc_group_cnt
;
i
++
)
{
for
(
int
i
=
0
;
i
<
doc_group_cnt
;
i
++
)
{
for
(
int
j
=
0
;
j
<
setup_group_cnt
;
j
++
)
{
for
(
int
j
=
0
;
j
<
setup_group_cnt
;
j
++
)
{
...
@@ -325,6 +438,13 @@ int ClassRead::html_class()
...
@@ -325,6 +438,13 @@ int ClassRead::html_class()
fp_html_group
[
j
]
<<
fp_html_group
[
j
]
<<
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<BR>"
<<
endl
;
"<BR>"
<<
endl
;
if
(
!
js_group_first
[
j
])
fp_js_group
[
j
]
<<
","
;
else
js_group_first
[
j
]
=
false
;
fp_js_group
[
j
]
<<
"[
\"
"
<<
class_name
<<
"
\"
,
\"
"
<<
html_file_name
<<
".html
\"
]"
<<
endl
;
}
}
}
}
}
}
...
@@ -375,7 +495,8 @@ endl <<
...
@@ -375,7 +495,8 @@ endl <<
" | <A HREF=
\"
#template
\"
>Template</A>"
<<
endl
<<
" | <A HREF=
\"
#template
\"
>Template</A>"
<<
endl
<<
" | <A HREF=
\"
#detail
\"
>Detail</A>"
<<
endl
<<
" | <A HREF=
\"
#detail
\"
>Detail</A>"
<<
endl
<<
" C Binding: "
<<
endl
<<
" C Binding: "
<<
endl
<<
" <A HREF=
\"
"
<<
struct_file
<<
"#"
<<
class_name
<<
"
\"
>Struct</A>"
<<
endl
;
" <A HREF=
\"
"
<<
struct_file
<<
"#"
<<
class_name
<<
"
\"
>Struct</A>"
<<
endl
<<
" | <A HREF=
\"
"
<<
hpp_file
<<
"#"
<<
class_name
<<
"
\"
>Class</A>"
<<
endl
;
if
(
doc_fresh
&&
strcmp
(
doc_code
,
""
)
!=
0
)
{
if
(
doc_fresh
&&
strcmp
(
doc_code
,
""
)
!=
0
)
{
src_filename_to_html
(
ref_name
,
doc_code
);
src_filename_to_html
(
ref_name
,
doc_code
);
...
@@ -779,6 +900,15 @@ int ClassRead::html_typedef()
...
@@ -779,6 +900,15 @@ int ClassRead::html_typedef()
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<BR>"
<<
endl
;
"<BR>"
<<
endl
;
// Add into AllClasses js file
if
(
!
js_all_first
)
fp_js_all
<<
","
;
else
js_all_first
=
false
;
fp_js_all
<<
"[
\"
"
<<
class_name
<<
"
\"
,
\"
"
<<
html_file_name
<<
".html
\"
]"
<<
endl
;
// Add into group file
// Add into group file
for
(
int
i
=
0
;
i
<
doc_group_cnt
;
i
++
)
{
for
(
int
i
=
0
;
i
<
doc_group_cnt
;
i
++
)
{
for
(
int
j
=
0
;
j
<
setup_group_cnt
;
j
++
)
{
for
(
int
j
=
0
;
j
<
setup_group_cnt
;
j
++
)
{
...
@@ -786,6 +916,14 @@ int ClassRead::html_typedef()
...
@@ -786,6 +916,14 @@ int ClassRead::html_typedef()
fp_html_group
[
j
]
<<
fp_html_group
[
j
]
<<
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<A HREF=
\"
"
<<
html_file_name
<<
".html
\"
TARGET=
\"
classFrame
\"
>"
<<
class_name
<<
"</A>"
<<
endl
<<
"<BR>"
<<
endl
;
"<BR>"
<<
endl
;
if
(
!
js_group_first
[
j
])
fp_js_group
[
j
]
<<
","
;
else
js_group_first
[
j
]
=
false
;
fp_js_group
[
j
]
<<
"[
\"
"
<<
class_name
<<
"
\"
,
\"
"
<<
html_file_name
<<
".html
\"
]"
<<
endl
;
}
}
}
}
}
}
...
...
src/exe/co_convert/src/cnv_classread_struct.cpp
View file @
02ae14e8
...
@@ -30,12 +30,22 @@ int ClassRead::struct_init()
...
@@ -30,12 +30,22 @@ int ClassRead::struct_init()
strcat
(
fname
,
struct_filename
);
strcat
(
fname
,
struct_filename
);
fp_struct
.
open
(
fname
);
fp_struct
.
open
(
fname
);
if
(
strcmp
(
low
(
volume_name
),
"pwrb"
)
==
0
)
if
(
hpp
)
{
sprintf
(
fname
,
"pwr_%sclasses_h"
,
"base"
);
if
(
strcmp
(
low
(
volume_name
),
"pwrb"
)
==
0
)
else
if
(
strcmp
(
low
(
volume_name
),
"pwrs"
)
==
0
)
sprintf
(
fname
,
"pwr_%sclasses_hpp"
,
"base"
);
sprintf
(
fname
,
"pwr_%sclasses_h"
,
"system"
);
else
if
(
strcmp
(
low
(
volume_name
),
"pwrs"
)
==
0
)
else
sprintf
(
fname
,
"pwr_%sclasses_hpp"
,
"system"
);
sprintf
(
fname
,
"pwr_%sclasses_h"
,
low
(
volume_name
));
else
sprintf
(
fname
,
"pwr_%sclasses_hpp"
,
low
(
volume_name
));
}
else
{
if
(
strcmp
(
low
(
volume_name
),
"pwrb"
)
==
0
)
sprintf
(
fname
,
"pwr_%sclasses_h"
,
"base"
);
else
if
(
strcmp
(
low
(
volume_name
),
"pwrs"
)
==
0
)
sprintf
(
fname
,
"pwr_%sclasses_h"
,
"system"
);
else
sprintf
(
fname
,
"pwr_%sclasses_h"
,
low
(
volume_name
));
}
sts
=
struct_volname_to_id
();
sts
=
struct_volname_to_id
();
if
(
sts
==
0
)
if
(
sts
==
0
)
...
@@ -80,7 +90,10 @@ int ClassRead::struct_class()
...
@@ -80,7 +90,10 @@ int ClassRead::struct_class()
strcpy
(
volume_name_low
,
low
(
volume_name
));
strcpy
(
volume_name_low
,
low
(
volume_name
));
struct_get_filename
(
struct_filename
);
struct_get_filename
(
struct_filename
);
sprintf
(
fname
,
"%s%s_c_%s.h"
,
dir
,
volume_name_low
,
low
(
class_name
));
if
(
hpp
)
sprintf
(
fname
,
"%s%s_c_%s.hpp"
,
dir
,
volume_name_low
,
low
(
class_name
));
else
sprintf
(
fname
,
"%s%s_c_%s.h"
,
dir
,
volume_name_low
,
low
(
class_name
));
if
(
!
common_structfile_only
)
{
if
(
!
common_structfile_only
)
{
cstruc
=
new
CnvFile
();
cstruc
=
new
CnvFile
();
cstruc
->
f
.
open
(
fname
);
cstruc
->
f
.
open
(
fname
);
...
@@ -102,6 +115,7 @@ endl;
...
@@ -102,6 +115,7 @@ endl;
// Add into index file
// Add into index file
struct_cclass_written
=
0
;
struct_cclass_written
=
0
;
struct_cclass_endwritten
=
0
;
struct_filler_cnt
=
0
;
struct_filler_cnt
=
0
;
return
1
;
return
1
;
...
@@ -117,10 +131,18 @@ int ClassRead::struct_body()
...
@@ -117,10 +131,18 @@ int ClassRead::struct_body()
attr_count
=
0
;
attr_count
=
0
;
if
(
strcmp
(
low
(
body_name
),
"devbody"
)
==
0
)
if
(
strcmp
(
low
(
body_name
),
"devbody"
)
==
0
)
{
strcpy
(
struct_name
,
"pwr_sdClass_"
);
if
(
hpp
)
else
strcpy
(
struct_name
,
"pwr_dClass_"
);
strcpy
(
struct_name
,
"pwr_sClass_"
);
else
strcpy
(
struct_name
,
"pwr_sdClass_"
);
}
else
{
if
(
hpp
)
strcpy
(
struct_name
,
"pwr_Class_"
);
else
strcpy
(
struct_name
,
"pwr_sClass_"
);
}
if
(
strcmp
(
body_structname
,
""
)
==
0
)
if
(
strcmp
(
body_structname
,
""
)
==
0
)
strcat
(
struct_name
,
class_name
);
strcat
(
struct_name
,
class_name
);
else
else
...
@@ -188,14 +210,20 @@ endl;
...
@@ -188,14 +210,20 @@ endl;
cstruc
->
f
<<
cstruc
->
f
<<
"/* Body: "
<<
body_name
<<
" */"
<<
endl
;
"/* Body: "
<<
body_name
<<
" */"
<<
endl
;
fp_struct
<<
if
(
hpp
)
endl
<<
fp_struct
<<
endl
<<
"typedef struct {"
<<
endl
;
"class "
<<
struct_name
<<
" "
;
if
(
!
common_structfile_only
)
else
cstruc
->
f
<<
fp_struct
<<
endl
<<
endl
<<
"typedef struct {"
<<
endl
;
if
(
!
common_structfile_only
)
{
if
(
hpp
)
cstruc
->
f
<<
endl
<<
"class "
<<
struct_name
<<
" "
;
else
cstruc
->
f
<<
endl
<<
"typedef struct {"
<<
endl
;
"typedef struct {"
<<
endl
;
}
return
1
;
return
1
;
}
}
...
@@ -225,12 +253,21 @@ int ClassRead::struct_body_close()
...
@@ -225,12 +253,21 @@ int ClassRead::struct_body_close()
strcat
(
struct_name
,
class_name
);
strcat
(
struct_name
,
class_name
);
else
else
strcat
(
struct_name
,
body_structname
);
strcat
(
struct_name
,
body_structname
);
fp_struct
<<
if
(
hpp
)
{
fp_struct
<<
"};"
<<
endl
;
if
(
!
common_structfile_only
)
cstruc
->
f
<<
"};"
<<
endl
;
}
else
{
fp_struct
<<
"} "
<<
struct_name
<<
";"
<<
endl
;
"} "
<<
struct_name
<<
";"
<<
endl
;
if
(
!
common_structfile_only
)
if
(
!
common_structfile_only
)
cstruc
->
f
<<
cstruc
->
f
<<
"} "
<<
struct_name
<<
";"
<<
endl
;
"} "
<<
struct_name
<<
";"
<<
endl
;
}
fp_struct
<<
fp_struct
<<
endl
;
endl
;
...
@@ -261,15 +298,17 @@ endl;
...
@@ -261,15 +298,17 @@ endl;
}
}
// endif pwr_cClass...
// endif pwr_cClass...
if
(
struct_class_open
)
if
(
!
struct_cclass_endwritten
)
{
fp_struct
<<
fp_struct
<<
"#endif"
<<
endl
<<
"#endif"
<<
endl
<<
endl
;
endl
;
if
(
!
common_structfile_only
&&
struct_class_open
)
if
(
!
common_structfile_only
&&
struct_class_open
)
cstruc
->
f
<<
cstruc
->
f
<<
"#endif"
<<
endl
<<
"#endif"
<<
endl
<<
endl
;
endl
;
struct_cclass_endwritten
=
1
;
}
// Close class structfile
// Close class structfile
if
(
!
common_structfile_only
&&
struct_class_open
)
if
(
!
common_structfile_only
&&
struct_class_open
)
...
@@ -281,6 +320,7 @@ endl;
...
@@ -281,6 +320,7 @@ endl;
delete
cstruc
;
delete
cstruc
;
struct_class_open
=
0
;
struct_class_open
=
0
;
}
}
return
1
;
return
1
;
}
}
...
@@ -322,6 +362,14 @@ int ClassRead::struct_attribute()
...
@@ -322,6 +362,14 @@ int ClassRead::struct_attribute()
strcpy
(
type_name
,
"pwr_s"
);
strcpy
(
type_name
,
"pwr_s"
);
strcat
(
type_name
,
attr_typeref
);
strcat
(
type_name
,
attr_typeref
);
}
}
else
if
(
attr_isclass
)
{
if
(
hpp
)
strcpy
(
type_name
,
"pwr_Class_"
);
else
strcpy
(
type_name
,
"pwr_sClass_"
);
strcat
(
type_name
,
attr_typeref
);
}
else
else
{
{
strcpy
(
type_name
,
"pwr_t"
);
strcpy
(
type_name
,
"pwr_t"
);
...
@@ -342,6 +390,29 @@ int ClassRead::struct_attribute()
...
@@ -342,6 +390,29 @@ int ClassRead::struct_attribute()
}
}
}
}
if
(
hpp
&&
attr_count
==
0
)
{
if
(
attr_isclass
&&
strcmp
(
pgmname
,
"Super"
)
==
0
)
{
fp_struct
<<
": public "
<<
type_name
<<
" {"
<<
endl
<<
" public:"
<<
endl
;
if
(
!
common_structfile_only
)
cstruc
->
f
<<
type_name
<<
" {"
<<
endl
<<
" public:"
<<
endl
;
attr_count
++
;
return
1
;
}
else
{
fp_struct
<<
" {"
<<
endl
<<
" public:"
<<
endl
;
if
(
!
common_structfile_only
)
cstruc
->
f
<<
" {"
<<
endl
<<
" public:"
<<
endl
;
}
}
if
(
strcmp
(
low
(
attr_type
),
"input"
)
==
0
)
if
(
strcmp
(
low
(
attr_type
),
"input"
)
==
0
)
{
{
if
(
attr_array
&&
attr_pointer
)
if
(
attr_array
&&
attr_pointer
)
...
@@ -723,7 +794,10 @@ void ClassRead::struct_get_filename( char *struct_file)
...
@@ -723,7 +794,10 @@ void ClassRead::struct_get_filename( char *struct_file)
else
else
strcat
(
struct_file
,
low
(
volume_name
));
strcat
(
struct_file
,
low
(
volume_name
));
strcat
(
struct_file
,
"classes.h"
);
if
(
hpp
)
strcat
(
struct_file
,
"classes.hpp"
);
else
strcat
(
struct_file
,
"classes.h"
);
}
}
int
ClassRead
::
struct_check_typename
(
char
*
type_name
)
int
ClassRead
::
struct_check_typename
(
char
*
type_name
)
...
...
src/exe/co_convert/src/co_convert.cpp
View file @
02ae14e8
...
@@ -23,6 +23,8 @@ static void usage()
...
@@ -23,6 +23,8 @@ static void usage()
printf
(
" -c: Create html files from c- and -h-files
\n
"
);
printf
(
" -c: Create html files from c- and -h-files
\n
"
);
printf
(
" -s: Create h files from wb_load-files
\n
"
);
printf
(
" -s: Create h files from wb_load-files
\n
"
);
printf
(
" -so: Create one common h file from wb_load-files
\n
"
);
printf
(
" -so: Create one common h file from wb_load-files
\n
"
);
printf
(
" -p: Create hpp files from wb_load-files
\n
"
);
printf
(
" -po: Create one common hpp file from wb_load-files
\n
"
);
printf
(
" -t: Create html from xtthelp-file
\n
"
);
printf
(
" -t: Create html from xtthelp-file
\n
"
);
printf
(
" -d: Output directory
\n
"
);
printf
(
" -d: Output directory
\n
"
);
printf
(
" -g: Setup file
\n
"
);
printf
(
" -g: Setup file
\n
"
);
...
@@ -131,6 +133,10 @@ int main( int argc, char *argv[])
...
@@ -131,6 +133,10 @@ int main( int argc, char *argv[])
case
's'
:
case
's'
:
cr
->
generate_struct
=
1
;
cr
->
generate_struct
=
1
;
break
;
break
;
case
'p'
:
cr
->
generate_struct
=
1
;
cr
->
hpp
=
1
;
break
;
case
'o'
:
case
'o'
:
cr
->
common_structfile_only
=
1
;
cr
->
common_structfile_only
=
1
;
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment