Changeset 27 for trunk/src


Ignore:
Timestamp:
Jul 19, 2005 6:55:32 PM (17 years ago)
Author:
dkearney
Message:

made a temporary fix to the fortran api which now sends the contents of the
xml file to the python rappture parser instead of the file name. before
with sending the filename, we were getting weird segfaults inside of python.
this new approach seems to solve the problem. maybe this change should be
moved to the c api and not the fortran api, because we require those using
the c api to send the contents of the file still, where the fortran api can
just send the file name.

dsk - 20050719

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fortran/rappture_fortran.c

    r21 r27  
    320320    char* inFilePath = NULL;
    321321
     322    long int fileLength = 0;
     323    char* fileContents = NULL;
     324    FILE* fp = NULL;
     325
    322326    if (!rapptureStarted) {
    323327        rp_init();
     
    333337
    334338    if (rpClass) {
     339
     340        fp = fopen(inFilePath,"rb");
     341        if (fp) {
     342            fseek(fp, 0, SEEK_END);
     343            fileLength = ftell(fp);
     344            rewind(fp);
     345        }
     346        fileContents = (char*) calloc(fileLength,sizeof(char));
     347        fread((void*)fileContents,sizeof(char),fileLength,fp);
     348
    335349        // create a RapptureIO object and store in dictionary
    336         lib = createRapptureObj(rpClass, inFilePath);
     350        // lib = createRapptureObj(rpClass, inFilePath);
     351        lib = createRapptureObj(rpClass, fileContents);
    337352
    338353        if (lib) {
Note: See TracChangeset for help on using the changeset viewer.