From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8f9b6425123056f0,start X-Google-Attributes: gid103376,public From: Justin Braach Subject: Using C++ ifstream class in Ada95 Date: 1998/02/19 Message-ID: <34EBFBE1.C9AAF7E7@cs.montana.edu>#1/1 X-Deja-AN: 326543284 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: montana.edu Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-02-19T00:00:00+00:00 List-Id: Is there a way to convert a C++ ifstream class object into an Ada File_Type object? For Example: C++ code: -- #include extern "C" void ada_proc( ifstream * ); // This is how it's got to be, (predefined). int main(int argc, char *argv[]) { ifstream *infile; infile = new ifstream(); infile->open(argv[1], ios::nocreate); if( infile ) { ada_proc( infile ); ... } Ada Code: -- In a package procedure ada_proc( infile : file_type ) is -- File_Type? Or something else? begin -- -- do file stuff end ada_proc; pragma Export(C, ada_proc, "ada_proc"); Is there an easy/sane way to convert or use that C++ object as File_Type? Tried using type file_pointer is access file_type; -- pointer operations but was unsuccessful. The file has to be opened in the C++ code, as the only thing that can be sent to the Ada procedure is the pointer to ifstream. Any info would be much appreciated. Justin Braach -- "OVERKILL?!? Look. This ain't no game of 'Kick the Ouphe'..." -- Jaya Ballard fxhunter@cs.montana.edu http://www.cs.montana.edu/~fxhunter