Changeset 872 for trunk/examples


Ignore:
Timestamp:
Feb 8, 2008, 2:01:38 PM (17 years ago)
Author:
dkearney
Message:

mainly code cleanups that i've made and stored in my repository over time.

Location:
trunk/examples/c-example
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/c-example/compress.c

    r597 r872  
    1313
    1414    RpLibrary* lib = NULL;
     15    RapptureBuffer buf;
    1516
    1617    const char* xmlFilePath = NULL;
     
    3940        dxFilePath,RPLIB_COMPRESS,RPLIB_OVERWRITE);
    4041
     42    RapptureBufferInit(&buf);
     43    rpGetData(lib,"output.field(dxFile1).component.dx",&buf);
     44    RapptureBufferDecode(&buf,1,1);
     45    RapptureBufferDump(&buf,"bufferDump.txt");
     46    RapptureBufferFree(&buf);
     47
    4148    // write output to run file and signal
    4249    rpResult(lib);
    4350
     51    rpFreeLibrary(&lib);
     52
    4453    return 0;
    4554}
  • trunk/examples/c-example/compress.cc

    r597 r872  
    4343    // write output to run file and signal
    4444    lib->result();
     45    delete lib;
    4546
    4647    return 0;
  • trunk/examples/c-example/plot.cc

    r561 r872  
    5858    else {
    5959        printf("lib->xml() failed\n");
     60        delete lib;
    6061        exit(1);
    6162    }
     
    6667    if ( xmltext.empty() ) {
    6768        std::cout << "lib->getString(input.number(xmin).current) returns null" << std::endl;
     69        delete lib;
    6870        exit(1);
    6971    }
     
    109111    lib->result();
    110112
     113    delete lib;
     114
    111115    return 0;
    112116}
Note: See TracChangeset for help on using the changeset viewer.