Changeset 496 for trunk/src


Ignore:
Timestamp:
Jul 23, 2006, 12:09:07 PM (18 years ago)
Author:
dkearney
Message:

added getInt and getBool functions to fortran bindings and test programs.

Location:
trunk/src/fortran
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/fortran/RpLibraryFInterface.cc

    r165 r496  
    529529        if (lib) {
    530530            retVal = lib->getDouble(inPath);
     531        }
     532    }
     533
     534    return retVal;
     535}
     536
     537
     538/**********************************************************************/
     539// FUNCTION: rp_lib_get_integer()
     540/// Get data located at 'path' and return it as an integer value.
     541/**
     542 */
     543int rp_lib_get_integer( int* handle,   /* integer handle of library */
     544                        char* path,    /* null terminated path */
     545                        int path_len
     546                      )
     547{
     548    int retVal = 0;
     549
     550    RpLibrary* lib = NULL;
     551
     552    std::string inPath = "";
     553
     554    inPath = null_terminate_str(path,path_len);
     555
     556    if ((handle) && (*handle != 0)) {
     557        lib = getObject_Lib(*handle);
     558
     559        if (lib) {
     560            retVal = lib->getInt(inPath);
     561        }
     562    }
     563
     564    return retVal;
     565}
     566
     567
     568/**********************************************************************/
     569// FUNCTION: rp_lib_get_boolean()
     570/// Get data located at 'path' and return it as an integer value.
     571/**
     572 */
     573int rp_lib_get_boolean( int* handle,   /* integer handle of library */
     574                        char* path,    /* null terminated path */
     575                        int path_len
     576                      )
     577{
     578    bool value = false;
     579    int retVal = 0;
     580
     581    RpLibrary* lib = NULL;
     582
     583    std::string inPath = "";
     584
     585    inPath = null_terminate_str(path,path_len);
     586
     587    if ((handle) && (*handle != 0)) {
     588        lib = getObject_Lib(*handle);
     589
     590        if (lib) {
     591            value = lib->getBool(inPath);
     592            if (value == true) {
     593                retVal = 1;
     594            }
     595            else {
     596                retVal = 0;
     597            }
    531598        }
    532599    }
  • trunk/src/fortran/RpLibraryFStubs.c

    r125 r496  
    292292}
    293293
     294int
     295rp_lib_get_integer_ (   int* handle,
     296                        char* path,
     297                        int path_len) {
     298
     299    return rp_lib_get_integer(handle,path,path_len);
     300}
     301
     302int
     303rp_lib_get_integer__ (  int* handle,
     304                        char* path,
     305                        int path_len) {
     306
     307    return rp_lib_get_integer(handle,path,path_len);
     308}
     309
     310int
     311RP_LIB_GET_INTEGER (    int* handle,
     312                        char* path,
     313                        int path_len) {
     314
     315    return rp_lib_get_integer(handle,path,path_len);
     316}
     317
     318int
     319rp_lib_get_boolean_ (   int* handle,
     320                        char* path,
     321                        int path_len) {
     322
     323    return rp_lib_get_boolean(handle,path,path_len);
     324}
     325
     326int
     327rp_lib_get_boolean__ (  int* handle,
     328                        char* path,
     329                        int path_len) {
     330
     331    return rp_lib_get_boolean(handle,path,path_len);
     332}
     333
     334int
     335RP_LIB_GET_BOOLEAN (    int* handle,
     336                        char* path,
     337                        int path_len) {
     338
     339    return rp_lib_get_boolean(handle,path,path_len);
     340}
     341
    294342void
    295343rp_lib_put_str_ (       int* handle,
Note: See TracChangeset for help on using the changeset viewer.