Download ext/qrf/qrf.h from AryaWu/sqlite: direct link, hf CLI and curl.
- Browser
- Download file 8.9 kB
-
https://huggingface.co/AryaWu/sqlite/resolve/main/ext/qrf/qrf.h
- Command line
-
hf download hf://AryaWu/sqlite/ext/qrf/qrf.h
-
curl -L -o qrf.h https://huggingface.co/AryaWu/sqlite/resolve/main/ext/qrf/qrf.h
8.9 kB
| /* | |
| ** 2025-10-20 | |
| ** | |
| ** The author disclaims copyright to this source code. In place of | |
| ** a legal notice, here is a blessing: | |
| ** | |
| ** May you do good and not evil. | |
| ** May you find forgiveness for yourself and forgive others. | |
| ** May you share freely, never taking more than you give. | |
| ** | |
| ************************************************************************* | |
| ** Header file for the Result-Format or "resfmt" utility library for SQLite. | |
| ** See the resfmt.md documentation for additional information. | |
| */ | |
| extern "C" { | |
| /* | |
| ** Specification used by clients to define the output format they want | |
| */ | |
| typedef struct sqlite3_qrf_spec sqlite3_qrf_spec; | |
| struct sqlite3_qrf_spec { | |
| unsigned char iVersion; /* Version number of this structure */ | |
| unsigned char eStyle; /* Formatting style. "box", "csv", etc... */ | |
| unsigned char eEsc; /* How to escape control characters in text */ | |
| unsigned char eText; /* Quoting style for text */ | |
| unsigned char eTitle; /* Quating style for the text of column names */ | |
| unsigned char eBlob; /* Quoting style for BLOBs */ | |
| unsigned char bTitles; /* True to show column names */ | |
| unsigned char bWordWrap; /* Try to wrap on word boundaries */ | |
| unsigned char bTextJsonb; /* Render JSONB blobs as JSON text */ | |
| unsigned char eDfltAlign; /* Default alignment, no covered by aAlignment */ | |
| unsigned char eTitleAlign; /* Alignment for column headers */ | |
| unsigned char bSplitColumn; /* Wrap single-column output into many columns */ | |
| unsigned char bBorder; /* Show outer border in Box and Table styles */ | |
| short int nWrap; /* Wrap columns wider than this */ | |
| short int nScreenWidth; /* Maximum overall table width */ | |
| short int nLineLimit; /* Maximum number of lines for any row */ | |
| short int nTitleLimit; /* Maximum number of characters in a title */ | |
| int nCharLimit; /* Maximum number of characters in a cell */ | |
| int nWidth; /* Number of entries in aWidth[] */ | |
| int nAlign; /* Number of entries in aAlignment[] */ | |
| short int *aWidth; /* Column widths */ | |
| unsigned char *aAlign; /* Column alignments */ | |
| char *zColumnSep; /* Alternative column separator */ | |
| char *zRowSep; /* Alternative row separator */ | |
| char *zTableName; /* Output table name */ | |
| char *zNull; /* Rendering of NULL */ | |
| char *(*xRender)(void*,sqlite3_value*); /* Render a value */ | |
| int (*xWrite)(void*,const char*,sqlite3_int64); /* Write output */ | |
| void *pRenderArg; /* First argument to the xRender callback */ | |
| void *pWriteArg; /* First argument to the xWrite callback */ | |
| char **pzOutput; /* Storage location for output string */ | |
| /* Additional fields may be added in the future */ | |
| }; | |
| /* | |
| ** Interfaces | |
| */ | |
| int sqlite3_format_query_result( | |
| sqlite3_stmt *pStmt, /* SQL statement to run */ | |
| const sqlite3_qrf_spec *pSpec, /* Result format specification */ | |
| char **pzErr /* OUT: Write error message here */ | |
| ); | |
| /* | |
| ** Range of values for sqlite3_qrf_spec.aWidth[] entries and for | |
| ** sqlite3_qrf_spec.mxColWidth and .nScreenWidth | |
| */ | |
| /* | |
| ** Output styles: | |
| */ | |
| /* | |
| ** Quoting styles for text. | |
| ** Allowed values for sqlite3_qrf_spec.eText | |
| */ | |
| /* | |
| ** Quoting styles for BLOBs | |
| ** Allowed values for sqlite3_qrf_spec.eBlob | |
| */ | |
| /* | |
| ** Control-character escape modes. | |
| ** Allowed values for sqlite3_qrf_spec.eEsc | |
| */ | |
| /* | |
| ** Allowed values for "boolean" fields, such as "bColumnNames", "bWordWrap", | |
| ** and "bTextJsonb". There is an extra "auto" variants so these are actually | |
| ** tri-state settings, not booleans. | |
| */ | |
| /* | |
| ** Possible alignment values alignment settings | |
| ** | |
| ** Horizontal Vertial | |
| ** ---------- -------- */ | |
| /* | |
| ** Auxiliary routines contined within this module that might be useful | |
| ** in other contexts, and which are therefore exported. | |
| */ | |
| /* | |
| ** Return an estimate of the width, in columns, for the single Unicode | |
| ** character c. For normal characters, the answer is always 1. But the | |
| ** estimate might be 0 or 2 for zero-width and double-width characters. | |
| ** | |
| ** Different devices display unicode using different widths. So | |
| ** it is impossible to know that true display width with 100% accuracy. | |
| ** Inaccuracies in the width estimates might cause columns to be misaligned. | |
| ** Unfortunately, there is nothing we can do about that. | |
| */ | |
| int sqlite3_qrf_wcwidth(int c); | |
| /* | |
| ** Return an estimate of the number of display columns used by the | |
| ** string in the argument. The width of individual characters is | |
| ** determined as for sqlite3_qrf_wcwidth(). VT100 escape code sequences | |
| ** are assigned a width of zero. | |
| */ | |
| size_t sqlite3_qrf_wcswidth(const char*); | |
| } | |