Commit a93e643c by Orlando Vazquez

Put struct definitions in header

parent 7f34eb06
...@@ -17,7 +17,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -17,7 +17,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <string.h> #include <string.h>
extern "C" { extern "C" {
#include <mpool.h> #include <mpool.h>
}; };
#include "database.h" #include "database.h"
...@@ -725,34 +725,6 @@ Handle<Value> Statement::Step(const Arguments& args) { ...@@ -725,34 +725,6 @@ Handle<Value> Statement::Step(const Arguments& args) {
return Undefined(); return Undefined();
} }
// Results will stored in a multi-dimensional linked list.
// That is, a linked list (rows) of linked lists (row values)
// Results are composed of rows. Rows are composed of cells.
struct cell_node {
void *value;
int type;
struct cell_node *next;
};
struct row_node {
struct cell_node *cells;
struct row_node *next;
};
struct fetchall_request {
Persistent<Function> cb;
Statement *sto;
mpool_t *pool;
char *error;
struct row_node *rows;
};
// represent strings with this struct
struct string_t {
size_t bytes;
char data[];
};
int Statement::EIO_AfterFetchAll(eio_req *req) { int Statement::EIO_AfterFetchAll(eio_req *req) {
HandleScope scope; HandleScope scope;
ev_unref(EV_DEFAULT_UC); ev_unref(EV_DEFAULT_UC);
......
...@@ -23,6 +23,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -23,6 +23,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <sqlite3.h> #include <sqlite3.h>
#include <stdlib.h> #include <stdlib.h>
extern "C" {
#include <mpool.h>
};
using namespace v8; using namespace v8;
using namespace node; using namespace node;
...@@ -124,4 +128,32 @@ struct bind_pair { ...@@ -124,4 +128,32 @@ struct bind_pair {
size_t value_size; size_t value_size;
}; };
// Results will stored in a multi-dimensional linked list.
// That is, a linked list (rows) of linked lists (row values)
// Results are composed of rows. Rows are composed of cells.
struct cell_node {
void *value;
int type;
struct cell_node *next;
};
struct row_node {
struct cell_node *cells;
struct row_node *next;
};
struct fetchall_request {
Persistent<Function> cb;
Statement *sto;
mpool_t *pool;
char *error;
struct row_node *rows;
};
// represent strings with this struct
struct string_t {
size_t bytes;
char data[];
};
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment