3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
|
if( zDefault==0 && pSetting && pSetting->def[0] ){
z = fossil_strdup(pSetting->def);
}else{
z = fossil_strdup(zDefault);
}
}
return z;
}
char *db_get_mtime(const char *zName, const char *zFormat, const char *zDefault){
char *z = 0;
if( g.repositoryOpen ){
z = db_text(0, "SELECT mtime FROM config WHERE name=%Q", zName);
}
if( z==0 ){
|
>
>
>
>
>
>
>
>
>
>
>
|
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
|
if( zDefault==0 && pSetting && pSetting->def[0] ){
z = fossil_strdup(pSetting->def);
}else{
z = fossil_strdup(zDefault);
}
}
return z;
}
const char ** db_get_array(size_t *pnValues, const char *zName, const char* zDefault){
const char *value = db_get(zName, zDefault ? zDefault : "[]");
if( value[0]=='[' && value[strlen(value)-1]==']' ){
return json_deserialize_array(pnValues, value);
}else{
const char** azValues = fossil_malloc(sizeof(char*)*2);
azValues[0] = value;
azValues[1] = 0;
return azValues;
}
}
char *db_get_mtime(const char *zName, const char *zFormat, const char *zDefault){
char *z = 0;
if( g.repositoryOpen ){
z = db_text(0, "SELECT mtime FROM config WHERE name=%Q", zName);
}
if( z==0 ){
|