mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
OK, folks, here is the pgindent output.
This commit is contained in:
@ -40,7 +40,7 @@
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
|
||||
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
@ -120,10 +120,10 @@ extern "C"
|
||||
static void stripsnug(struct parse * p, struct re_guts * g);
|
||||
static void findmust(struct parse * p, struct re_guts * g);
|
||||
static sopno pluscount(struct parse * p, struct re_guts * g);
|
||||
static int pg_isdigit(int c);
|
||||
static int pg_isalpha(int c);
|
||||
static int pg_isupper(int c);
|
||||
static int pg_islower(int c);
|
||||
static int pg_isdigit(int c);
|
||||
static int pg_isalpha(int c);
|
||||
static int pg_isupper(int c);
|
||||
static int pg_islower(int c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@ -131,7 +131,7 @@ extern "C"
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
|
||||
static pg_wchar nuls[10]; /* place to point scanner in event of
|
||||
static pg_wchar nuls[10]; /* place to point scanner in event of
|
||||
* error */
|
||||
|
||||
/*
|
||||
@ -194,8 +194,10 @@ int cflags;
|
||||
struct parse *p = &pa;
|
||||
int i;
|
||||
size_t len;
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
pg_wchar *wcp;
|
||||
pg_wchar *wcp;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef REDEBUG
|
||||
@ -211,7 +213,7 @@ int cflags;
|
||||
if (cflags & REG_PEND)
|
||||
{
|
||||
#ifdef MULTIBYTE
|
||||
wcp = preg->patsave;
|
||||
wcp = preg->patsave;
|
||||
if (preg->re_endp < wcp)
|
||||
return REG_INVARG;
|
||||
len = preg->re_endp - wcp;
|
||||
@ -221,18 +223,18 @@ int cflags;
|
||||
len = preg->re_endp - pattern;
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
#ifdef MULTIBYTE
|
||||
wcp = (pg_wchar *)malloc((strlen(pattern)+1) * sizeof(pg_wchar));
|
||||
if (wcp == NULL) {
|
||||
return REG_ESPACE;
|
||||
}
|
||||
preg->patsave = wcp;
|
||||
(void)pg_mb2wchar((unsigned char *)pattern,wcp);
|
||||
len = pg_wchar_strlen(wcp);
|
||||
wcp = (pg_wchar *) malloc((strlen(pattern) + 1) * sizeof(pg_wchar));
|
||||
if (wcp == NULL)
|
||||
return REG_ESPACE;
|
||||
preg->patsave = wcp;
|
||||
(void) pg_mb2wchar((unsigned char *) pattern, wcp);
|
||||
len = pg_wchar_strlen(wcp);
|
||||
#else
|
||||
|
||||
len = strlen((char *) pattern);
|
||||
len = strlen((char *) pattern);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -256,7 +258,8 @@ int cflags;
|
||||
#ifdef MULTIBYTE
|
||||
p->next = wcp;
|
||||
#else
|
||||
p->next = (pg_wchar *)pattern; /* convenience; we do not modify it */
|
||||
p->next = (pg_wchar *) pattern; /* convenience; we do not modify
|
||||
* it */
|
||||
#endif
|
||||
p->end = p->next + len;
|
||||
p->error = 0;
|
||||
@ -755,14 +758,16 @@ struct parse *p;
|
||||
{
|
||||
cset *cs = allocset(p);
|
||||
int invert = 0;
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
pg_wchar sp1[] = {'[', ':', '<', ':', ']', ']'};
|
||||
pg_wchar sp2[] = {'[', ':', '>', ':', ']', ']'};
|
||||
pg_wchar sp1[] = {'[', ':', '<', ':', ']', ']'};
|
||||
pg_wchar sp2[] = {'[', ':', '>', ':', ']', ']'};
|
||||
|
||||
#endif
|
||||
|
||||
/* Dept of Truly Sickening Special-Case Kludges */
|
||||
#ifdef MULTIBYTE
|
||||
if (p->next + 5 < p->end && pg_wchar_strncmp(p->next, sp1, 6) == 0)
|
||||
if (p->next + 5 < p->end && pg_wchar_strncmp(p->next, sp1, 6) == 0)
|
||||
#else
|
||||
if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0)
|
||||
#endif
|
||||
@ -772,7 +777,7 @@ struct parse *p;
|
||||
return;
|
||||
}
|
||||
#ifdef MULTIBYTE
|
||||
if (p->next + 5 < p->end && pg_wchar_strncmp(p->next, sp2, 6) == 0)
|
||||
if (p->next + 5 < p->end && pg_wchar_strncmp(p->next, sp2, 6) == 0)
|
||||
#else
|
||||
if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0)
|
||||
#endif
|
||||
@ -847,8 +852,8 @@ p_b_term(p, cs)
|
||||
struct parse *p;
|
||||
cset *cs;
|
||||
{
|
||||
pg_wchar c;
|
||||
pg_wchar start,
|
||||
pg_wchar c;
|
||||
pg_wchar start,
|
||||
finish;
|
||||
int i;
|
||||
|
||||
@ -904,9 +909,8 @@ cset *cs;
|
||||
/* xxx what about signed chars here... */
|
||||
REQUIRE(start <= finish, REG_ERANGE);
|
||||
#ifdef MULTIBYTE
|
||||
if (CHlc(start) != CHlc(finish)) {
|
||||
SETERROR(REG_ERANGE);
|
||||
}
|
||||
if (CHlc(start) != CHlc(finish))
|
||||
SETERROR(REG_ERANGE);
|
||||
#endif
|
||||
for (i = start; i <= finish; i++)
|
||||
CHadd(cs, i);
|
||||
@ -974,11 +978,11 @@ cset *cs;
|
||||
- p_b_symbol - parse a character or [..]ed multicharacter collating symbol
|
||||
== static char p_b_symbol(struct parse *p);
|
||||
*/
|
||||
static pg_wchar /* value of symbol */
|
||||
static pg_wchar /* value of symbol */
|
||||
p_b_symbol(p)
|
||||
struct parse *p;
|
||||
{
|
||||
pg_wchar value;
|
||||
pg_wchar value;
|
||||
|
||||
REQUIRE(MORE(), REG_EBRACK);
|
||||
if (!EATTWO('[', '.'))
|
||||
@ -999,7 +1003,7 @@ p_b_coll_elem(p, endc)
|
||||
struct parse *p;
|
||||
int endc; /* name ended by endc,']' */
|
||||
{
|
||||
pg_wchar *sp = p->next;
|
||||
pg_wchar *sp = p->next;
|
||||
struct cname *cp;
|
||||
int len;
|
||||
|
||||
@ -1019,7 +1023,7 @@ int endc; /* name ended by endc,']' */
|
||||
#endif
|
||||
return cp->code; /* known name */
|
||||
if (len == 1)
|
||||
return *sp; /* single character */
|
||||
return *sp; /* single character */
|
||||
SETERROR(REG_ECOLLATE); /* neither */
|
||||
return 0;
|
||||
}
|
||||
@ -1053,9 +1057,9 @@ bothcases(p, ch)
|
||||
struct parse *p;
|
||||
int ch;
|
||||
{
|
||||
pg_wchar *oldnext = p->next;
|
||||
pg_wchar *oldend = p->end;
|
||||
pg_wchar bracket[3];
|
||||
pg_wchar *oldnext = p->next;
|
||||
pg_wchar *oldend = p->end;
|
||||
pg_wchar bracket[3];
|
||||
|
||||
assert(othercase(ch) != ch);/* p_bracket() would recurse */
|
||||
p->next = bracket;
|
||||
@ -1104,9 +1108,9 @@ static void
|
||||
nonnewline(p)
|
||||
struct parse *p;
|
||||
{
|
||||
pg_wchar *oldnext = p->next;
|
||||
pg_wchar *oldend = p->end;
|
||||
pg_wchar bracket[4];
|
||||
pg_wchar *oldnext = p->next;
|
||||
pg_wchar *oldend = p->end;
|
||||
pg_wchar bracket[4];
|
||||
|
||||
p->next = bracket;
|
||||
p->end = bracket + 3;
|
||||
@ -1733,7 +1737,7 @@ struct re_guts *g;
|
||||
sop *newstart = 0;
|
||||
sopno newlen;
|
||||
sop s;
|
||||
pg_wchar *cp;
|
||||
pg_wchar *cp;
|
||||
sopno i;
|
||||
|
||||
/* avoid making error situations worse */
|
||||
@ -1789,7 +1793,7 @@ struct re_guts *g;
|
||||
|
||||
/* turn it into a character string */
|
||||
#ifdef MULTIBYTE
|
||||
g->must = (pg_wchar *)malloc((size_t) (g->mlen + 1)*sizeof(pg_wchar));
|
||||
g->must = (pg_wchar *) malloc((size_t) (g->mlen + 1) * sizeof(pg_wchar));
|
||||
#else
|
||||
g->must = malloc((size_t) g->mlen + 1);
|
||||
#endif
|
||||
@ -1852,38 +1856,42 @@ struct re_guts *g;
|
||||
/*
|
||||
* some ctype functions with none-ascii-char guard
|
||||
*/
|
||||
static int pg_isdigit(int c)
|
||||
static int
|
||||
pg_isdigit(int c)
|
||||
{
|
||||
#ifdef MULTIBYTE
|
||||
return(c >= 0 && c <= UCHAR_MAX && isdigit(c));
|
||||
return (c >= 0 && c <= UCHAR_MAX && isdigit(c));
|
||||
#else
|
||||
return(isdigit(c));
|
||||
return (isdigit(c));
|
||||
#endif
|
||||
}
|
||||
|
||||
static int pg_isalpha(int c)
|
||||
static int
|
||||
pg_isalpha(int c)
|
||||
{
|
||||
#ifdef MULTIBYTE
|
||||
return(c >= 0 && c <= UCHAR_MAX && isalpha(c));
|
||||
return (c >= 0 && c <= UCHAR_MAX && isalpha(c));
|
||||
#else
|
||||
return(isalpha(c));
|
||||
return (isalpha(c));
|
||||
#endif
|
||||
}
|
||||
|
||||
static int pg_isupper(int c)
|
||||
static int
|
||||
pg_isupper(int c)
|
||||
{
|
||||
#ifdef MULTIBYTE
|
||||
return(c >= 0 && c <= UCHAR_MAX && isupper(c));
|
||||
return (c >= 0 && c <= UCHAR_MAX && isupper(c));
|
||||
#else
|
||||
return(isupper(c));
|
||||
return (isupper(c));
|
||||
#endif
|
||||
}
|
||||
|
||||
static int pg_islower(int c)
|
||||
static int
|
||||
pg_islower(int c)
|
||||
{
|
||||
#ifdef MULTIBYTE
|
||||
return(c >= 0 && c <= UCHAR_MAX && islower(c));
|
||||
return (c >= 0 && c <= UCHAR_MAX && islower(c));
|
||||
#else
|
||||
return(islower(c));
|
||||
return (islower(c));
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user