Changeset 241

Show
Ignore:
Timestamp:
04/08/09 17:45:45 (15 years ago)
Author:
bhilburn
Message:

Pass #2 at cbr.h. Lots of TODOs, and some questions about the
implementation.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/fixingCBR/src/include/vtcross/cbr.h

    r240 r241  
    3030 
    3131 
    32  
    3332/* TODO  Please explain me. 
    3433 */ 
     
    4140}; 
    4241 
     42/* TODO This is a terribly hackish way to go about this. Why not just use actual 
     43 * pointers? Typedefing the pointer out makes the code misleading and hard to 
     44 * understand. 
     45 */ 
    4346typedef cbr_s * cbr; 
     47 
    4448 
    4549/* TODO I don't think these functions do what you want them to do.  The 
     
    4751 * being malloc'd in the cbr_create function is effectively a memory leak, since 
    4852 * you lose the reference to that memory, and instead return a copy of the data 
    49  * in that memory space. */ 
     53 * in that memory space. 
     54 */ 
    5055cbr cbr_create(char * _filename, char * _tablename, char * _cols[], \ 
    5156        unsigned int _len); 
     57 
    5258void cbr_free(cbr _cbr); 
    5359 
     60/* Opens a database, or creates a new one if it does not exist, with the name 
     61 * stored within the passed cbr struct object.  
     62 */ 
     63int OpenDatabase(cbr _cbr); 
     64 
     65/* TODO What is this for? 
     66 */ 
     67int callback(void *notUsed, int argc, char **argv, char **azColName); 
     68 
     69/* TODO 
     70 */ 
     71int ExecuteCommand(cbr _cbr); 
     72 
     73/* TODO 
     74 */ 
     75int ExecuteSearchCommand(cbr _cbr, float *_retvals); 
     76 
     77/* TODO 
     78 */ 
    5479void cbr_print(cbr _cbr); 
    5580 
     81/* TODO 
     82 */ 
    5683int cbr_search(cbr _cbr, char *_names[], int * _ops, float *_vals, \ 
    5784        unsigned int _n, float *_retvals); 
    5885 
     86/* TODO 
     87 */ 
    5988int cbr_add_row(cbr _cbr, char *_cols[], float *_vals, unsigned int _len); 
    6089 
    61  
    62 // open a database or create a database if it does not exist 
    63 int OpenDatabase(cbr _cbr); 
    64  
    65  
    66 // simple callback function, display result 
    67 int callback(void *notUsed, int argc, char **argv, char **azColName); 
    68  
    69  
    70 // execute command 
    71 int ExecuteCommand(cbr _cbr); 
    72  
    73  
    74 // execute search command 
    75 int ExecuteSearchCommand(cbr _cbr, float *_retvals); 
    76  
    77  
    78 // print  
    79 void cbr_print(cbr _cbr); 
    80  
    81  
    82 // cbr search 
    83 int cbr_search(cbr _cbr, char *_names[], int * _ops, float *_vals, \ 
    84         unsigned int _n, float *_retvals); 
    85  
    86 // update a row  
     90/* TODO 
     91 */ 
    8792int cbr_update(cbr _cbr, char *_where[], char*_set[], float *_wherevals, \ 
    8893        float *_setvals, unsigned int _wherelen, unsigned int _setlen); 
    8994 
    90 // cbr add a row 
    91 int cbr_add_row(cbr _cbr, char *_cols[], float *_vals, unsigned int _len); 
    9295 
    9396#endif