Changeset 5731 for branches/1.4


Ignore:
Timestamp:
Jun 22, 2015 1:40:41 PM (9 years ago)
Author:
ldelgass
Message:

merge r5730 from trunk

Location:
branches/1.4
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4

    • Property svn:mergeinfo changed
      /trunkmerged: 5730
  • branches/1.4/src/core/Makefile.in

    r4545 r5731  
    3636                  -DRAPPTURE_VERSION=\"$(RAPPTURE_VERSION)\"
    3737
    38 CC_SWITCHES     = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES) 
    39 CXX_SWITCHES    = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES) 
     38CC_SWITCHES     = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
     39CXX_SWITCHES    = $(CFLAGS) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES)
    4040
    4141INCLUDES        = \
     
    104104                xerror.h
    105105
    106 # Build the scew and b64 libraries directly into Rappture for now. 
     106# Build the scew and b64 libraries directly into Rappture for now.
    107107# Note: This works because of viewpath-ing. See the VPATH variable.
    108108B64_OBJS        = \
     
    153153                RpDXWriter.h \
    154154                RpDXWriterFInterface.h \
    155                 RpDXWriterFStubs.h 
     155                RpDXWriterFStubs.h
    156156OBJS +=         \
    157157                RpDXWriter.o \
    158                 RpDXWriterFInterface.o 
     158                RpDXWriterFInterface.o
    159159endif
    160160
     
    192192.cc.o:
    193193        $(CXX) $(CXX_SWITCHES) -c $?
    194 .c.o: 
     194.c.o:
    195195        $(CCC) $(CC_SWITCHES) -c $?
    196196
  • branches/1.4/src/core/RpBindingsDict.cc

    r5674 r5731  
    2626 * function's caller.
    2727 *
    28  * Returns the key of the object in the dictionary 
     28 * Returns the key of the object in the dictionary
    2929 * On Error, returns 0 (which also means nothing can be stored at 0)
    3030 */
     
    120120 * This function stores the RpUnits names specified by 'objectName'
    121121 * into the UnitsStr dictionary. This is helpful for writing bindings
    122  * for languages that can not accept pointers to provide back to the 
     122 * for languages that can not accept pointers to provide back to the
    123123 * function's caller.
    124124 *
     
    152152 * This function retrieves the RpUnits name referenced to by 'objKey'
    153153 * from the UnitsStr dictionary. This is helpful for writing bindings
    154  * for languages that can not accept pointers to provide back to the 
     154 * for languages that can not accept pointers to provide back to the
    155155 * function's caller.
    156156 *
  • branches/1.4/src/core/RpBuffer.cc

    r5674 r5731  
    3737{}
    3838
    39 
    4039/**
    4140 * Construct an empty Buffer of specified size.
     
    4847{}
    4948
    50 
    5149/**
    5250 * Construct a Buffer loaded with initial data.
     
    8987}
    9088
    91 
    9289Buffer
    9390Buffer::operator+(const Buffer& b) const
     
    9895}
    9996
    100 
    10197Buffer&
    10298Buffer::operator+=(const Buffer& b)
     
    106102}
    107103
    108 
    109104Buffer::~Buffer()
    110105{}
    111 
    112106
    113107bool
     
    142136    }   
    143137    // Read the file contents directly onto the end of the old buffer.
    144     numBytesRead = fread((char *)bytes() + oldSize, sizeof(char), 
     138    numBytesRead = fread((char *)bytes() + oldSize, sizeof(char),
    145139        stat.st_size, f);
    146140    fclose(f);
    147141    if (numBytesRead != (size_t)stat.st_size) {
    148         status.addError("can't read %ld bytes from \"%s\": %s", stat.st_size, 
     142        status.addError("can't read %ld bytes from \"%s\": %s", stat.st_size,
    149143                        path, strerror(errno));
    150144        return false;
     
    155149}
    156150
    157 
    158 bool
    159 Buffer::dump (Outcome &status, const char* path)
     151bool
     152Buffer::dump(Outcome &status, const char* path)
    160153{
    161154    status.addContext("Rappture::Buffer::dump()");
     
    179172}
    180173
    181 
    182174bool
    183175Buffer::encode(Outcome &status, unsigned int flags)
     
    218210    return true;
    219211}
    220 
    221212
    222213bool
     
    273264}
    274265
    275 
    276 bool
    277 Buffer::do_compress(Outcome& status, SimpleCharBuffer& bin,
     266bool
     267Buffer::do_compress(Outcome& status, SimpleCharBuffer& bin,
    278268                    SimpleCharBuffer& bout)
    279269{
     
    419409}
    420410
    421 
    422411bool
    423412Buffer::do_base64_enc(Outcome& status, const SimpleCharBuffer& bin,
     
    439428}
    440429
    441 
    442430bool
    443431Buffer::do_base64_dec(Outcome& status, const SimpleCharBuffer& bin,
     
    458446}
    459447
    460 
    461 }
    462 
    463 
    464 
     448}
  • branches/1.4/src/core/RpBuffer.h

    r5674 r5731  
    2525};
    2626
    27 
    2827#ifdef __cplusplus
    29     extern "C" {
     28extern "C" {
    3029#endif // ifdef __cplusplus
    3130
     
    4443 */
    4544
    46 class Buffer : public SimpleCharBuffer{
     45class Buffer : public SimpleCharBuffer {
    4746public:
    4847    Buffer();
     
    7473
    7574    bool do_compress(Outcome& status, SimpleCharBuffer& bin,
    76                      SimpleCharBuffer& bout  );
    77     bool do_decompress( Outcome& status, SimpleCharBuffer& bin,
    78                         SimpleCharBuffer& bout  );
     75                     SimpleCharBuffer& bout);
     76    bool do_decompress(Outcome& status, SimpleCharBuffer& bin,
     77                       SimpleCharBuffer& bout);
    7978    bool do_base64_enc(Outcome& status, const SimpleCharBuffer& bin,
    80                        SimpleCharBuffer& bout  );
     79                       SimpleCharBuffer& bout);
    8180    bool do_base64_dec(Outcome& status, const SimpleCharBuffer& bin,
    82                        SimpleCharBuffer& bout  );
     81                       SimpleCharBuffer& bout);
    8382};
    8483
     
    8685
    8786#ifdef __cplusplus
    88     }
     87}
    8988#endif // ifdef __cplusplus
    9089
  • branches/1.4/src/core/RpBufferCInterface.cc

    r5674 r5731  
    249249        flags |= RPENC_B64;
    250250    }
    251     ((Rappture::Buffer*)buf->_buf)->encode(s, flags); 
    252     RpOutcomeToCOutcome(&s,&status);
    253     return status;
    254 }
    255 
    256 RapptureOutcome
    257 RapptureBufferDecode(RapptureBuffer* buf, int decompress, int base64 )
     251    ((Rappture::Buffer*)buf->_buf)->encode(s, flags);
     252    RpOutcomeToCOutcome(&s,&status);
     253    return status;
     254}
     255
     256RapptureOutcome
     257RapptureBufferDecode(RapptureBuffer* buf, int decompress, int base64)
    258258{
    259259    Rappture::Outcome s;
     
    289289
    290290#ifdef __cplusplus
    291     }
     291}
    292292#endif // ifdef __cplusplus
  • branches/1.4/src/core/RpBufferCInterface.h

    r5674 r5731  
    1 
    21/*
    32 * ----------------------------------------------------------------------
     
    1211 * ======================================================================
    1312 */
    14 
    1513
    1614#ifndef _RAPPTURE_BUFFER_C_H
     
    3937    bool (*decode)(Outcome &result, bool, bool);
    4038    */
    41 }RapptureBuffer;
     39} RapptureBuffer;
    4240
    4341int RapptureBufferInit(RapptureBuffer* buf);
     
    5351RapptureOutcome RapptureBufferDump(RapptureBuffer* buf, const char* filename);
    5452RapptureOutcome RapptureBufferEncode(RapptureBuffer* buf, int compress,
    55         int base64 );
    56 RapptureOutcome RapptureBufferDecode(RapptureBuffer* buf, 
    57         int decompress, int base64 );
     53                                     int base64);
     54RapptureOutcome RapptureBufferDecode(RapptureBuffer* buf,
     55                                     int decompress, int base64);
    5856
    5957#ifdef __cplusplus
  • branches/1.4/src/core/RpDict.h

    r5674 r5731  
    2222/**************************************************************************/
    2323
    24 template <  typename KeyType,
    25             typename ValType,
    26             class _Compare=std::equal_to<KeyType> >
     24template <typename KeyType,
     25          typename ValType,
     26          class _Compare=std::equal_to<KeyType> >
    2727    class RpDict;
    2828
    29 template <  typename KeyType,
    30             typename ValType,
    31             class _Compare=std::equal_to<KeyType> >
     29template <typename KeyType,
     30          typename ValType,
     31          class _Compare=std::equal_to<KeyType> >
    3232    class RpDictEntry;
    3333
    34 template <  typename KeyType,
    35             typename ValType,
    36             class _Compare=std::equal_to<KeyType> >
     34template <typename KeyType,
     35          typename ValType,
     36          class _Compare=std::equal_to<KeyType> >
    3737    class RpDictIterator;
    38 
    3938
    4039/*
     
    4847 * because RpBindingsDict uses it.
    4948 */
    50 
    5149
    5250/**************************************************************************/
     
    9391    private:
    9492
    95         RpDict<KeyType,ValType,_Compare>& 
    96             tablePtr;                   /* pointer to the table we want to 
     93        RpDict<KeyType,ValType,_Compare>&
     94            tablePtr;                   /* pointer to the table we want to
    9795                                         * iterate */
    9896        int srchNextIndex;              /* Index of next bucket to be
    9997                                         * enumerated after present one. */
    100         RpDictEntry<KeyType,ValType,_Compare>* 
     98        RpDictEntry<KeyType,ValType,_Compare>*
    10199            srchNextEntryPtr;           /* Next entry to be enumerated in the
    102100                                         * the current bucket. */
    103101
    104102};
    105 
    106103
    107104template <typename KeyType, typename ValType, class _Compare>
     
    113110        // operator==(const RpDictEntry& entry) const;
    114111        //
    115         //operator!=(const RpDictEntry& lhs, const RpDictEntry& rhs) const 
     112        //operator!=(const RpDictEntry& lhs, const RpDictEntry& rhs) const
    116113        //{
    117114        //    if (lhs.key != rhs.key)
     
    189186};
    190187
    191 
    192188template <typename KeyType, typename ValType, class _Compare>
    193189class RpDict
     
    207203        //
    208204        /*virtual*/ RpDict<KeyType,ValType,_Compare>&
    209                         set(    KeyType& key,
    210                                 ValType& value,
    211                                 RpDictHint hint=NULL,
    212                                 int *newPtr=NULL,
    213                                 bool ci=false);
     205                        set(KeyType& key,
     206                            ValType& value,
     207                            RpDictHint hint=NULL,
     208                            int *newPtr=NULL,
     209                            bool ci=false);
    214210
    215211        // find an RpUnits object that should exist in RpUnitsTable
    216         // 
     212        //
    217213        /*virtual*/ RpDictEntry<KeyType,ValType,_Compare>&
    218                         find(   KeyType& key,
    219                                 RpDictHint hint = NULL,
    220                                 bool ci=false   );
    221 
    222         /*virtual*/ RpDictEntry<KeyType,ValType,_Compare>& operator[]( KeyType& key)
     214                        find(KeyType& key,
     215                             RpDictHint hint = NULL,
     216                             bool ci=false);
     217
     218        /*virtual*/ RpDictEntry<KeyType,ValType,_Compare>& operator[](KeyType& key)
    223219        {
    224220            return find(key,NULL);
    225221        }
    226222
    227         RpDict<KeyType,ValType,_Compare>& setCI( bool val );
     223        RpDict<KeyType,ValType,_Compare>& setCI(bool val);
    228224        bool getCI();
    229225        RpDict<KeyType,ValType,_Compare>& toggleCI();
     
    263259        }
    264260
    265         // copy constructor 
     261        // copy constructor
    266262        // RpDict (const RpDict& dict);
    267263
     
    283279        const int REBUILD_MULTIPLIER;
    284280
    285         RpDictEntry<KeyType,ValType,_Compare> 
     281        RpDictEntry<KeyType,ValType,_Compare>
    286282                    **buckets;        /* Pointer to bucket array.  Each
    287283                                       * element points to first entry in
     
    314310
    315311        RpDictEntry<KeyType,ValType,_Compare>*
    316             search( KeyType& key, RpDictHint hint = NULL, bool ci = false );
     312            search(KeyType& key, RpDictHint hint = NULL, bool ci = false);
    317313
    318314        // static void RpDict::RebuildTable ();
     
    326322};
    327323
    328 
    329324/*--------------------------------------------------------------------------*/
    330325/*--------------------------------------------------------------------------*/
     
    340335 * Side Effects:
    341336 *  none.
    342  * 
     337 *
    343338 *
    344339 *************************************************************************/
    345 
    346340template <typename KeyType, typename ValType, class _Compare>
    347341int
     
    350344    return numEntries;
    351345}
    352 
    353346
    354347/**************************************************************************
     
    359352 *
    360353 * Results:
    361  *  Returns a reference to the RpDict object allowing the user to chain 
     354 *  Returns a reference to the RpDict object allowing the user to chain
    362355 *  together different commands such as
    363356 *      rpdict_obj.set(key).find(a).erase(a);
     
    370363template <typename KeyType, typename ValType, class _Compare>
    371364RpDict<KeyType,ValType,_Compare>&
    372 RpDict<KeyType,ValType,_Compare>::set(  KeyType& key,
    373                                         ValType& value,
    374                                         RpDictHint hint,
    375                                         int* newPtr,
    376                                         bool ci )
     365RpDict<KeyType,ValType,_Compare>::set(KeyType& key,
     366                                      ValType& value,
     367                                      RpDictHint hint,
     368                                      int* newPtr,
     369                                      bool ci)
    377370{
    378371    RpDictEntry<KeyType,ValType,_Compare> *hPtr = NULL;
     
    466459 *----------------------------------------------------------------------
    467460 */
    468 
    469461template <typename KeyType, typename ValType, class _Compare>
    470462RpDictEntry<KeyType,ValType,_Compare>&
    471 RpDict<KeyType,ValType,_Compare>::find( KeyType& key,
    472                                         RpDictHint hint,
    473                                         bool ci )
     463RpDict<KeyType,ValType,_Compare>::find(KeyType& key,
     464                                       RpDictHint hint,
     465                                       bool ci)
    474466{
    475467    RpDictEntry<KeyType,ValType,_Compare> *hPtr = NULL;
     
    503495 *----------------------------------------------------------------------
    504496 */
    505 
    506497template <typename KeyType, typename ValType, class _Compare>
    507498RpDictEntry<KeyType,ValType,_Compare>*
    508 RpDict<KeyType,ValType,_Compare>::search(   KeyType& key,
    509                                             RpDictHint hint,
    510                                             bool ci )
    511                                             // bool ci,
    512                                             // RpDictEntryList* entryList)
     499RpDict<KeyType,ValType,_Compare>::search(KeyType& key,
     500                                         RpDictHint hint,
     501                                         bool ci)
     502                                         // bool ci,
     503                                         // RpDictEntryList* entryList)
    513504{
    514505    RpDictEntry<KeyType,ValType,_Compare> *hPtr = NULL;
     
    572563}
    573564
    574 
    575 
    576565/**************************************************************************
    577566 *
     
    589578/*
    590579template <typename KeyType,typename ValType,class _Compare>
    591 RpDict<KeyType,ValType,_Compare>& 
    592 RpDictIterator<KeyType,ValType,_Compare>::getTable() 
     580RpDict<KeyType,ValType,_Compare>&
     581RpDictIterator<KeyType,ValType,_Compare>::getTable()
    593582{
    594583    return tablePtr;
     
    606595 * Side Effects:
    607596 *  moves iterator to the beginning of the hash table.
    608  * 
     597 *
    609598 *
    610599 *************************************************************************/
     
    630619 * Side Effects:
    631620 *  moves iterator to the next entry of the hash table if it exists.
    632  * 
     621 *
    633622 *
    634623 *************************************************************************/
    635 
    636624template <typename KeyType,typename ValType,class _Compare>
    637625RpDictEntry<KeyType,ValType,_Compare>*
     
    669657template <typename KeyType, typename ValType, class _Compare>
    670658RpDict<KeyType,ValType,_Compare>&
    671 RpDict<KeyType,ValType,_Compare>::setCI( bool val )
     659RpDict<KeyType,ValType,_Compare>::setCI(bool val)
    672660{
    673661    caseInsensitive = val;
     
    764752    return *nullEntry;
    765753}
    766 
    767754
    768755/*
     
    784771 *----------------------------------------------------------------------
    785772 */
    786 
    787773template <typename KeyType, typename ValType, class _Compare>
    788774void
     
    794780
    795781    // check to see if the object is associated with a table
    796     // if object is not associated with a table, there is no 
     782    // if object is not associated with a table, there is no
    797783    // need to try to remove it from the table.
    798784    if (tablePtr) {
     
    804790
    805791        // remove the entry from the buckets
    806         // 
     792        //
    807793        // if entry is the first entry in the bucket
    808794        // move the bucket to point to the next entry
     
    812798        else {
    813799            // if the entry is not the first entry in the bucket
    814             // search for the entry 
     800            // search for the entry
    815801            for (prevPtr = *bucketPtr; ; prevPtr = prevPtr->nextPtr) {
    816802
     
    821807                    prevPtr->nextPtr = nextPtr;
    822808                    break;
    823                 } 
     809                }
    824810            } // end for loop
    825811        } // end else
     
    843829}
    844830
    845 
    846831/*
    847832 *----------------------------------------------------------------------
     
    859844 *----------------------------------------------------------------------
    860845 */
    861 
    862846template <typename KeyType, typename ValType, class _Compare>
    863847const KeyType*
     
    884868 *----------------------------------------------------------------------
    885869 */
    886 
    887870template <typename KeyType, typename ValType, class _Compare>
    888871const ValType*
     
    907890 *----------------------------------------------------------------------
    908891 */
    909 
    910892template <typename KeyType, typename ValType, class _Compare>
    911893const ValType*
     
    944926 *----------------------------------------------------------------------
    945927 */
    946 
    947928template <typename KeyType, typename ValType, class _Compare>
    948929bool
     
    954935    return false;
    955936}
    956 
    957937
    958938/*************************************************************************/
     
    978958 *----------------------------------------------------------------------
    979959 */
    980 
    981960template <typename KeyType, typename ValType, class _Compare>
    982961void
    983962RpDict<KeyType,ValType,_Compare>::RebuildTable()
    984963{
    985     int oldSize=0, count=0, index=0; 
     964    int oldSize=0, count=0, index=0;
    986965    RpDictEntry<KeyType,ValType,_Compare> **oldBuckets = NULL;
    987966    RpDictEntry<KeyType,ValType,_Compare> **oldChainPtr = NULL, **newChainPtr = NULL;
     
    996975     */
    997976
    998 
    999977    numBuckets *= 4;
    1000978
     
    10541032 *----------------------------------------------------------------------
    10551033 */
    1056 
    10571034template <typename KeyType, typename ValType, class _Compare>
    10581035unsigned int
     
    10821059 * I chose the one below (multiply by 9 and add new character)
    10831060 * because of the following reasons:
    1084  * 
     1061 *
    10851062 * 1. Multiplying by 10 is perfect for keys that are decimal strings,
    10861063 *    and multiplying by 9 is just about as good.
     
    10911068 *    works well both for decimal and non-decimal strings.
    10921069 */
    1093 
    1094 
    10951070template <typename KeyType, typename ValType, class _Compare>
    10961071unsigned int
     
    11581133 * ---------------------------------------------------------------------
    11591134 */
    1160 
    11611135template <typename KeyType, typename ValType, class _Compare>
    11621136int
     
    11661140}
    11671141
    1168 
    1169 
    11701142#endif
  • branches/1.4/src/core/b64/cdecode.h

    r5674 r5731  
    2424int base64_decode_value(char value_in);
    2525
    26 int base64_decode_block(const char* code_in, const int length_in, 
     26int base64_decode_block(const char* code_in, const int length_in,
    2727        char* plaintext_out, base64_decodestate* state_in);
    2828
  • branches/1.4/src/core/b64/decode.h

    r5674 r5731  
    2222    base64_decodestate _state;
    2323    int _buffersize;
    24    
     24
    2525    decoder(int buffersize_in = 4096)
    2626        : _buffersize(buffersize_in)
  • branches/1.4/src/core/b64/encode.h

    r5674 r5731  
    1515{
    1616       
    17         extern "C" 
     17        extern "C"
    1818        {
    1919                #include "cencode.h"
  • branches/1.4/src/core/rappture_fortran.c

    r5674 r5731  
    100100#   define rp_lib_element_id       RP_LIB_ELEMENT_ID
    101101#   define rp_lib_element_type     RP_LIB_ELEMENT_TYPE
    102 #   define rp_lib_element_str      RP_LIB_ELEMENT_STR 
     102#   define rp_lib_element_str      RP_LIB_ELEMENT_STR
    103103#   define rp_lib_element_obj      RP_LIB_ELEMENT_OBJ
    104104#   define rp_lib_child_num        RP_LIB_CHILD_NUM
     
    130130
    131131extern "C"
    132 void rp_lib_element_comp( int* handle,
    133                             char* path,
    134                             char* retText,
    135                             int path_len,
    136                             int retText_len );
    137 
    138 extern "C"
    139 void rp_lib_element_id(   int* handle,
    140                             char* path,
    141                             char* retText,
    142                             int path_len,
    143                             int retText_len );
    144 
    145 extern "C"
    146 void rp_lib_element_type( int* handle,
    147                             char* path,
    148                             char* retText,
    149                             int path_len,
    150                             int retText_len );
    151 
    152 extern "C"
    153 void rp_lib_element_str(  int* handle,
    154                             char* path,
    155                             char* flavor,
    156                             char* retText,
    157                             int path_len,
    158                             int flavor_len,
    159                             int retText_len );
    160 
    161 extern "C"
    162 int rp_lib_element_obj(   int* handle,
    163                             char* path,
    164                             int path_len );
    165 
    166 extern "C"
    167 int rp_lib_child_num(    int* handle,
    168                             char* path,
    169                             int path_len);
    170 
    171 extern "C"
    172 int rp_lib_child_comp(   int* handle,    /* integer handle of library */
    173                             char* path,     /* DOM path of requested object */
    174                             char* type,     /* specific name of element */
    175                             int* childNum,  /* child number for iteration */
    176                             char* retText,  /* buffer to store return text */
    177                             int path_len,   /* length of path */
    178                             int type_len,   /* length of type */
    179                             int retText_len /* length of return text buffer */
    180                        );
    181 
    182 extern "C"
    183 int rp_lib_child_id(     int* handle,    /* integer handle of library */
    184                             char* path,     /* DOM path of requested object */
    185                             char* type,     /* specific name of element */
    186                             int* childNum,  /* child number for iteration */
    187                             char* retText,  /* buffer to store return text */
    188                             int path_len,   /* length of path */
    189                             int type_len,   /* length of type */
    190                             int retText_len /* length of return text buffer */
    191                        );
    192 
    193 extern "C"
    194 int rp_lib_child_type(   int* handle,    /* integer handle of library */
    195                             char* path,     /* DOM path of requested object */
    196                             char* type,     /* specific name of element */
    197                             int* childNum,  /* child number for iteration */
    198                             char* retText,  /* buffer to store return text */
    199                             int path_len,   /* length of path */
    200                             int type_len,   /* length of type */
    201                             int retText_len /* length of return text buffer */
    202                        );
    203 
    204 extern "C"
    205 int rp_lib_child_str(    int* handle,    /* integer handle of library */
    206                             char* path,     /* DOM path of requested object */
    207                             char* flavor,   /* information you want returned*/
    208                             char* type,     /* specific name of element */
    209                             int* childNum,  /* child number for iteration */
    210                             char* retText,  /* buffer to store return text */
    211                             int path_len,   /* length of path */
    212                             int flavor_len, /* length of flavor */
    213                             int type_len,   /* length of type */
    214                             int retText_len /* length of return text buffer */
    215                        );
    216 
    217 extern "C"
    218 int rp_lib_child_obj(    int* handle,
    219                             char* path,
    220                             char* type,
    221                             int path_len,
    222                             int type_len
    223                           );
    224 
    225 extern "C"
    226 void rp_lib_get(          int* handle,
    227                             char* path,
    228                             char* retText,
    229                             int path_len,
    230                             int retText_len );
    231 
    232 extern "C"
    233 double rp_lib_get_double( int* handle,
    234                             char* path,
    235                             int path_len);
    236 
    237 extern "C"
    238 void rp_lib_put_str(     int* handle,
    239                             char* path,
    240                             char* value,
    241                             int* append,
    242                             int path_len,
    243                             int value_len );
    244 
    245 extern "C"
    246 void rp_lib_put_id_str(  int* handle,
    247                             char* path,
    248                             char* value,
    249                             char* id,
    250                             int* append,
    251                             int path_len,
    252                             int value_len,
    253                             int id_len );
    254 
    255 extern "C"
    256 void rp_lib_put_obj(     int* handle,
    257                             char* path,
    258                             int* valHandle,
    259                             int* append,
    260                             int path_len );
    261 
    262 extern "C"
    263 void rp_lib_put_id_obj(  int* handle,
    264                             char* path,
    265                             int* valHandle,
    266                             char* id,
    267                             int* append,
    268                             int path_len,
    269                             int id_len );
    270 
    271 extern "C"
    272 int rp_lib_remove(       int* handle,
    273                             char* path,
    274                             int path_len);
    275 
    276 extern "C"
    277 int rp_lib_xml_len(      int* handle);
    278 
    279 extern "C"
    280 void rp_lib_xml(         int* handle,
    281                             char* retText,
    282                             int retText_len);
    283 
    284 extern "C"
    285 int rp_lib_write_xml(     int* handle,
    286                             char* outFile,
    287                             int outFile_len);
     132void rp_lib_element_comp(int* handle,
     133                         char* path,
     134                         char* retText,
     135                         int path_len,
     136                         int retText_len);
     137
     138extern "C"
     139void rp_lib_element_id(int* handle,
     140                       char* path,
     141                       char* retText,
     142                       int path_len,
     143                       int retText_len);
     144
     145extern "C"
     146void rp_lib_element_type(int* handle,
     147                         char* path,
     148                         char* retText,
     149                         int path_len,
     150                         int retText_len);
     151
     152extern "C"
     153void rp_lib_element_str(int* handle,
     154                        char* path,
     155                        char* flavor,
     156                        char* retText,
     157                        int path_len,
     158                        int flavor_len,
     159                        int retText_len);
     160
     161extern "C"
     162int rp_lib_element_obj(int* handle,
     163                       char* path,
     164                       int path_len);
     165
     166extern "C"
     167int rp_lib_child_num(int* handle,
     168                     char* path,
     169                     int path_len);
     170
     171extern "C"
     172int rp_lib_child_comp(int* handle,    /* integer handle of library */
     173                      char* path,     /* DOM path of requested object */
     174                      char* type,     /* specific name of element */
     175                      int* childNum,  /* child number for iteration */
     176                      char* retText,  /* buffer to store return text */
     177                      int path_len,   /* length of path */
     178                      int type_len,   /* length of type */
     179                      int retText_len /* length of return text buffer */
     180                      );
     181
     182extern "C"
     183int rp_lib_child_id(int* handle,    /* integer handle of library */
     184                    char* path,     /* DOM path of requested object */
     185                    char* type,     /* specific name of element */
     186                    int* childNum,  /* child number for iteration */
     187                    char* retText,  /* buffer to store return text */
     188                    int path_len,   /* length of path */
     189                    int type_len,   /* length of type */
     190                    int retText_len /* length of return text buffer */
     191                    );
     192
     193extern "C"
     194int rp_lib_child_type(int* handle,    /* integer handle of library */
     195                      char* path,     /* DOM path of requested object */
     196                      char* type,     /* specific name of element */
     197                      int* childNum,  /* child number for iteration */
     198                      char* retText,  /* buffer to store return text */
     199                      int path_len,   /* length of path */
     200                      int type_len,   /* length of type */
     201                      int retText_len /* length of return text buffer */
     202                      );
     203
     204extern "C"
     205int rp_lib_child_str(int* handle,    /* integer handle of library */
     206                     char* path,     /* DOM path of requested object */
     207                     char* flavor,   /* information you want returned*/
     208                     char* type,     /* specific name of element */
     209                     int* childNum,  /* child number for iteration */
     210                     char* retText,  /* buffer to store return text */
     211                     int path_len,   /* length of path */
     212                     int flavor_len, /* length of flavor */
     213                     int type_len,   /* length of type */
     214                     int retText_len /* length of return text buffer */
     215                     );
     216
     217extern "C"
     218int rp_lib_child_obj(int* handle,
     219                     char* path,
     220                     char* type,
     221                     int path_len,
     222                     int type_len);
     223
     224extern "C"
     225void rp_lib_get(int* handle,
     226                char* path,
     227                char* retText,
     228                int path_len,
     229                int retText_len);
     230
     231extern "C"
     232double rp_lib_get_double(int* handle,
     233                         char* path,
     234                         int path_len);
     235
     236extern "C"
     237void rp_lib_put_str(int* handle,
     238                    char* path,
     239                    char* value,
     240                    int* append,
     241                    int path_len,
     242                    int value_len);
     243
     244extern "C"
     245void rp_lib_put_id_str(int* handle,
     246                       char* path,
     247                       char* value,
     248                       char* id,
     249                       int* append,
     250                       int path_len,
     251                       int value_len,
     252                       int id_len);
     253
     254extern "C"
     255void rp_lib_put_obj(int* handle,
     256                    char* path,
     257                    int* valHandle,
     258                    int* append,
     259                    int path_len);
     260
     261extern "C"
     262void rp_lib_put_id_obj(int* handle,
     263                       char* path,
     264                       int* valHandle,
     265                       char* id,
     266                       int* append,
     267                       int path_len,
     268                       int id_len);
     269
     270extern "C"
     271int rp_lib_remove(int* handle,
     272                  char* path,
     273                  int path_len);
     274
     275extern "C"
     276int rp_lib_xml_len(int* handle);
     277
     278extern "C"
     279void rp_lib_xml(int* handle,
     280                char* retText,
     281                int retText_len);
     282
     283extern "C"
     284int rp_lib_write_xml(int* handle,
     285                     char* outFile,
     286                     int outFile_len);
     287
    288288extern "C"
    289289void rp_quit();
     
    306306
    307307// global vars
    308 // dictionary to hold the python objects that 
     308// dictionary to hold the python objects that
    309309// cannot be sent to fortran
    310310
     
    313313int rapptureStarted = 0;
    314314
    315 void rp_init() {
     315void rp_init()
     316{
    316317    //
    317318    PyObject* rpClass = NULL;
    318319    int retVal = 0;
    319    
     320
    320321    // initialize the interpreter
    321322    Py_Initialize();
     
    329330}
    330331
    331 int rp_lib(const char* filePath, int filePath_len) 
     332int rp_lib(const char* filePath, int filePath_len)
    332333{
    333334    PyObject* lib = NULL;
     
    341342
    342343    inFilePath = null_terminate((char*)filePath, filePath_len);
    343    
     344
    344345    // error checking to make sure inText is valid???
    345    
     346
    346347    // grab the rappture class from the dictionary
    347348    rpClass = getObject(0);
     
    367368
    368369int rp_lib_element_obj(int* handle,     /* integer handle of library */
    369                           char* path,     /* null terminated path */
    370                           int path_len
    371                         )
     370                       char* path,     /* null terminated path */
     371                       int path_len)
    372372{
    373373    int newObjHandle = -1;
     
    388388            if (lib) {
    389389                retObj = (PyObject*) rpElement(lib, inPath, flavor);
    390                
     390
    391391                if (retObj) {
    392392
     
    406406}
    407407
    408 void rp_lib_element_comp( int* handle, /* integer handle of library */
    409                             char* path,      /* null terminated path */
    410                             char* retText,   /* return buffer for fortran*/
    411                             int path_len,
    412                             int retText_len /* length of return text buffer */
    413                           )
     408void rp_lib_element_comp(int* handle, /* integer handle of library */
     409                         char* path,      /* null terminated path */
     410                         char* retText,   /* return buffer for fortran*/
     411                         int path_len,
     412                         int retText_len /* length of return text buffer */
     413                         )
    414414{
    415415    char* inPath = NULL;
     
    426426
    427427    rp_lib_element_str(handle,inPath,"component",retText,path_len,10,retText_len);
    428    
    429     if (inPath) {
    430         free(inPath);
    431         inPath = NULL;
    432     }
    433 
    434 }
    435 
    436 void rp_lib_element_id(   int* handle, /* integer handle of library */
    437                             char* path,      /* null terminated path */
    438                             char* retText,   /* return buffer for fortran*/
    439                             int path_len,
    440                             int retText_len /* length of return text buffer */
    441                         )
     428
     429    if (inPath) {
     430        free(inPath);
     431        inPath = NULL;
     432    }
     433
     434}
     435
     436void rp_lib_element_id(int* handle, /* integer handle of library */
     437                       char* path,      /* null terminated path */
     438                       char* retText,   /* return buffer for fortran*/
     439                       int path_len,
     440                       int retText_len /* length of return text buffer */
     441                       )
    442442{
    443443    char* inPath = NULL;
     
    459459}
    460460
    461 void rp_lib_element_type( int* handle, /* integer handle of library */
    462                             char* path,      /* null terminated path */
    463                             char* retText,   /* return buffer for fortran*/
    464                             int path_len,
    465                             int retText_len /* length of return text buffer */
    466                           )
     461void rp_lib_element_type(int* handle, /* integer handle of library */
     462                         char* path,      /* null terminated path */
     463                         char* retText,   /* return buffer for fortran*/
     464                         int path_len,
     465                         int retText_len /* length of return text buffer */
     466                         )
    467467{
    468468    char* inPath = NULL;
     
    483483}
    484484
    485 void rp_lib_element_str(  int* handle, /* integer handle of library */
    486                             char* path,      /* null terminated path */
    487                             char* flavor,    /* null terminated flavor */
    488                             char* retText,   /* return buffer for fortran*/
    489                             int path_len,
    490                             int flavor_len,
    491                             int retText_len /* length of return text buffer */
     485void rp_lib_element_str(int* handle, /* integer handle of library */
     486                        char* path,      /* null terminated path */
     487                        char* flavor,    /* null terminated flavor */
     488                        char* retText,   /* return buffer for fortran*/
     489                        int path_len,
     490                        int flavor_len,
     491                        int retText_len /* length of return text buffer */
    492492                        )
    493493{
     
    498498
    499499    PyObject* lib = NULL;
    500    
     500
    501501    char* retObj = NULL;
    502    
     502
    503503    char* inPath = NULL;
    504504    char* inFlavor = NULL;
     
    517517                    if (retObj) {
    518518                        xmlText = retObj;
    519                    
     519
    520520                        fortranify(xmlText, retText, retText_len);
    521            
     521
    522522                        /*
    523523                        length_in = strlen(xmlText);
     
    534534                        *(retText+length_out-1) = ' ';
    535535                        */
    536                        
     536
    537537                        free(retObj);
    538538                        retObj = NULL;
    539539                    }
    540540                    else {
    541                        
     541
    542542                    }
    543543                }
     
    546546        }
    547547    }
    548    
     548
    549549    if (inPath) {
    550550        free(inPath);
     
    559559}
    560560
    561 int rp_lib_child_num( int* handle,
    562                          char* path,
    563                          int path_len
    564                        )
     561int rp_lib_child_num(int* handle,
     562                     char* path,
     563                     int path_len)
    565564{
    566565    int numChildren = 0;
     
    571570
    572571    inPath = null_terminate(path,path_len);
    573    
     572
    574573    if (rapptureStarted) {
    575574        if ((handle) && (*handle != 0)) {
     
    583582                }
    584583                else {
    585                    
     584
    586585                }
    587586            }
     
    599598
    600599
    601 int rp_lib_child_comp (   int* handle,    /* integer handle of library */
    602                             char* path,     /* DOM path of requested object */
    603                             char* type,     /* specific name of element */
    604                             int* childNum,  /* child number for iteration */
    605                             char* retText,  /* buffer to store return text */
    606                             int path_len,   /* length of path */
    607                             int type_len,   /* length of type */
    608                             int retText_len /* length of return text buffer */
    609                        )
     600int rp_lib_child_comp(int* handle,    /* integer handle of library */
     601                      char* path,     /* DOM path of requested object */
     602                      char* type,     /* specific name of element */
     603                      int* childNum,  /* child number for iteration */
     604                      char* retText,  /* buffer to store return text */
     605                      int path_len,   /* length of path */
     606                      int type_len,   /* length of type */
     607                      int retText_len /* length of return text buffer */
     608                      )
    610609{
    611610    int retVal = 0;
     
    631630    }
    632631
    633     retVal = rp_lib_child_str( handle,
    634                                  inPath,
    635                                  "component",
    636                                  inType,
    637                                  childNum,
    638                                  retText,
    639                                  path_len,
    640                                  10,
    641                                  type_len,
    642                                  retText_len
    643                                );
     632    retVal = rp_lib_child_str(handle,
     633                              inPath,
     634                              "component",
     635                              inType,
     636                              childNum,
     637                              retText,
     638                              path_len,
     639                              10,
     640                              type_len,
     641                              retText_len);
    644642
    645643    if (inPath) {
     
    656654}
    657655
    658 int rp_lib_child_id(   int* handle,    /* integer handle of library */
    659                           char* path,     /* DOM path of requested object */
    660                           char* type,     /* specific name of element */
    661                           int* childNum,  /* child number for iteration */
    662                           char* retText,  /* buffer to store return text */
    663                           int path_len,   /* length of path */
    664                           int type_len,   /* length of type */
    665                           int retText_len /* length of return text buffer */
    666                        )
     656int rp_lib_child_id(int* handle,    /* integer handle of library */
     657                    char* path,     /* DOM path of requested object */
     658                    char* type,     /* specific name of element */
     659                    int* childNum,  /* child number for iteration */
     660                    char* retText,  /* buffer to store return text */
     661                    int path_len,   /* length of path */
     662                    int type_len,   /* length of type */
     663                    int retText_len /* length of return text buffer */
     664                    )
    667665{
    668666    int retVal = 0;
     
    687685    }
    688686
    689     retVal = rp_lib_child_str( handle,
    690                                  inPath,
    691                                  "id",
    692                                  inType,
    693                                  childNum,
    694                                  retText,
    695                                  path_len,
    696                                  3,
    697                                  type_len,
    698                                  retText_len
    699                                );
     687    retVal = rp_lib_child_str(handle,
     688                              inPath,
     689                              "id",
     690                              inType,
     691                              childNum,
     692                              retText,
     693                              path_len,
     694                              3,
     695                              type_len,
     696                              retText_len);
    700697
    701698    if (inPath) {
     
    712709}
    713710
    714 int rp_lib_child_type (   int* handle,    /* integer handle of library */
    715                             char* path,     /* DOM path of requested object */
    716                             char* type,     /* specific name of element */
    717                             int* childNum,  /* child number for iteration */
    718                             char* retText,  /* buffer to store return text */
    719                             int path_len,   /* length of path */
    720                             int type_len,   /* length of type */
    721                             int retText_len /* length of return text buffer */
    722                        )
     711int rp_lib_child_type(int* handle,    /* integer handle of library */
     712                      char* path,     /* DOM path of requested object */
     713                      char* type,     /* specific name of element */
     714                      int* childNum,  /* child number for iteration */
     715                      char* retText,  /* buffer to store return text */
     716                      int path_len,   /* length of path */
     717                      int type_len,   /* length of type */
     718                      int retText_len /* length of return text buffer */
     719                      )
    723720{
    724721    int retVal = 0;
     
    743740    }
    744741
    745     retVal = rp_lib_child_str( handle,
    746                                  inPath,
    747                                  "type",
    748                                  inType,
    749                                  childNum,
    750                                  retText,
    751                                  path_len,
    752                                  5,
    753                                  type_len,
    754                                  retText_len
    755                                );
     742    retVal = rp_lib_child_str(handle,
     743                              inPath,
     744                              "type",
     745                              inType,
     746                              childNum,
     747                              retText,
     748                              path_len,
     749                              5,
     750                              type_len,
     751                              retText_len);
    756752
    757753    if (inPath) {
     
    768764}
    769765
    770 int rp_lib_child_str (    int* handle,    /* integer handle of library */
    771                             char* path,     /* DOM path of requested object */
    772                             char* flavor,   /* information you want returned*/
    773                             char* type,     /* specific name of element */
    774                             int* childNum,  /* child number for iteration */
    775                             char* retText,  /* buffer to store return text */
    776                             int path_len,   /* length of path */
    777                             int flavor_len, /* length of flavor */
    778                             int type_len,   /* length of type */
    779                             int retText_len /* length of return text buffer */
    780                        )
     766int rp_lib_child_str(int* handle,    /* integer handle of library */
     767                     char* path,     /* DOM path of requested object */
     768                     char* flavor,   /* information you want returned*/
     769                     char* type,     /* specific name of element */
     770                     int* childNum,  /* child number for iteration */
     771                     char* retText,  /* buffer to store return text */
     772                     int path_len,   /* length of path */
     773                     int flavor_len, /* length of flavor */
     774                     int type_len,   /* length of type */
     775                     int retText_len /* length of return text buffer */
     776                     )
    781777{
    782778    int retVal = 0;
     
    787783    PyObject* list = NULL;
    788784    PyObject* list_item = NULL;
    789    
     785
    790786    char* xmlChild = NULL;
    791787    char* inPath = NULL;
    792788    char* inType = NULL;
    793789    char* inFlavor = NULL;
    794    
     790
    795791    inPath = null_terminate(path,path_len);
    796792    inFlavor = null_terminate(flavor,flavor_len);
     
    801797            lib = getObject(*handle);
    802798            if (lib) {
    803                 if(objType(inFlavor) == 1) {
     799                if (objType(inFlavor) == 1) {
    804800
    805801                    list = rpChildren_f(lib, inPath, inFlavor);
     
    832828                        }
    833829                    }
    834                     else {
    835                        
    836                     }
    837830                }
    838831            }
     
    855848    }
    856849
    857 
    858850    return retVal;
    859851}
    860852
    861  int rp_lib_child_obj ( int* handle,
    862                             char* path,
    863                             char* type,
    864                             int path_len,
    865                             int type_len
    866                           )
     853int rp_lib_child_obj(int* handle,
     854                     char* path,
     855                     char* type,
     856                     int path_len,
     857                     int type_len)
    867858{
    868859    int newObjHandle = -1;
     
    870861    PyObject* lib = NULL;
    871862    PyObject* list = NULL;
    872    
     863
    873864    char* inPath = NULL;
    874865    char* inType = NULL;
     
    880871        if ((handle) && (*handle != 0)) {
    881872            lib = getObject(*handle);
    882            
     873
    883874            if (lib) {
    884875                list = rpChildren_f(lib, inPath, "object");
     
    889880                    // Py_DECREF(list);
    890881                }
    891                 else {
    892                    
    893                 }
    894882            }
    895883        }
     
    907895
    908896    return newObjHandle;
    909 
    910 }
    911 
    912 
    913 void rp_lib_get( int* handle, /* integer handle of library */
    914                    char* path,      /* null terminated path */
    915                    char* retText,   /* return text buffer for fortran*/
    916                    int path_len,
    917                    int retText_len /* length of return text buffer */
    918                  )
     897}
     898
     899
     900void rp_lib_get(int* handle, /* integer handle of library */
     901                char* path,      /* null terminated path */
     902                char* retText,   /* return text buffer for fortran*/
     903                int path_len,
     904                int retText_len /* length of return text buffer */
     905                )
    919906{
    920907    // int length_in = 0;
     
    924911
    925912    PyObject* lib = NULL;
    926    
     913
    927914    char* inPath = NULL;
    928915
     
    932919        if ((handle) && (*handle != 0)) {
    933920            lib = getObject(*handle);
    934            
     921
    935922            if (lib) {
    936                 // retObj is a borrowed object 
     923                // retObj is a borrowed object
    937924                // whose contents must not be modified
    938925                xmlText = rpGet(lib, inPath);
    939                
     926
    940927                if (xmlText) {
    941928
    942929                    fortranify(xmlText, retText, retText_len);
    943                    
     930
    944931                    /*
    945932                    length_in = strlen(xmlText);
     
    957944                    */
    958945                }
    959 
    960946            }
    961947        }
     
    966952        inPath = NULL;
    967953    }
    968 
    969 }
    970 
    971 double rp_lib_get_double( int* handle,   /* integer handle of library */
    972                             char* path,    /* null terminated path */
    973                             int path_len
    974                           )
     954}
     955
     956double rp_lib_get_double(int* handle,   /* integer handle of library */
     957                         char* path,    /* null terminated path */
     958                         int path_len)
    975959{
    976960    double retVal = 0.0;
     
    978962
    979963    PyObject* lib = NULL;
    980    
     964
    981965    char* inPath = NULL;
    982966
     
    988972        if ((handle) && (*handle != 0)) {
    989973            lib = getObject(*handle);
    990            
     974
    991975            if (lib) {
    992                 // retObj is a borrowed object 
     976                // retObj is a borrowed object
    993977                // whose contents must not be modified
    994978                xmlText = rpGet(lib, inPath);
    995                
     979
    996980                if (xmlText) {
    997981                    retVal = atof(xmlText);
    998982                }
    999 
    1000983            }
    1001984        }
     
    1011994
    1012995
    1013 void rp_lib_put_str( int* handle,
    1014                         char* path,
    1015                         char* value,
    1016                         int* append,
    1017                         int path_len,
    1018                         int value_len
    1019                       )
     996void rp_lib_put_str(int* handle,
     997                    char* path,
     998                    char* value,
     999                    int* append,
     1000                    int path_len,
     1001                    int value_len)
    10201002{
    10211003    char* inPath = NULL;
     
    10241006    inPath = null_terminate(path,path_len);
    10251007    inValue = null_terminate(value,value_len);
    1026 
    10271008
    10281009    if (inPath) {
     
    10541035
    10551036
    1056 void rp_lib_put_id_str ( int* handle,
    1057                         char* path,
    1058                         char* value,
    1059                         char* id,
    1060                         int* append,
    1061                         int path_len,
    1062                         int value_len,
    1063                         int id_len
    1064                       )
    1065 {
    1066     PyObject* lib = NULL;
    1067    
     1037void rp_lib_put_id_str(int* handle,
     1038                       char* path,
     1039                       char* value,
     1040                       char* id,
     1041                       int* append,
     1042                       int path_len,
     1043                       int value_len,
     1044                       int id_len)
     1045{
     1046    PyObject* lib = NULL;
     1047
    10681048    char* inPath = NULL;
    10691049    char* inValue = NULL;
     
    10771057        if ((handle) && (*handle != 0)) {
    10781058            lib = getObject(*handle);
    1079            
     1059
    10801060            if (lib) {
    10811061                rpPut(lib, inPath, inValue, inId, *append);
     
    10981078        inId = NULL;
    10991079    }
    1100 
    1101 }
    1102 
    1103 void rp_lib_put_obj( int* handle,
    1104                         char* path,
    1105                         int* valHandle,
    1106                         int* append,
    1107                         int path_len
    1108                       )
     1080}
     1081
     1082void rp_lib_put_obj(int* handle,
     1083                    char* path,
     1084                    int* valHandle,
     1085                    int* append,
     1086                    int path_len)
    11091087{
    11101088    char* inPath = NULL;
     
    11251103}
    11261104
    1127 void rp_lib_put_id_obj ( int* handle,
    1128                         char* path,
    1129                         int* valHandle,
    1130                         char* id,
    1131                         int* append,
    1132                         int path_len,
    1133                         int id_len
    1134                       )
     1105void rp_lib_put_id_obj(int* handle,
     1106                       char* path,
     1107                       int* valHandle,
     1108                       char* id,
     1109                       int* append,
     1110                       int path_len,
     1111                       int id_len)
    11351112{
    11361113    PyObject* lib = NULL;
    11371114    PyObject* value = NULL;
    1138    
     1115
    11391116    char* inPath = NULL;
    11401117    char* inId = NULL;
     
    11471124            lib = getObject(*handle);
    11481125            value = getObject(*valHandle);
    1149            
     1126
    11501127            if (lib && value) {
    1151                 // retObj is a borrowed object 
     1128                // retObj is a borrowed object
    11521129                // whose contents must not be modified
    11531130                rpPutObj(lib, inPath, value, inId, *append);
     
    11651142        inId = NULL;
    11661143    }
    1167 
    1168 }
    1169 
    1170 int rp_lib_remove (int* handle, char* path, int path_len)
     1144}
     1145
     1146int rp_lib_remove(int* handle, char* path, int path_len)
    11711147{
    11721148    int newObjHandle = -1;
     
    11741150    PyObject* lib = NULL;
    11751151    PyObject* removedObj = NULL;
    1176    
     1152
    11771153    char* inPath = NULL;
    11781154
     
    11851161            if (lib) {
    11861162                removedObj = rpRemove(lib, inPath);
    1187                
     1163
    11881164                if (removedObj) {
    11891165                    newObjHandle = storeObject(removedObj);
    11901166                    // Py_DECREF(removedObj);
    11911167                }
    1192 
    11931168            }
    11941169        }
    11951170    }
    1196    
     1171
    11971172    if (inPath) {
    11981173        free(inPath);
     
    12031178}
    12041179
    1205 int rp_lib_xml_len (int* handle)
     1180int rp_lib_xml_len(int* handle)
    12061181{
    12071182    int length = -1;
     
    12291204}
    12301205
    1231 void  rp_lib_xml(int* handle, char* retText, int retText_len)
     1206void rp_lib_xml(int* handle, char* retText, int retText_len)
    12321207{
    12331208    // int length_in = 0;
     
    12371212
    12381213    PyObject* lib = NULL;
    1239    
     1214
    12401215    if (rapptureStarted) {
    12411216        if ((handle) && (*handle != 0)) {
     
    12441219            if (lib) {
    12451220                xmlText = rpXml(lib);
    1246                
     1221
    12471222                if (xmlText) {
    12481223
     
    12661241                    free(xmlText);
    12671242                }
    1268                
    12691243            }
    12701244        }
     
    13211295
    13221296    RpDictEntry DICT_TEMPLATE *hPtr;
    1323     // RpDictIterator DICT_TEMPLATE iter((RpDict&)*this);                     
     1297    // RpDictIterator DICT_TEMPLATE iter((RpDict&)*this);
    13241298    RpDictIterator DICT_TEMPLATE iter(fortObjDict);
    1325    
    1326     hPtr = iter.first();                                                     
    1327    
     1299
     1300    hPtr = iter.first();
     1301
    13281302    while (hPtr) {
    13291303        Py_DECREF(*(hPtr->getValue()));
    13301304        hPtr->erase();
    1331         hPtr = iter.next();                                                   
     1305        hPtr = iter.next();
    13321306    }
    13331307
     
    13411315}
    13421316
    1343 void rp_result(int* handle) {
     1317void rp_result(int* handle)
     1318{
    13441319    PyObject* lib = NULL;
    13451320
     
    13531328}
    13541329
    1355 int objType( char* flavor) 
     1330int objType( char* flavor)
    13561331{
    13571332    if (flavor == NULL) {
     
    13591334        return 0;
    13601335    }
    1361     else if((*flavor == 'o')&&(strncmp(flavor,"object", 6)==0)){
     1336    else if ((*flavor == 'o') && (strncmp(flavor,"object", 6) == 0)) {
    13621337        // return a PyObject*
    13631338        return 0;
    13641339    }
    1365     else if (
    1366       ((*flavor == 't')&&(strncmp(flavor,"type", 4) == 0))
    1367     ||((*flavor == 'i')&&(strncmp(flavor,"id", 2) == 0))
    1368     ||((*flavor == 'c')&&(strncmp(flavor,"component", 9) == 0)))
     1340    else if (((*flavor == 't') && (strncmp(flavor,"type", 4) == 0)) ||
     1341             ((*flavor == 'i') && (strncmp(flavor,"id", 2) == 0)) ||
     1342             ((*flavor == 'c') && (strncmp(flavor,"component", 9) == 0)))
    13691343    {
    13701344        // return a char*
     
    13781352}
    13791353
    1380 int storeObject(PyObject* objectName) {
    1381 
     1354int storeObject(PyObject* objectName)
     1355{
    13821356    int retVal = -1;
    13831357    int dictKey = fortObjDict.size();
     
    13881362        // no error checking to make sure it was successful in entering
    13891363        // the new entry.
    1390         fortObjDict.set(dictKey,objectName, &newEntry); 
    1391     }
    1392    
     1364        fortObjDict.set(dictKey,objectName, &newEntry);
     1365    }
     1366
    13931367    retVal = dictKey;
    13941368    return retVal;
    13951369}
    13961370
    1397 PyObject* getObject(int objKey) {
    1398 
     1371PyObject* getObject(int objKey)
     1372{
    13991373    PyObject* retVal = *(fortObjDict.find(objKey).getValue());
    14001374
     
    14041378
    14051379   return retVal;
    1406 
    1407 }
     1380}
  • branches/1.4/src/core/scew_extras.c

    r5674 r5731  
    119119}
    120120
    121 
    122121XML_Char const*
    123 scew_element_set_contents_binary(   scew_element* element,
    124                                     XML_Char const* bytes,
    125                                     unsigned int* nbytes    )
     122scew_element_set_contents_binary(scew_element* element,
     123                                 XML_Char const* bytes,
     124                                 unsigned int* nbytes)
    126125{
    127126    XML_Char* out = NULL;
Note: See TracChangeset for help on using the changeset viewer.