1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

OK, folks, here is the pgindent output.

This commit is contained in:
Bruce Momjian
1998-09-01 04:40:42 +00:00
parent af74855a60
commit fa1a8d6a97
574 changed files with 26509 additions and 24033 deletions

View File

@ -29,7 +29,7 @@ main()
#ifdef DEBUG
FILE *debug;
#endif /* DEBUG */
#endif /* DEBUG */
PGconn *conn;
PGresult *res;
@ -61,7 +61,7 @@ main()
#ifdef DEBUG
debug = fopen("/tmp/trace.out", "w");
PQtrace(conn, debug);
#endif /* DEBUG */
#endif /* DEBUG */
/* start a transaction block */
res = PQexec(conn, "BEGIN");
@ -128,7 +128,7 @@ main()
#ifdef DEBUG
fclose(debug);
#endif /* DEBUG */
#endif /* DEBUG */
exit(0);
}

View File

@ -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 = ' ';
char cp = c,
up = toupper(c),
lo = tolower(c);
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);
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;
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;
}
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);
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;
return 0;
}

View File

@ -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
}