diff options
author | Bruce Momjian | 1998-09-01 04:40:42 +0000 |
---|---|---|
committer | Bruce Momjian | 1998-09-01 04:40:42 +0000 |
commit | fa1a8d6a97068295fe30ac646aec7493a6305bc2 (patch) | |
tree | 645f7cef3c78fbab4d6d7bbc7c9a61ad2893d273 /src/test/locale | |
parent | af74855a608da4cd7ef88ceb2241ec1c75537f39 (diff) |
OK, folks, here is the pgindent output.
Diffstat (limited to 'src/test/locale')
-rw-r--r-- | src/test/locale/test-ctype.c | 69 | ||||
-rw-r--r-- | src/test/locale/test-pgsql-locale.c | 18 |
2 files changed, 50 insertions, 37 deletions
diff --git a/src/test/locale/test-ctype.c b/src/test/locale/test-ctype.c index c16f1710928..93358bf9de4 100644 --- a/src/test/locale/test-ctype.c +++ b/src/test/locale/test-ctype.c @@ -21,45 +21,56 @@ the author shall be liable for any damage, etc. #include <locale.h> #include <ctype.h> -char * flag(int b); -void describe_char(int c); +char *flag(int b); +void describe_char(int c); #undef LONG_FLAG -char * flag(int b) +char * +flag(int b) { #ifdef LONG_FLAG - return b ? "yes" : "no"; + return b ? "yes" : "no"; #else - return b ? "+" : " "; + return b ? "+" : " "; #endif } -void describe_char(int c) +void +describe_char(int c) { - char cp = c, up = toupper(c), lo = tolower(c); - if (!isprint(cp)) cp = ' '; - if (!isprint(up)) up = ' '; - if (!isprint(lo)) lo = ' '; - - printf("chr#%-4d%2c%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%4c%4c\n", c, cp, flag(isalnum(c)), flag(isalpha(c)), flag(iscntrl(c)), flag(isdigit(c)), flag(islower(c)), flag(isgraph(c)), flag(isprint(c)), flag(ispunct(c)), flag(isspace(c)), flag(isupper(c)), flag(isxdigit(c)), lo, up); + char cp = c, + up = toupper(c), + lo = tolower(c); + + if (!isprint(cp)) + cp = ' '; + if (!isprint(up)) + up = ' '; + if (!isprint(lo)) + lo = ' '; + + printf("chr#%-4d%2c%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%6s%4c%4c\n", c, cp, flag(isalnum(c)), flag(isalpha(c)), flag(iscntrl(c)), flag(isdigit(c)), flag(islower(c)), flag(isgraph(c)), flag(isprint(c)), flag(ispunct(c)), flag(isspace(c)), flag(isupper(c)), flag(isxdigit(c)), lo, up); } -int main() { - short c; - char * cur_locale; - - cur_locale = setlocale(LC_ALL, ""); - if (cur_locale) { - fprintf(stderr, "Successfulle set locale to %s\n", cur_locale); - } else { - fprintf(stderr, "Cannot setup locale. Either your libc does not provide\nlocale support, or your locale data is corrupt, or you have not set\nLANG or LC_CTYPE environment variable to proper value. Program aborted.\n"); - return 1; - } - - printf("char# char alnum alpha cntrl digit lower graph print punct space upper xdigit lo up\n"); - for (c = 0; c <= 255; c++) - describe_char(c); - - return 0; +int +main() +{ + short c; + char *cur_locale; + + cur_locale = setlocale(LC_ALL, ""); + if (cur_locale) + fprintf(stderr, "Successfulle set locale to %s\n", cur_locale); + else + { + fprintf(stderr, "Cannot setup locale. Either your libc does not provide\nlocale support, or your locale data is corrupt, or you have not set\nLANG or LC_CTYPE environment variable to proper value. Program aborted.\n"); + return 1; + } + + printf("char# char alnum alpha cntrl digit lower graph print punct space upper xdigit lo up\n"); + for (c = 0; c <= 255; c++) + describe_char(c); + + return 0; } diff --git a/src/test/locale/test-pgsql-locale.c b/src/test/locale/test-pgsql-locale.c index acae1a2aeec..560962a6129 100644 --- a/src/test/locale/test-pgsql-locale.c +++ b/src/test/locale/test-pgsql-locale.c @@ -2,12 +2,14 @@ #include <stdio.h> #include "postgres.h" -int main() { - #ifdef USE_LOCALE - printf("PostgreSQL compiled with locale support\n"); - return 0; - #else - printf("PostgreSQL compiled without locale support\n"); - return 1; - #endif +int +main() +{ +#ifdef USE_LOCALE + printf("PostgreSQL compiled with locale support\n"); + return 0; +#else + printf("PostgreSQL compiled without locale support\n"); + return 1; +#endif } |