home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!emory!ogicse!sequent!muncher.sequent.com!michael
- From: michael@sequent.com (Michael Squires)
- Newsgroups: comp.lang.c++
- Subject: Generate C++ from ANSI C?
- Message-ID: <1992Nov11.030317.14943@sequent.com>
- Date: 11 Nov 92 03:03:17 GMT
- Article-I.D.: sequent.1992Nov11.030317.14943
- Sender: usenet@sequent.com (usenet )
- Organization: Sequent Computer Systems Inc.
- Lines: 41
- Nntp-Posting-Host: eng2.sequent.com
-
- I'm looking for a program which will read ANSI C header (.h) files
- and generate a C++ "class" with the listed functions as methods.
-
- (I know that I don't need to do this in order to call the functions
- from C++. My problem is that I have some tools which read C++
- class definitions and do Good Things with them, and I want to
- "objectify" some existing C API with minimal effort.)
-
- That is, given a file - junk.h - with the following contents:
-
- int func1 (float x);
- void sub1 (int i, char c);
-
- I'd like to generate two files - a "myjunk.h" which looks like:
-
- class junk {
- public:
- int junk_func1 (float x);
- void junk_sub1 (int i, char c);
- }
-
- (not too tough so far! :-) )
-
- and a "myjunk.cpp" which looks like:
-
- int junk::junk_func1 (float x)
- {
- return func1 (x);
- }
-
- void junk::junk_sub1 (int i, char c)
- {
- sub1 (i, c);
- }
-
- Any suggestions?
-
- Thanks,
- Michael Squires
- INTERNET: michael@sequent.com
- CIS: 73510,1555
-