Differences From Artifact [f9afe033de]:
- File src/printf.c — part of check-in [45065c5c28] at 2012-11-04 12:59:14 on branch spelling — Fix typos. (user: dmitry size: 29911) [more...]
To Artifact [0b747a77c1]:
- File src/printf.c — part of check-in [2c6fa9c3b0] at 2012-11-22 23:35:57 on branch trunk — Be consistent about display of check-in comments as either text/plain or text/x-fossil-wiki. When the user configures text/plain, use that format everywhere. (user: drh size: 30224) [more...]
| ︙ | ︙ | |||
42 43 44 45 46 47 48 |
NULL pointers replaced by SQL NULL. %Q */
#define etPOINTER 15 /* The %p conversion */
#define etHTMLIZE 16 /* Make text safe for HTML */
#define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */
#define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */
#define etFOSSILIZE 19 /* The fossil header encoding format. */
#define etPATH 20 /* Path type */
| | < | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
NULL pointers replaced by SQL NULL. %Q */
#define etPOINTER 15 /* The %p conversion */
#define etHTMLIZE 16 /* Make text safe for HTML */
#define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */
#define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */
#define etFOSSILIZE 19 /* The fossil header encoding format. */
#define etPATH 20 /* Path type */
#define etWIKISTR 21 /* Timeline comment text rendered from a char*: %w */
#define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */
#define etROOT 24 /* String value of g.zTop: % */
/*
** An "etByte" is an 8-bit unsigned value.
*/
|
| ︙ | ︙ | |||
90 91 92 93 94 95 96 |
{ 'g', 0, 1, etGENERIC, 30, 0 },
{ 'z', 0, 6, etDYNSTRING, 0, 0 },
{ 'q', 0, 4, etSQLESCAPE, 0, 0 },
{ 'Q', 0, 4, etSQLESCAPE2, 0, 0 },
{ 'b', 0, 2, etBLOB, 0, 0 },
{ 'B', 0, 2, etBLOBSQL, 0, 0 },
{ 'w', 0, 2, etWIKISTR, 0, 0 },
| < | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
{ 'g', 0, 1, etGENERIC, 30, 0 },
{ 'z', 0, 6, etDYNSTRING, 0, 0 },
{ 'q', 0, 4, etSQLESCAPE, 0, 0 },
{ 'Q', 0, 4, etSQLESCAPE2, 0, 0 },
{ 'b', 0, 2, etBLOB, 0, 0 },
{ 'B', 0, 2, etBLOBSQL, 0, 0 },
{ 'w', 0, 2, etWIKISTR, 0, 0 },
{ 'h', 0, 4, etHTMLIZE, 0, 0 },
{ 'R', 0, 0, etROOT, 0, 0 },
{ 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */
{ 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */
{ 'F', 0, 4, etFOSSILIZE, 0, 0 },
{ 'S', 0, 4, etSTRINGID, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
|
| ︙ | ︙ | |||
154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
** is an alias for strlen().
*/
static int StrNLen32(const char *z, int N){
int n = 0;
while( (N-- != 0) && *(z++)!=0 ){ n++; }
return n;
}
/*
** The root program. All variations call this core.
**
** INPUTS:
** func This is a pointer to a function taking three arguments
| > > > > > > > > > > > > > > > > > > > > > | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
** is an alias for strlen().
*/
static int StrNLen32(const char *z, int N){
int n = 0;
while( (N-- != 0) && *(z++)!=0 ){ n++; }
return n;
}
/*
** Return an appropriate set of flags for wiki_convert() for displaying
** comments on a timeline. These flag settings are determined by
** configuration parameters.
*/
static int wiki_convert_flags(void){
static int wikiFlags = 0;
if( wikiFlags==0 ){
if( db_get_boolean("timeline-block-markup", 0) ){
wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
}else{
wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
}
if( db_get_boolean("timeline-plaintext", 0) ){
wikiFlags |= WIKI_LINKSONLY;
}
}
return wikiFlags;
}
/*
** The root program. All variations call this core.
**
** INPUTS:
** func This is a pointer to a function taking three arguments
|
| ︙ | ︙ | |||
696 697 698 699 700 701 702 |
break;
}
case etWIKISTR: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
char *zWiki = va_arg(ap, char*);
Blob wiki;
blob_init(&wiki, zWiki, limit);
| | < < < < < < | 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 |
break;
}
case etWIKISTR: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
char *zWiki = va_arg(ap, char*);
Blob wiki;
blob_init(&wiki, zWiki, limit);
wiki_convert(&wiki, pBlob, wiki_convert_flags());
blob_reset(&wiki);
length = width = 0;
break;
}
case etERROR:
buf[0] = '%';
buf[1] = c;
errorflag = 0;
idx = 1+(c!=0);
blob_append(pBlob,"%",idx);
count += idx;
|
| ︙ | ︙ |