Changeset: 04d56ae9c5e8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/04d56ae9c5e8
Modified Files:
.editorconfig
clients/mapiclient/ReadlineTools.c
clients/mapiclient/dotmonetdb.c
clients/mapiclient/dump.c
clients/mapiclient/iconv-stream.h
clients/mapiclient/mhelp.c
clients/mapiclient/msqldump.c
Branch: default
Log Message:
User 8-space tabs in mapiclient.
diffs (truncated from 1885 to 300 lines):
diff --git a/.editorconfig b/.editorconfig
--- a/.editorconfig
+++ b/.editorconfig
@@ -24,7 +24,7 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = true
-[{clients/{mapilib,odbc},gdk}/**.{c,h}{,.in}]
+[{clients/{mapi{lib,client},odbc},gdk}/**.{c,h}{,.in}]
tab_width = 8
max_line_length = 72
diff --git a/clients/mapiclient/ReadlineTools.c
b/clients/mapiclient/ReadlineTools.c
--- a/clients/mapiclient/ReadlineTools.c
+++ b/clients/mapiclient/ReadlineTools.c
@@ -413,7 +413,7 @@ invoke_editor(int cnt, int key) {
return 0;
-bailout:
+ bailout:
if (fp)
fclose(fp);
free(read_buff);
@@ -471,8 +471,8 @@ init_readline(Mapi mid, const char *lang
int len;
if (getenv("HOME") != NULL) {
len = snprintf(_history_file, sizeof(_history_file),
- "%s/.mapiclient_history_%s",
- getenv("HOME"), language);
+ "%s/.mapiclient_history_%s",
+ getenv("HOME"), language);
if (len == -1 || len >= FILENAME_MAX)
fprintf(stderr, "Warning: history filename path
is too large\n");
else
diff --git a/clients/mapiclient/dotmonetdb.c b/clients/mapiclient/dotmonetdb.c
--- a/clients/mapiclient/dotmonetdb.c
+++ b/clients/mapiclient/dotmonetdb.c
@@ -43,12 +43,19 @@ parse_dotmonetdb(DotMonetdb *dotfile)
int len = -1;
cfile = wbuf;
if (xdg != NULL)
- len = _snwprintf(wbuf, sizeof(wbuf),
L"%ls%lcmonetdb", xdg, DIR_SEP);
+ len = _snwprintf(wbuf, sizeof(wbuf),
+ L"%ls%lcmonetdb", xdg,
+ DIR_SEP);
else if (home != NULL)
- len = _snwprintf(wbuf, sizeof(wbuf),
L"%ls%lc.config%lcmonetdb", home, DIR_SEP, DIR_SEP);
- if (len == -1 || len >= FILENAME_MAX || (config =
_wfopen(wbuf, L"r")) == NULL) {
+ len = _snwprintf(wbuf, sizeof(wbuf),
+ L"%ls%lc.config%lcmonetdb",
+ home, DIR_SEP, DIR_SEP);
+ if (len == -1 || len >= FILENAME_MAX ||
+ (config = _wfopen(wbuf, L"r")) == NULL) {
if (home) {
- len = _snwprintf(wbuf, sizeof(wbuf),
L"%ls%lc.monetdb", home, DIR_SEP);
+ len = _snwprintf(wbuf, sizeof(wbuf),
+ L"%ls%lc.monetdb",
+ home, DIR_SEP);
if (len >= 0 && len < FILENAME_MAX)
config = _wfopen(wbuf, L"r");
}
@@ -56,7 +63,7 @@ parse_dotmonetdb(DotMonetdb *dotfile)
}
} else if (*cfile != 0 && (config = _wfopen(cfile, L"r")) == NULL) {
fprintf(stderr, "failed to open file '%ls': %s\n",
- cfile, strerror(errno));
+ cfile, strerror(errno));
}
#else
char *cfile;
@@ -71,12 +78,18 @@ parse_dotmonetdb(DotMonetdb *dotfile)
int len = -1;
cfile = buf;
if (xdg != NULL)
- len = snprintf(buf, sizeof(buf), "%s%cmonetdb",
xdg, DIR_SEP);
+ len = snprintf(buf, sizeof(buf), "%s%cmonetdb",
+ xdg, DIR_SEP);
else if (home != NULL)
- len = snprintf(buf, sizeof(buf),
"%s%c.config%cmonetdb", home, DIR_SEP, DIR_SEP);
- if (len == -1 || len >= FILENAME_MAX || (config =
fopen(buf, "r")) == NULL) {
+ len = snprintf(buf, sizeof(buf),
+ "%s%c.config%cmonetdb",
+ home, DIR_SEP, DIR_SEP);
+ if (len == -1 || len >= FILENAME_MAX ||
+ (config = fopen(buf, "r")) == NULL) {
if (home) {
- len = snprintf(buf, sizeof(buf),
"%s%c.monetdb", home, DIR_SEP);
+ len = snprintf(buf, sizeof(buf),
+ "%s%c.monetdb",
+ home, DIR_SEP);
if (len >= 0 && len < FILENAME_MAX)
config = fopen(buf, "r");
}
@@ -84,7 +97,7 @@ parse_dotmonetdb(DotMonetdb *dotfile)
}
} else if (*cfile != 0 && (config = fopen(cfile, "r")) == NULL) {
fprintf(stderr, "failed to open file '%s': %s\n",
- cfile, strerror(errno));
+ cfile, strerror(errno));
}
#endif
@@ -102,7 +115,7 @@ parse_dotmonetdb(DotMonetdb *dotfile)
continue;
if ((q = strchr(buf, '=')) == NULL) {
fprintf(stderr, CF ":%d: syntax error: %s\n",
- cfile, line, buf);
+ cfile, line, buf);
continue;
}
*q++ = '\0';
@@ -125,8 +138,9 @@ parse_dotmonetdb(DotMonetdb *dotfile)
/* make sure we don't set garbage */
if (strcmp(q, "sql") != 0 &&
strcmp(q, "mal") != 0) {
- fprintf(stderr, CF ":%d: unsupported
language: %s\n",
- cfile, line, q);
+ fprintf(stderr, CF ":%d:"
+ " unsupported language: %s\n",
+ cfile, line, q);
}
dotfile->language = strdup(q);
q = NULL;
@@ -136,7 +150,7 @@ parse_dotmonetdb(DotMonetdb *dotfile)
dotfile->save_history = true;
q = NULL;
} else if (strcmp(q, "false") == 0 ||
- strcmp(q, "off") == 0) {
+ strcmp(q, "off") == 0) {
dotfile->save_history = false;
q = NULL;
}
@@ -151,8 +165,9 @@ parse_dotmonetdb(DotMonetdb *dotfile)
q = NULL;
}
if (q != NULL)
- fprintf(stderr, CF ":%d: unknown property:
%s\n",
- cfile, line, buf);
+ fprintf(stderr,
+ CF ":%d: unknown property: %s\n",
+ cfile, line, buf);
}
fclose(config);
}
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -92,11 +92,12 @@ squoted_print(stream *f, const char *s,
return -1;
while (*s) {
size_t n = noescape ? strcspn(s, "'\"") :
- strcspn(s, "\\'\"\177"
- "\001\002\003\004\005\006\007"
- "\010\011\012\013\014\015\016\017"
- "\020\021\022\023\024\025\026\027"
- "\030\031\032\033\034\035\036\037");
+ strcspn(s,
+ "\\'\"\177"
+ "\001\002\003\004\005\006\007"
+ "\010\011\012\013\014\015\016\017"
+ "\020\021\022\023\024\025\026\027"
+ "\030\031\032\033\034\035\036\037");
if (n > 0 && mnstr_write(f, s, 1, n) < 0)
return -1;
s += n;
@@ -240,7 +241,7 @@ get_schema(Mapi mid)
mapi_close_handle(hdl);
return sname;
-bailout:
+ bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -284,7 +285,7 @@ has_hugeint(Mapi mid)
answer = (int) ret;
return answer;
-bailout:
+ bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -322,7 +323,7 @@ has_schema_max_memory(Mapi mid)
answer = ret;
return ret;
-bailout:
+ bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -362,7 +363,7 @@ has_remote_user_info_table(Mapi mid)
answer = ret;
return ret;
-bailout:
+ bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -385,9 +386,9 @@ has_check_constraint(Mapi mid)
return answer;
if ((hdl = mapi_query(mid,
- "select id from sys.functions"
- " where schema_id = 2000"
- " and name =
'check_constraint'")) == NULL ||
+ "select id from sys.functions"
+ " where schema_id = 2000"
+ " and name = 'check_constraint'")) == NULL ||
mapi_error(mid))
goto bailout;
ret = mapi_get_row_count(hdl) == 1;
@@ -401,7 +402,7 @@ has_check_constraint(Mapi mid)
answer = ret;
return ret;
-bailout:
+ bailout:
if (hdl) {
if (mapi_result_error(hdl))
mapi_explain_result(hdl, stderr);
@@ -437,33 +438,33 @@ dump_foreign_keys(Mapi mid, const char *
goto bailout;
}
snprintf(query, maxquerylen,
- "SELECT ps.name, " /* 0 */
- "pkt.name, " /* 1 */
- "pkkc.name, " /* 2 */
- "fkkc.name, " /* 3 */
- "fkkc.nr, " /* 4 */
- "fkk.name, " /* 5 */
- "fkk.\"action\", " /* 6 */
- "fs.name, " /* 7 */
- "fkt.name " /* 8 */
+ "SELECT ps.name, " /* 0 */
+ " pkt.name, " /* 1 */
+ " pkkc.name, " /* 2 */
+ " fkkc.name, " /* 3 */
+ " fkkc.nr, " /* 4 */
+ " fkk.name, " /* 5 */
+ " fkk.\"action\", " /* 6 */
+ " fs.name, " /* 7 */
+ " fkt.name " /* 8 */
"FROM sys._tables fkt, "
- "sys.objects fkkc, "
- "sys.keys fkk, "
- "sys._tables pkt, "
- "sys.objects pkkc, "
- "sys.keys pkk, "
- "sys.schemas ps, "
- "sys.schemas fs "
+ " sys.objects fkkc, "
+ " sys.keys fkk, "
+ " sys._tables pkt, "
+ " sys.objects pkkc, "
+ " sys.keys pkk, "
+ " sys.schemas ps, "
+ " sys.schemas fs "
"WHERE fkt.id = fkk.table_id "
- "AND pkt.id = pkk.table_id "
- "AND fkk.id = fkkc.id "
- "AND pkk.id = pkkc.id "
- "AND fkk.rkey = pkk.id "
- "AND fkkc.nr = pkkc.nr "
- "AND pkt.schema_id = ps.id "
- "AND fkt.schema_id = fs.id "
- "AND fs.name = '%s' "
- "AND fkt.name = '%s' "
+ " AND pkt.id = pkk.table_id "
+ " AND fkk.id = fkkc.id "
+ " AND pkk.id = pkkc.id "
+ " AND fkk.rkey = pkk.id "
+ " AND fkkc.nr = pkkc.nr "
+ " AND pkt.schema_id = ps.id "
+ " AND fkt.schema_id = fs.id "
+ " AND fs.name = '%s' "
+ " AND fkt.name = '%s' "
"ORDER BY fkk.name, fkkc.nr", s, t);
free(s);
free(t);
@@ -473,60 +474,60 @@ dump_foreign_keys(Mapi mid, const char *
if (query == NULL)
goto bailout;
snprintf(query, maxquerylen,
- "SELECT ps.name, " /* 0 */
- "pkt.name, " /* 1 */
- "pkkc.name, " /* 2 */
- "fkkc.name, " /* 3 */
- "fkkc.nr, " /* 4 */
- "fkk.name, " /* 5 */
- "fkk.\"action\", " /* 6 */
- "0, " /* 7 */
- "fkt.name " /* 8 */
+ "SELECT ps.name, " /* 0 */
+ " pkt.name, " /* 1 */
+ " pkkc.name, " /* 2 */
+ " fkkc.name, " /* 3 */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]