aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-01-30 12:50:25 +0000
committerdrh <drh@noemail.net>2016-01-30 12:50:25 +0000
commit5f4a686f8c5f0fa206418ab5970b61beb49aca7c (patch)
tree67b93627045f577694f41f38b5cdf8e6797d40ce /src/sqliteInt.h
parent8ea0056d5c1da937377e28e38c8bbccf1a8053e2 (diff)
downloadsqlite-5f4a686f8c5f0fa206418ab5970b61beb49aca7c.tar.gz
sqlite-5f4a686f8c5f0fa206418ab5970b61beb49aca7c.zip
Simplification and size reduction to the printf logic. Remove the bFlags
parameter from sqlite3VXPrintf() and sqlite3XPrintf(). Use sqlite3XPrintf() instead of sqlite3_snprintf() for rendering P4 values in EXPLAIN output. FossilOrigin-Name: 0bdb41c45aa1cc8e5c136aaa6605d54b401483bd
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 1a8a5d3a5..b851399c5 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -2978,10 +2978,16 @@ struct StrAccum {
u32 nAlloc; /* Amount of space allocated in zText */
u32 mxAlloc; /* Maximum allowed allocation. 0 for no malloc usage */
u8 accError; /* STRACCUM_NOMEM or STRACCUM_TOOBIG */
- u8 bMalloced; /* zText points to allocated space */
+ u8 printfFlags; /* SQLITE_PRINTF flags below */
};
#define STRACCUM_NOMEM 1
#define STRACCUM_TOOBIG 2
+#define SQLITE_PRINTF_INTERNAL 0x01 /* Internal-use-only converters allowed */
+#define SQLITE_PRINTF_SQLFUNC 0x02 /* SQL function arguments to VXPrintf */
+#define SQLITE_PRINTF_MALLOCED 0x04 /* True if xText is allocated space */
+
+#define isMalloced(X) (((X)->printfFlags & SQLITE_PRINTF_MALLOCED)!=0)
+
/*
** A pointer to this structure is used to communicate information
@@ -3298,10 +3304,8 @@ struct PrintfArguments {
sqlite3_value **apArg; /* The argument values */
};
-#define SQLITE_PRINTF_INTERNAL 0x01
-#define SQLITE_PRINTF_SQLFUNC 0x02
-void sqlite3VXPrintf(StrAccum*, u32, const char*, va_list);
-void sqlite3XPrintf(StrAccum*, u32, const char*, ...);
+void sqlite3VXPrintf(StrAccum*, const char*, va_list);
+void sqlite3XPrintf(StrAccum*, const char*, ...);
char *sqlite3MPrintf(sqlite3*,const char*, ...);
char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
#if defined(SQLITE_DEBUG) || defined(SQLITE_HAVE_OS_TRACE)