Fossil

Check-in [236cf135]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:minor doc additions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | th1-query-api
Files: files | file ages | folders
SHA1: 236cf1359400683074daf36782dc117195705035
User & Date: stephan 2012-07-15 11:04:14
Context
2012-07-15
11:16
Refactord ob api to only swap out the Vtab output state, as opposed to the whole Vtab state (which includes the allocator). check-in: d9e0ee2f user: stephan tags: th1-query-api
11:04
minor doc additions. check-in: 236cf135 user: stephan tags: th1-query-api
10:59
Added ability to tie client data/finalizer to th1, allowing a refactoring of OB manager to use per-interpreter-instance state instead of global state. check-in: 147c602d user: stephan tags: th1-query-api
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/th.c.

16
17
18
19
20
21
22




23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39





40
41
42
43
44
45
46
  return fossil_realloc( p, n );
}

typedef struct Th_Command   Th_Command;
typedef struct Th_Frame     Th_Frame;
typedef struct Th_Variable  Th_Variable;





struct Th_GcEntry {
  void * pData;
  void (*xDel)( Th_Interp *, void * );
};
typedef struct Th_GcEntry Th_GcEntry;

/*
** Interpreter structure.
*/
struct Th_Interp {
  Th_Vtab *pVtab;    /* Copy of the argument passed to Th_CreateInterp() */
  char *zResult;     /* Current interpreter result (Th_Malloc()ed) */
  int nResult;       /* number of bytes in zResult */
  Th_Hash *paCmd;    /* Table of registered commands */
  Th_Frame *pFrame;  /* Current execution frame */
  int isListMode;    /* True if thSplitList() should operate in "list" mode */
  Th_Hash * paGc;    /* holds client-provided data owned by this object */





#ifdef TH_USE_SQLITE
  struct {
    sqlite3_stmt ** aStmt;
    int nStmt;
  } stmt;           /* list of prepared statements */
#endif
};







>
>
>
>

|
|













|
>
>
>
>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  return fossil_realloc( p, n );
}

typedef struct Th_Command   Th_Command;
typedef struct Th_Frame     Th_Frame;
typedef struct Th_Variable  Th_Variable;

/*
** Holds client-provided "garbage collected" data for
** a Th_Interp instance.
*/
struct Th_GcEntry {
  void * pData;                        /* arbitrary data */
  void (*xDel)( Th_Interp *, void * ); /* finalizer for pData */
};
typedef struct Th_GcEntry Th_GcEntry;

/*
** Interpreter structure.
*/
struct Th_Interp {
  Th_Vtab *pVtab;    /* Copy of the argument passed to Th_CreateInterp() */
  char *zResult;     /* Current interpreter result (Th_Malloc()ed) */
  int nResult;       /* number of bytes in zResult */
  Th_Hash *paCmd;    /* Table of registered commands */
  Th_Frame *pFrame;  /* Current execution frame */
  int isListMode;    /* True if thSplitList() should operate in "list" mode */
  Th_Hash * paGc;    /* Holds client-provided data owned by this
                        object. It would be more efficient to store
                        these in a list (we don't expect many
                        entries), but Th_Hash has the strong advantage
                        of being here and working.
                     */
#ifdef TH_USE_SQLITE
  struct {
    sqlite3_stmt ** aStmt;
    int nStmt;
  } stmt;           /* list of prepared statements */
#endif
};