Ignore:
Timestamp:
Jun 22, 2009, 12:38:49 PM (15 years ago)
Author:
dkearney
Message:

various code cleanups, mainly tabs. adding units ohms and amps, adding appendf interface to the simple buffer so we can append formatted strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lang/python/Rappture/PyRpLibrary.cc

    r1326 r1527  
    2828
    2929static PyObject *ErrorObject;
    30 RpLibrary* RpLibraryObject_AsLibrary(PyObject *lib);
    31 static PyObject* RpLibraryObject_FromLibrary(RpLibrary *lib);
    32 int boolAsInt(const char* inVal, int* outVal);
    33 int boolIntFromPyObject ( PyObject* inPyObj, const char* defaultVal,
    34                             const char* argName, int* boolVal);
    35 int getArgCount ( PyObject* args, PyObject* keywds, int* argc);
     30RpLibrary * RpLibraryObject_AsLibrary(PyObject *lib);
     31static PyObject * RpLibraryObject_FromLibrary(RpLibrary *lib);
     32int boolAsInt(const char *inVal, int *outVal);
     33int boolIntFromPyObject ( PyObject *inPyObj, const char *defaultVal,
     34                            const char *argName, int *boolVal);
     35int getArgCount ( PyObject *args, PyObject *keywds, int *argc);
    3636
    3737typedef struct {
    3838    PyObject_HEAD
    39     RpLibrary* lib;
     39    RpLibrary *lib;
    4040} RpLibraryObject;
    4141
     
    8787}
    8888
    89 static PyObject*
     89static PyObject *
    9090RpLibraryObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
    9191{
     
    149149            delete(self->lib);
    150150        }
    151         self->ob_type->tp_free((PyObject*) self);
     151        self->ob_type->tp_free((PyObject *) self);
    152152    }
    153153}
     
    169169");
    170170
    171 static PyObject*
     171static PyObject *
    172172RpLibraryObject_copy(RpLibraryObject *self, PyObject *args, PyObject *keywds)
    173173{
     
    178178    PyObject *fromobj = (PyObject *) self;
    179179
    180     static char *kwlist[] = { 
    181         (char *)"topath",
    182         (char *)"frompath",
    183         (char *)"fromobj",
    184         NULL
     180    static char *kwlist[] = {
     181        (char *)"topath",
     182        (char *)"frompath",
     183        (char *)"fromobj",
     184        NULL
    185185    };
    186186
     
    252252");
    253253
    254 static PyObject*
     254static PyObject *
    255255RpLibraryObject_element(RpLibraryObject *self, PyObject *args, PyObject *keywds)
    256256{
     
    263263
    264264    static char *kwlist[] = {
    265         (char *)"path",
    266         (char *)"as",
    267         NULL
     265        (char *)"path",
     266        (char *)"as",
     267        NULL
    268268    };
    269269
     
    340340");
    341341
    342 static PyObject*
     342static PyObject *
    343343RpLibraryObject_get(RpLibraryObject *self, PyObject *args, PyObject *keywds)
    344344{
     
    356356
    357357    static char *kwlist[] = {
    358         (char *)"path",
    359         (char *)"decode",
    360         NULL
     358        (char *)"path",
     359        (char *)"decode",
     360        NULL
    361361    };
    362362
     
    432432");
    433433
    434 static PyObject*
     434static PyObject *
    435435RpLibraryObject_parent(RpLibraryObject *self, PyObject *args, PyObject *keywds)
    436436{
     
    443443
    444444    static char *kwlist[] = {
    445         (char *)"path",
    446         (char *)"as",
    447         NULL
     445        (char *)"path",
     446        (char *)"as",
     447        NULL
    448448    };
    449449
     
    531531");
    532532
    533 static PyObject*
     533static PyObject *
    534534RpLibraryObject_put(RpLibraryObject *self, PyObject *args, PyObject *keywds)
    535535{
     
    555555
    556556    static char *kwlist[] = {
    557         (char *)"path",
    558         (char *)"value",
    559         (char *)"id",
    560         (char *)"append",
    561         (char *)"type",
    562         (char *)"compress",
    563         NULL
     557        (char *)"path",
     558        (char *)"value",
     559        (char *)"id",
     560        (char *)"append",
     561        (char *)"type",
     562        (char *)"compress",
     563        NULL
    564564    };
    565565
     
    827827 * used to create a RpLibrary object from a PyObject
    828828 */
    829 RpLibrary*
     829RpLibrary *
    830830RpLibraryObject_AsLibrary(PyObject *lib)
    831831{
    832     RpLibrary* retval = NULL;
     832    RpLibrary *retval = NULL;
    833833
    834834    if (lib != NULL) {
     
    843843 * used to create a PyObject from a RpLibrary object
    844844 */
    845 PyObject*
     845PyObject *
    846846RpLibraryObject_FromLibrary(RpLibrary *lib)
    847847{
     
    883883
    884884int
    885 boolAsInt(const char* inVal, int* outVal)
     885boolAsInt(const char *inVal, int *outVal)
    886886{
    887887    int len = 0;
     
    936936int
    937937boolIntFromPyObject (
    938     PyObject* inPyObj,
    939     const char* defaultVal,
    940     const char* argName,
    941     int* boolVal
     938    PyObject *inPyObj,
     939    const char *defaultVal,
     940    const char *argName,
     941    int *boolVal
    942942    )
    943943{
    944944    int status = -1;
    945     PyObject* inStrObj = NULL;
    946     char* inStr = NULL;
     945    PyObject *inStrObj = NULL;
     946    char *inStr = NULL;
    947947
    948948    if (    (defaultVal == NULL) ||
     
    983983
    984984int getArgCount (
    985     PyObject* args,
    986     PyObject* keywds,
    987     int* argc
     985    PyObject *args,
     986    PyObject *keywds,
     987    int *argc
    988988    )
    989989{
Note: See TracChangeset for help on using the changeset viewer.