Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
Implementation notes for those who want to modify the codeA. sql buffers1. Much of the logic is concerned with constructing the SQL to be executed.These sql's are stored in one of the global buffers (g_sql_buf).2. Currently, there are 4 of them (controlled by constant NBUFS insrc/sqlite_dataframe.h).3. It is assumed that R is running on a single thread, so this approach willwork.4. Initially, all buffers are 1024 characters long. The buffer sizes arestored in the global int array g_sql_buf_sz.5. When writing strings to a buf with variable length, use_expand_buf([index of buffer], [approx size]). If approx size is greaterthan the buffer's length, it will be reallocated with twice the currentsize.6. Functions use a naming convention with respect to the buffer it uses.Top-level functions may use any of the buffers. Those with nameending in a number are expected to use buffers a buffer with that numberas index, and those "below" it. For example, the function USE_SDF1 mayuse buffers 1 and 2, so those calling it should not store data in thosebuffers that they will need after the function call. Initially I was ableto make do with 3 buffers (0, 1 & 2), but somewhere I had to add anotherbuffer (w/c makes it 4). In most cases, the buffers "below" a number areonly those buffers up to 2 (e.g., USE_SDF1 uses only buffers 1 & 2) so3 can be used by the calling function.B. USE_SDF1, UNUSE_SDF21. Because of the limited