Commit f99a569a authored by Bruce Momjian's avatar Bruce Momjian

pgindent run for 8.2.

parent 451e419e
......@@ -8,7 +8,7 @@
* Author: Andreas Pflug <pgadmin@pse-consulting.de>
*
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/adminpack/adminpack.c,v 1.3 2006/07/11 16:35:30 momjian Exp $
* $PostgreSQL: pgsql/contrib/adminpack/adminpack.c,v 1.4 2006/10/04 00:29:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -35,7 +35,6 @@
#ifdef unlink
#undef unlink
#endif
#endif
extern DLLIMPORT char *DataDir;
......@@ -68,13 +67,14 @@ typedef struct
* Return an absolute path. Argument may be absolute or
* relative to the DataDir.
*/
static char *absClusterPath(text *arg, bool logAllowed)
static char *
absClusterPath(text *arg, bool logAllowed)
{
char *filename;
int len=VARSIZE(arg) - VARHDRSZ;
int len = VARSIZE(arg) - VARHDRSZ;
int dlen = strlen(DataDir);
filename = palloc(len+1);
filename = palloc(len + 1);
memcpy(filename, VARDATA(arg), len);
filename[len] = 0;
......@@ -96,7 +96,8 @@ static char *absClusterPath(text *arg, bool logAllowed)
}
else
{
char *absname = palloc(dlen+len+2);
char *absname = palloc(dlen + len + 2);
sprintf(absname, "%s/%s", DataDir, filename);
pfree(filename);
return absname;
......@@ -122,7 +123,8 @@ requireSuperuser(void)
* generic file handling functions
*/
Datum pg_file_write(PG_FUNCTION_ARGS)
Datum
pg_file_write(PG_FUNCTION_ARGS)
{
FILE *f;
char *filename;
......@@ -137,6 +139,7 @@ Datum pg_file_write(PG_FUNCTION_ARGS)
if (PG_ARGISNULL(2) || !PG_GETARG_BOOL(2))
{
struct stat fst;
if (stat(filename, &fst) >= 0)
ereport(ERROR,
(ERRCODE_DUPLICATE_FILE,
......@@ -169,9 +172,12 @@ Datum pg_file_write(PG_FUNCTION_ARGS)
}
Datum pg_file_rename(PG_FUNCTION_ARGS)
Datum
pg_file_rename(PG_FUNCTION_ARGS)
{
char *fn1, *fn2, *fn3;
char *fn1,
*fn2,
*fn3;
int rc;
requireSuperuser();
......@@ -179,12 +185,12 @@ Datum pg_file_rename(PG_FUNCTION_ARGS)
if (PG_ARGISNULL(0) || PG_ARGISNULL(1))
PG_RETURN_NULL();
fn1=absClusterPath(PG_GETARG_TEXT_P(0), false);
fn2=absClusterPath(PG_GETARG_TEXT_P(1), false);
fn1 = absClusterPath(PG_GETARG_TEXT_P(0), false);
fn2 = absClusterPath(PG_GETARG_TEXT_P(1), false);
if (PG_ARGISNULL(2))
fn3=0;
fn3 = 0;
else
fn3=absClusterPath(PG_GETARG_TEXT_P(2), false);
fn3 = absClusterPath(PG_GETARG_TEXT_P(2), false);
if (access(fn1, W_OK) < 0)
{
......@@ -256,7 +262,8 @@ Datum pg_file_rename(PG_FUNCTION_ARGS)
}
Datum pg_file_unlink(PG_FUNCTION_ARGS)
Datum
pg_file_unlink(PG_FUNCTION_ARGS)
{
char *filename;
......@@ -287,7 +294,8 @@ Datum pg_file_unlink(PG_FUNCTION_ARGS)
}
Datum pg_logdir_ls(PG_FUNCTION_ARGS)
Datum
pg_logdir_ls(PG_FUNCTION_ARGS)
{
FuncCallContext *funcctx;
struct dirent *de;
......@@ -308,7 +316,7 @@ Datum pg_logdir_ls(PG_FUNCTION_ARGS)
MemoryContext oldcontext;
TupleDesc tupdesc;
funcctx=SRF_FIRSTCALL_INIT();
funcctx = SRF_FIRSTCALL_INIT();
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
fctx = palloc(sizeof(directory_fctx));
......@@ -316,7 +324,7 @@ Datum pg_logdir_ls(PG_FUNCTION_ARGS)
fctx->location = Log_directory;
else
{
fctx->location = palloc(strlen(DataDir) + strlen(Log_directory) +2);
fctx->location = palloc(strlen(DataDir) + strlen(Log_directory) + 2);
sprintf(fctx->location, "%s/%s", DataDir, Log_directory);
}
tupdesc = CreateTemplateTupleDesc(2, false);
......@@ -338,8 +346,8 @@ Datum pg_logdir_ls(PG_FUNCTION_ARGS)
MemoryContextSwitchTo(oldcontext);
}
funcctx=SRF_PERCALL_SETUP();
fctx = (directory_fctx*) funcctx->user_fctx;
funcctx = SRF_PERCALL_SETUP();
fctx = (directory_fctx *) funcctx->user_fctx;
if (!fctx->dirdesc) /* not a readable directory */
SRF_RETURN_DONE(funcctx);
......@@ -352,14 +360,14 @@ Datum pg_logdir_ls(PG_FUNCTION_ARGS)
char *field[MAXDATEFIELDS];
char lowstr[MAXDATELEN + 1];
int dtype;
int nf, ftype[MAXDATEFIELDS];
int nf,
ftype[MAXDATEFIELDS];
fsec_t fsec;
int tz = 0;
struct pg_tm date;
/*
* Default format:
* postgresql-YYYY-MM-DD_HHMMSS.log
* Default format: postgresql-YYYY-MM-DD_HHMMSS.log
*/
if (strlen(de->d_name) != 32
|| memcmp(de->d_name, "postgresql-", 11)
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
* Darko Prenosil <Darko.Prenosil@finteh.hr>
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
*
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.58 2006/09/02 21:11:15 joe Exp $
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.59 2006/10/04 00:29:44 momjian Exp $
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
......@@ -362,11 +362,11 @@ dblink_open(PG_FUNCTION_ARGS)
DBLINK_RES_INTERNALERROR("begin error");
PQclear(res);
rconn->newXactForCursor = TRUE;
/*
* Since transaction state was IDLE, we force cursor count to
* initially be 0. This is needed as a previous ABORT might
* have wiped out our transaction without maintaining the
* cursor count for us.
* initially be 0. This is needed as a previous ABORT might have wiped
* out our transaction without maintaining the cursor count for us.
*/
rconn->openCursorCount = 0;
}
......@@ -850,8 +850,8 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async, bool do_get)
TEXTOID, -1, 0);
/*
* and save a copy of the command status string to return as our
* result tuple
* and save a copy of the command status string to return as
* our result tuple
*/
sql_cmd_status = PQcmdStatus(res);
funcctx->max_calls = 1;
......@@ -891,7 +891,10 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async, bool do_get)
tupdesc = CreateTupleDescCopy(tupdesc);
}
/* check result and tuple descriptor have the same number of columns */
/*
* check result and tuple descriptor have the same number of
* columns
*/
if (PQnfields(res) != tupdesc->natts)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
......
......@@ -11,7 +11,8 @@
#include "storage/bufpage.h"
typedef struct {
typedef struct
{
uint16 keylen;
uint16 vallen;
uint32
......@@ -20,7 +21,8 @@ typedef struct {
} HEntry;
typedef struct {
typedef struct
{
int4 len;
int4 size;
char data[1];
......@@ -34,7 +36,8 @@ typedef struct {
#define PG_GETARG_HS(x) ((HStore*)PG_DETOAST_DATUM(PG_GETARG_DATUM(x)))
typedef struct {
typedef struct
{
char *key;
char *val;
uint16 keylen;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -232,7 +232,7 @@ typedef struct
* is there value 'val' in array or not ?
*/
static bool
checkcondition_arr(void *checkval, ITEM *item)
checkcondition_arr(void *checkval, ITEM * item)
{
int4 *StopLow = ((CHKVAL *) checkval)->arrb;
int4 *StopHigh = ((CHKVAL *) checkval)->arre;
......@@ -254,7 +254,7 @@ checkcondition_arr(void *checkval, ITEM *item)
}
static bool
checkcondition_bit(void *checkval, ITEM *item)
checkcondition_bit(void *checkval, ITEM * item)
{
return GETBIT(checkval, HASHVAL(item->val));
}
......@@ -263,7 +263,7 @@ checkcondition_bit(void *checkval, ITEM *item)
* check for boolean condition
*/
static bool
execute(ITEM * curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM *item))
execute(ITEM * curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM * item))
{
if (curitem->type == VAL)
......@@ -319,32 +319,36 @@ execconsistent(QUERYTYPE * query, ArrayType *array, bool calcnot)
);
}
typedef struct {
typedef struct
{
ITEM *first;
bool *mapped_check;
} GinChkVal;
static bool
checkcondition_gin(void *checkval, ITEM *item) {
GinChkVal *gcv = (GinChkVal*)checkval;
checkcondition_gin(void *checkval, ITEM * item)
{
GinChkVal *gcv = (GinChkVal *) checkval;
return gcv->mapped_check[ item - gcv->first ];
return gcv->mapped_check[item - gcv->first];
}
bool
ginconsistent(QUERYTYPE * query, bool *check) {
ginconsistent(QUERYTYPE * query, bool *check)
{
GinChkVal gcv;
ITEM *items = GETQUERY(query);
int i, j=0;
int i,
j = 0;
if ( query->size < 0 )
if (query->size < 0)
return FALSE;
gcv.first = items;
gcv.mapped_check = (bool*)palloc( sizeof(bool)*query->size );
for(i=0; i<query->size; i++)
if ( items[i].type == VAL )
gcv.mapped_check[ i ] = check[ j++ ];
gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);
for (i = 0; i < query->size; i++)
if (items[i].type == VAL)
gcv.mapped_check[i] = check[j++];
return execute(
GETQUERY(query) + query->size - 1,
......
......@@ -4,68 +4,79 @@ PG_FUNCTION_INFO_V1(ginint4_queryextract);
Datum ginint4_queryextract(PG_FUNCTION_ARGS);
Datum
ginint4_queryextract(PG_FUNCTION_ARGS) {
uint32 *nentries = (uint32*)PG_GETARG_POINTER(1);
ginint4_queryextract(PG_FUNCTION_ARGS)
{
uint32 *nentries = (uint32 *) PG_GETARG_POINTER(1);
StrategyNumber strategy = PG_GETARG_UINT16(2);
Datum *res = NULL;
*nentries = 0;
if ( strategy == BooleanSearchStrategy ) {
QUERYTYPE *query = (QUERYTYPE*)PG_DETOAST_DATUM_COPY(PG_GETARG_POINTER(0));
if (strategy == BooleanSearchStrategy)
{
QUERYTYPE *query = (QUERYTYPE *) PG_DETOAST_DATUM_COPY(PG_GETARG_POINTER(0));
ITEM *items = GETQUERY(query);
int i;
if (query->size == 0)
PG_RETURN_POINTER(NULL);
if ( shorterquery(items, query->size) == 0 )
elog(ERROR,"Query requires full scan, GIN doesn't support it");
if (shorterquery(items, query->size) == 0)
elog(ERROR, "Query requires full scan, GIN doesn't support it");
pfree( query );
pfree(query);
query = (QUERYTYPE*)PG_DETOAST_DATUM(PG_GETARG_POINTER(0));
query = (QUERYTYPE *) PG_DETOAST_DATUM(PG_GETARG_POINTER(0));
items = GETQUERY(query);
res = (Datum*)palloc(sizeof(Datum) * query->size);
res = (Datum *) palloc(sizeof(Datum) * query->size);
*nentries = 0;
for(i=0;i<query->size;i++)
if ( items[i].type == VAL ) {
res[*nentries] = Int32GetDatum( items[i].val );
for (i = 0; i < query->size; i++)
if (items[i].type == VAL)
{
res[*nentries] = Int32GetDatum(items[i].val);
(*nentries)++;
}
} else {
}
else
{
ArrayType *query = PG_GETARG_ARRAYTYPE_P(0);
int4 *arr;
uint32 i;
CHECKARRVALID(query);
*nentries=ARRNELEMS(query);
if ( *nentries > 0 ) {
res = (Datum*)palloc(sizeof(Datum) * (*nentries));
arr=ARRPTR(query);
for(i=0;i<*nentries;i++)
res[i] = Int32GetDatum( arr[i] );
*nentries = ARRNELEMS(query);
if (*nentries > 0)
{
res = (Datum *) palloc(sizeof(Datum) * (*nentries));
arr = ARRPTR(query);
for (i = 0; i < *nentries; i++)
res[i] = Int32GetDatum(arr[i]);
}
}
PG_RETURN_POINTER( res );
PG_RETURN_POINTER(res);
}
PG_FUNCTION_INFO_V1(ginint4_consistent);
Datum ginint4_consistent(PG_FUNCTION_ARGS);
Datum
ginint4_consistent(PG_FUNCTION_ARGS) {
bool *check = (bool*)PG_GETARG_POINTER(0);
ginint4_consistent(PG_FUNCTION_ARGS)
{
bool *check = (bool *) PG_GETARG_POINTER(0);
StrategyNumber strategy = PG_GETARG_UINT16(1);
int res=FALSE;
int res = FALSE;
/* we can do not check array carefully, it's done by previous ginarrayextract call */
/*
* we can do not check array carefully, it's done by previous
* ginarrayextract call
*/
switch( strategy ) {
switch (strategy)
{
case RTOverlapStrategyNumber:
case RTContainedByStrategyNumber:
case RTOldContainedByStrategyNumber:
......@@ -77,22 +88,27 @@ ginint4_consistent(PG_FUNCTION_ARGS) {
case RTContainsStrategyNumber:
case RTOldContainsStrategyNumber:
res = TRUE;
do {
do
{
ArrayType *query = PG_GETARG_ARRAYTYPE_P(2);
int i, nentries=ARRNELEMS(query);
int i,
nentries = ARRNELEMS(query);
for(i=0;i<nentries;i++)
if ( !check[i] ) {
for (i = 0; i < nentries; i++)
if (!check[i])
{
res = FALSE;
break;
}
} while(0);
} while (0);
break;
case BooleanSearchStrategy:
do {
QUERYTYPE *query = (QUERYTYPE*)PG_DETOAST_DATUM(PG_GETARG_POINTER(2));
res = ginconsistent( query, check );
} while(0);
do
{
QUERYTYPE *query = (QUERYTYPE *) PG_DETOAST_DATUM(PG_GETARG_POINTER(2));
res = ginconsistent(query, check);
} while (0);
break;
default:
elog(ERROR, "ginint4_consistent: unknown strategy number: %d", strategy);
......
......@@ -36,19 +36,21 @@ g_int_consistent(PG_FUNCTION_ARGS)
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
bool retval;
if (strategy == BooleanSearchStrategy) {
if (strategy == BooleanSearchStrategy)
{
retval = execconsistent((QUERYTYPE *) query,
(ArrayType *) DatumGetPointer(entry->key),
GIST_LEAF(entry));
pfree( query );
pfree(query);
PG_RETURN_BOOL(retval);
}
/* sort query for fast search, key is already sorted */
CHECKARRVALID(query);
if (ARRISVOID(query)) {
pfree( query );
if (ARRISVOID(query))
{
pfree(query);
PG_RETURN_BOOL(false);
}
PREPAREARR(query);
......@@ -88,7 +90,7 @@ g_int_consistent(PG_FUNCTION_ARGS)
default:
retval = FALSE;
}
pfree( query );
pfree(query);
PG_RETURN_BOOL(retval);
}
......
......@@ -93,18 +93,23 @@ inner_int_union(ArrayType *a, ArrayType *b)
nb = ARRNELEMS(b);
int *da = ARRPTR(a),
*db = ARRPTR(b);
int i,j, *dr;
int i,
j,
*dr;
r = new_intArrayType(na + nb);
dr = ARRPTR(r);
/* union */
i = j = 0;
while (i < na && j < nb) {
if (da[i] == db[j]) {
while (i < na && j < nb)
{
if (da[i] == db[j])
{
*dr++ = da[i++];
j++;
} else if (da[i] < db[j])
}
else if (da[i] < db[j])
*dr++ = da[i++];
else
*dr++ = db[j++];
......@@ -115,7 +120,7 @@ inner_int_union(ArrayType *a, ArrayType *b)
while (j < nb)
*dr++ = db[j++];
r = resize_intArrayType(r, dr-ARRPTR(r));
r = resize_intArrayType(r, dr - ARRPTR(r));
}
if (ARRNELEMS(r) > 1)
......
......@@ -506,16 +506,17 @@ g_intbig_consistent(PG_FUNCTION_ARGS)
if (strategy == BooleanSearchStrategy)
{
retval =signconsistent((QUERYTYPE *) query,
retval = signconsistent((QUERYTYPE *) query,
GETSIGN(DatumGetPointer(entry->key)),
false);
PG_FREE_IF_COPY( query, 1 );
PG_FREE_IF_COPY(query, 1);
PG_RETURN_BOOL(retval);
}
CHECKARRVALID(query);
if (ARRISVOID(query)) {
PG_FREE_IF_COPY( query, 1 );
if (ARRISVOID(query))
{
PG_FREE_IF_COPY(query, 1);
PG_RETURN_BOOL(FALSE);
}
......@@ -602,6 +603,6 @@ g_intbig_consistent(PG_FUNCTION_ARGS)
default:
retval = FALSE;
}
PG_FREE_IF_COPY( query, 1 );
PG_FREE_IF_COPY(query, 1);
PG_RETURN_BOOL(retval);
}
......@@ -6,7 +6,7 @@
* http://www.gs1.org/productssolutions/idkeys/support/prefix_list.html
*
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/isn/EAN13.h,v 1.1 2006/09/09 04:07:52 tgl Exp $
* $PostgreSQL: pgsql/contrib/isn/EAN13.h,v 1.2 2006/10/04 00:29:45 momjian Exp $
*
*/
......@@ -139,7 +139,8 @@ const char *EAN13_range[][2] = {
{"958", "958"}, /* GS1 Macau */
{"977", "977"}, /* Serial publications (ISSN) */
{"978", "978"}, /* Bookland (ISBN) */
{"979", "979"}, /* International Standard Music Number (ISMN) and ISBN contingent */
{"979", "979"}, /* International Standard Music Number (ISMN)
* and ISBN contingent */
{"980", "980"}, /* Refund receipts */
{"981", "982"}, /* Common Currency Coupons */
{"990", "999"}, /* Coupons */
......
......@@ -7,7 +7,7 @@
* http://www.isbn.org/
*
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/isn/ISBN.h,v 1.1 2006/09/09 04:07:52 tgl Exp $
* $PostgreSQL: pgsql/contrib/isn/ISBN.h,v 1.2 2006/10/04 00:29:45 momjian Exp $
*
* 0-393-04002-X => 039304002(X) <=> 039304002 <=> (978)039304002 <=> 978039304002(9) <=> 978-0-393-04002-9
*
......
......@@ -6,7 +6,7 @@
* http://www.ismn-international.org
*
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/isn/ISMN.h,v 1.1 2006/09/09 04:07:52 tgl Exp $
* $PostgreSQL: pgsql/contrib/isn/ISMN.h,v 1.2 2006/10/04 00:29:45 momjian Exp $
*
* M-3452-4680-5 <=> (0)-3452-4680-5 <=> 0345246805 <=> 9790345246805 <=> 979-0-3452-4680-5
*
......
......@@ -6,7 +6,7 @@
* http://www.issn.org/
*
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/isn/ISSN.h,v 1.1 2006/09/09 04:07:52 tgl Exp $
* $PostgreSQL: pgsql/contrib/isn/ISSN.h,v 1.2 2006/10/04 00:29:45 momjian Exp $
*
* 1144-875X <=> 1144875(X) <=> 1144875 <=> (977)1144875 <=> 9771144875(00) <=> 977114487500(7) <=> 977-1144-875-00-7
*
......
......@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/contrib/isn/UPC.h,v 1.1 2006/09/09 04:07:52 tgl Exp $
* $PostgreSQL: pgsql/contrib/isn/UPC.h,v 1.2 2006/10/04 00:29:45 momjian Exp $
*
*/
......
This diff is collapsed.
......@@ -580,6 +580,6 @@ _ltree_consistent(PG_FUNCTION_ARGS)
/* internal error */
elog(ERROR, "unrecognized StrategyNumber: %d", strategy);
}
PG_FREE_IF_COPY(query,1);
PG_FREE_IF_COPY(query, 1);
PG_RETURN_BOOL(res);
}
/*
* op function for ltree and lquery
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.10 2006/03/11 04:38:29 momjian Exp $
* $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.11 2006/10/04 00:29:45 momjian Exp $
*/
#include "ltree.h"
......@@ -46,7 +46,7 @@ getlexeme(char *start, char *end, int *len)
}
bool
compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
{
char *endt = t->name + t->len;
char *endq = qn + len;
......
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.16 2006/07/11 16:00:44 teodor Exp $ */
/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.17 2006/10/04 00:29:45 momjian Exp $ */
#ifndef __LTREE_H__
#define __LTREE_H__
......
/*
* GiST support for ltree
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.18 2006/08/08 15:45:18 teodor Exp $
* $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.19 2006/10/04 00:29:45 momjian Exp $
*/
#include "ltree.h"
......@@ -457,8 +457,10 @@ gist_isparent(ltree_gist * key, ltree * query)
}
static ltree *
copy_ltree( ltree *src ) {
ltree *dst = (ltree*)palloc(src->len);
copy_ltree(ltree * src)
{
ltree *dst = (ltree *) palloc(src->len);
memcpy(dst, src, src->len);
return dst;
}
......@@ -711,6 +713,6 @@ ltree_consistent(PG_FUNCTION_ARGS)
elog(ERROR, "unrecognized StrategyNumber: %d", strategy);
}
PG_FREE_IF_COPY(query,1);
PG_FREE_IF_COPY(query, 1);
PG_RETURN_BOOL(res);
}
/*
* op function for ltree
* Teodor Sigaev <teodor@stack.net>
* $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.13 2006/09/20 19:50:21 tgl Exp $
* $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.14 2006/10/04 00:29:45 momjian Exp $
*/
#include "ltree.h"
......@@ -620,8 +620,8 @@ ltreeparentsel(PG_FUNCTION_ARGS)
/*
* If the histogram is large enough, see what fraction of it the
* constant is "<@" to, and assume that's representative of the
* non-MCV population. Otherwise use the default selectivity for
* the non-MCV population.
* non-MCV population. Otherwise use the default selectivity for the
* non-MCV population.
*/
selec = histogram_selectivity(&vardata, &contproc,
constval, varonleft,
......
......@@ -3,7 +3,7 @@
* pg_buffercache_pages.c
* display some contents of the buffer cache
*
* $PostgreSQL: pgsql/contrib/pg_buffercache/pg_buffercache_pages.c,v 1.8 2006/07/23 03:07:57 tgl Exp $
* $PostgreSQL: pgsql/contrib/pg_buffercache/pg_buffercache_pages.c,v 1.9 2006/10/04 00:29:45 momjian Exp $
*-------------------------------------------------------------------------
*/
#include "postgres.h"
......@@ -123,9 +123,9 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
MemoryContextSwitchTo(oldcontext);
/*
* To get a consistent picture of the buffer state, we must lock
* all partitions of the buffer map. Needless to say, this is
* horrible for concurrency...
* To get a consistent picture of the buffer state, we must lock all
* partitions of the buffer map. Needless to say, this is horrible
* for concurrency...
*/
for (i = 0; i < NUM_BUFFER_PARTITIONS; i++)
LWLockAcquire(FirstBufMappingLock + i, LW_SHARED);
......
......@@ -3,7 +3,7 @@
* pg_freespacemap.c
* display some contents of the free space relation and page maps.
*
* $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.7 2006/09/21 20:31:21 tgl Exp $
* $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.8 2006/10/04 00:29:45 momjian Exp $
*-------------------------------------------------------------------------
*/
#include "postgres.h"
......@@ -138,8 +138,8 @@ pg_freespacemap_pages(PG_FUNCTION_ARGS)
fctx->tupdesc = BlessTupleDesc(tupledesc);
/*
* Allocate numPages worth of FreeSpacePagesRec records, this is
* an upper bound.
* Allocate numPages worth of FreeSpacePagesRec records, this is an
* upper bound.
*/
fctx->record = (FreeSpacePagesRec *) palloc(sizeof(FreeSpacePagesRec) * numPages);
......@@ -147,8 +147,8 @@ pg_freespacemap_pages(PG_FUNCTION_ARGS)
MemoryContextSwitchTo(oldcontext);
/*
* Lock free space map and scan though all the relations.
* For each relation, gets all its mapped pages.
* Lock free space map and scan though all the relations. For each
* relation, gets all its mapped pages.
*/
LWLockAcquire(FreeSpaceLock, LW_EXCLUSIVE);
......@@ -313,8 +313,8 @@ pg_freespacemap_relations(PG_FUNCTION_ARGS)
fctx->tupdesc = BlessTupleDesc(tupledesc);
/*
* Allocate numRelations worth of FreeSpaceRelationsRec records,
* this is also an upper bound.
* Allocate numRelations worth of FreeSpaceRelationsRec records, this
* is also an upper bound.
*/
fctx->record = (FreeSpaceRelationsRec *) palloc(sizeof(FreeSpaceRelationsRec) * numRelations);
......@@ -333,7 +333,7 @@ pg_freespacemap_relations(PG_FUNCTION_ARGS)
fctx->record[i].reltablespace = fsmrel->key.spcNode;
fctx->record[i].reldatabase = fsmrel->key.dbNode;
fctx->record[i].relfilenode = fsmrel->key.relNode;
fctx->record[i].avgrequest = (int64)fsmrel->avgRequest;
fctx->record[i].avgrequest = (int64) fsmrel->avgRequest;
fctx->record[i].interestingpages = fsmrel->interestingPages;
fctx->record[i].storedpages = fsmrel->storedPages;
fctx->record[i].nextpage = fsmrel->nextPage;
......@@ -368,6 +368,7 @@ pg_freespacemap_relations(PG_FUNCTION_ARGS)
nulls[1] = false;
values[2] = ObjectIdGetDatum(record->relfilenode);
nulls[2] = false;
/*
* avgrequest isn't meaningful for an index
*/
......
/*
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.55 2006/09/16 13:31:40 tgl Exp $
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.56 2006/10/04 00:29:45 momjian Exp $
*
* pgbench: a simple benchmark program for PostgreSQL
* written by Tatsuo Ishii
......@@ -1009,14 +1009,16 @@ process_file(char *filename)
while (isspace((unsigned char) buf[i]))
i++;
if (buf[i] != '\0' && strncmp(&buf[i], "--", 2) != 0) {
if (buf[i] != '\0' && strncmp(&buf[i], "--", 2) != 0)
{
commands = process_commands(&buf[i]);
if (commands == NULL)
{
fclose(fd);
return false;
}
} else
}
else
continue;
my_commands[lineno] = commands;
......
......@@ -2,7 +2,7 @@
* Written by Solar Designer and placed in the public domain.
* See crypt_blowfish.c for more information.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-gensalt.c,v 1.9 2006/07/13 04:15:24 neilc Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-gensalt.c,v 1.10 2006/10/04 00:29:46 momjian Exp $
*
* This file contains salt generation functions for the traditional and
* other common crypt(3) algorithms, except for bcrypt which is defined
......@@ -64,9 +64,9 @@ _crypt_gensalt_extended_rn(unsigned long count,
output[2] = _crypt_itoa64[(count >> 6) & 0x3f];
output[3] = _crypt_itoa64[(count >> 12) & 0x3f];
output[4] = _crypt_itoa64[(count >> 18) & 0x3f];
value = (unsigned long)(unsigned char) input[0] |
((unsigned long)(unsigned char) input[1] << 8) |
((unsigned long)(unsigned char) input[2] << 16);
value = (unsigned long) (unsigned char) input[0] |
((unsigned long) (unsigned char) input[1] << 8) |
((unsigned long) (unsigned char) input[2] << 16);
output[5] = _crypt_itoa64[value & 0x3f];
output[6] = _crypt_itoa64[(value >> 6) & 0x3f];
output[7] = _crypt_itoa64[(value >> 12) & 0x3f];
......@@ -92,9 +92,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
output[0] = '$';
output[1] = '1';
output[2] = '$';
value = (unsigned long)(unsigned char) input[0] |
((unsigned long)(unsigned char) input[1] << 8) |
((unsigned long)(unsigned char) input[2] << 16);
value = (unsigned long) (unsigned char) input[0] |
((unsigned long) (unsigned char) input[1] << 8) |
((unsigned long) (unsigned char) input[2] << 16);
output[3] = _crypt_itoa64[value & 0x3f];
output[4] = _crypt_itoa64[(value >> 6) & 0x3f];
output[5] = _crypt_itoa64[(value >> 12) & 0x3f];
......@@ -103,9 +103,9 @@ _crypt_gensalt_md5_rn(unsigned long count,
if (size >= 6 && output_size >= 3 + 4 + 4 + 1)
{
value = (unsigned long)(unsigned char) input[3] |
((unsigned long)(unsigned char) input[4] << 8) |
((unsigned long)(unsigned char) input[5] << 16);
value = (unsigned long) (unsigned char) input[3] |
((unsigned long) (unsigned char) input[4] << 8) |
((unsigned long) (unsigned char) input[5] << 16);
output[7] = _crypt_itoa64[value & 0x3f];
output[8] = _crypt_itoa64[(value >> 6) & 0x3f];
output[9] = _crypt_itoa64[(value >> 12) & 0x3f];
......
......@@ -8,7 +8,7 @@
*
* $FreeBSD: src/lib/libcrypt/crypt-md5.c,v 1.5 1999/12/17 20:21:45 peter Exp $
*
* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-md5.c,v 1.7 2006/07/13 04:15:24 neilc Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-md5.c,v 1.8 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......
......@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.c,v 1.7 2006/07/13 04:15:24 neilc Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.c,v 1.8 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......
This diff is collapsed.
......@@ -26,7 +26,7 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.h,v 1.4 2006/07/19 17:05:50 neilc Exp $ */
/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.h,v 1.5 2006/10/04 00:29:46 momjian Exp $ */
#ifndef IMATH_H_
#define IMATH_H_
......@@ -39,19 +39,23 @@
typedef unsigned char mp_sign;
typedef unsigned int mp_size;
typedef int mp_result;
#ifdef USE_LONG_LONG
typedef uint32 mp_digit;
typedef uint64 mp_word;
#define MP_DIGIT_MAX 0xFFFFFFFFULL
#define MP_WORD_MAX 0xFFFFFFFFFFFFFFFFULL
#else
typedef uint16 mp_digit;
typedef uint32 mp_word;
#define MP_DIGIT_MAX 0xFFFFUL
#define MP_WORD_MAX 0xFFFFFFFFUL
#endif
typedef struct mpz {
typedef struct mpz
{
mp_digit *digits;
mp_size alloc;
mp_size used;
......@@ -111,13 +115,17 @@ mp_result mp_int_mul(mp_int a, mp_int b, mp_int c); /* c = a * b */
mp_result mp_int_mul_value(mp_int a, int value, mp_int c);
mp_result mp_int_mul_pow2(mp_int a, int p2, mp_int c);
mp_result mp_int_sqr(mp_int a, mp_int c); /* c = a * a */
mp_result mp_int_div(mp_int a, mp_int b, /* q = a / b */
mp_result
mp_int_div(mp_int a, mp_int b, /* q = a / b */
mp_int q, mp_int r); /* r = a % b */
mp_result mp_int_div_value(mp_int a, int value, /* q = a / value */
mp_result
mp_int_div_value(mp_int a, int value, /* q = a / value */
mp_int q, int *r); /* r = a % value */
mp_result mp_int_div_pow2(mp_int a, int p2, /* q = a / 2^p2 */
mp_result
mp_int_div_pow2(mp_int a, int p2, /* q = a / 2^p2 */
mp_int q, mp_int r); /* r = q % 2^p2 */
mp_result mp_int_mod(mp_int a, mp_int m, mp_int c); /* c = a % m */
#define mp_int_mod_value(A, V, R) mp_int_div_value((A), (V), 0, (R))
mp_result mp_int_expt(mp_int a, int b, mp_int c); /* c = a^b */
mp_result mp_int_expt_value(int a, int b, mp_int c); /* c = a^b */
......@@ -133,13 +141,17 @@ int mp_int_divisible_value(mp_int a, int v);
/* Returns k >= 0 such that z = 2^k, if one exists; otherwise < 0 */
int mp_int_is_pow2(mp_int z);
mp_result mp_int_exptmod(mp_int a, mp_int b, mp_int m,
mp_result
mp_int_exptmod(mp_int a, mp_int b, mp_int m,
mp_int c); /* c = a^b (mod m) */
mp_result mp_int_exptmod_evalue(mp_int a, int value,
mp_result
mp_int_exptmod_evalue(mp_int a, int value,
mp_int m, mp_int c); /* c = a^v (mod m) */
mp_result mp_int_exptmod_bvalue(int value, mp_int b,
mp_result
mp_int_exptmod_bvalue(int value, mp_int b,
mp_int m, mp_int c); /* c = v^b (mod m) */
mp_result mp_int_exptmod_known(mp_int a, mp_int b,
mp_result
mp_int_exptmod_known(mp_int a, mp_int b,
mp_int m, mp_int mu,
mp_int c); /* c = a^b (mod m) */
mp_result mp_int_redux_const(mp_int m, mp_int c);
......@@ -148,7 +160,8 @@ mp_result mp_int_invmod(mp_int a, mp_int m, mp_int c); /* c = 1/a (mod m) */
mp_result mp_int_gcd(mp_int a, mp_int b, mp_int c); /* c = gcd(a, b) */
mp_result mp_int_egcd(mp_int a, mp_int b, mp_int c, /* c = gcd(a, b) */
mp_result
mp_int_egcd(mp_int a, mp_int b, mp_int c, /* c = gcd(a, b) */
mp_int x, mp_int y); /* c = ax + by */
mp_result mp_int_sqrt(mp_int a, mp_int c); /* c = floor(sqrt(q)) */
......@@ -196,7 +209,7 @@ const char *mp_error_string(mp_result res);
#if 0
void s_print(char *tag, mp_int z);
void s_print_buf(char *tag, mp_digit *buf, mp_size num);
void s_print_buf(char *tag, mp_digit * buf, mp_size num);
#endif
#endif /* end IMATH_H_ */
......@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/internal-sha2.c,v 1.1 2006/07/13 04:15:24 neilc Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/internal-sha2.c,v 1.2 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......@@ -314,4 +314,3 @@ init_sha512(PX_MD * md)
md->reset(md);
}
......@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.24 2006/07/13 04:15:24 neilc Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.25 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......
......@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.29 2006/09/05 23:02:28 tgl Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.30 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......@@ -58,7 +58,6 @@
*/
#include <openssl/aes.h>
#else /* old OPENSSL */
/*
......@@ -121,29 +120,32 @@
* Emulate newer digest API.
*/
static void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
static void
EVP_MD_CTX_init(EVP_MD_CTX *ctx)
{
memset(ctx, 0, sizeof(*ctx));
}
static int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
static int
EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
{
memset(ctx, 0, sizeof(*ctx));
return 1;
}
static int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *md, void *engine)
static int
EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *md, void *engine)
{
EVP_DigestInit(ctx, md);
return 1;
}
static int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *res, unsigned int *len)
static int
EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *res, unsigned int *len)
{
EVP_DigestFinal(ctx, res, len);
return 1;
}
#endif /* old OpenSSL */
/*
......@@ -154,9 +156,10 @@ static int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *res, unsigned int
#include "sha2.c"
#include "internal-sha2.c"
typedef void (*init_f)(PX_MD *md);
typedef void (*init_f) (PX_MD * md);
static int compat_find_digest(const char *name, PX_MD **res)
static int
compat_find_digest(const char *name, PX_MD ** res)
{
init_f init = NULL;
......@@ -175,7 +178,6 @@ static int compat_find_digest(const char *name, PX_MD **res)
init(*res);
return 0;
}
#else
#define compat_find_digest(name, res) (PXE_NO_HASH)
#endif
......@@ -184,7 +186,8 @@ static int compat_find_digest(const char *name, PX_MD **res)
* Hashes
*/
typedef struct OSSLDigest {
typedef struct OSSLDigest
{
const EVP_MD *algo;
EVP_MD_CTX ctx;
} OSSLDigest;
......@@ -192,21 +195,23 @@ typedef struct OSSLDigest {
static unsigned
digest_result_size(PX_MD * h)
{
OSSLDigest *digest = (OSSLDigest *)h->p.ptr;
OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
return EVP_MD_CTX_size(&digest->ctx);
}
static unsigned
digest_block_size(PX_MD * h)
{
OSSLDigest *digest = (OSSLDigest *)h->p.ptr;
OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
return EVP_MD_CTX_block_size(&digest->ctx);
}
static void
digest_reset(PX_MD * h)
{
OSSLDigest *digest = (OSSLDigest *)h->p.ptr;
OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
EVP_DigestInit_ex(&digest->ctx, digest->algo, NULL);
}
......@@ -214,7 +219,7 @@ digest_reset(PX_MD * h)
static void
digest_update(PX_MD * h, const uint8 *data, unsigned dlen)
{
OSSLDigest *digest = (OSSLDigest *)h->p.ptr;
OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
EVP_DigestUpdate(&digest->ctx, data, dlen);
}
......@@ -222,7 +227,7 @@ digest_update(PX_MD * h, const uint8 *data, unsigned dlen)
static void
digest_finish(PX_MD * h, uint8 *dst)
{
OSSLDigest *digest = (OSSLDigest *)h->p.ptr;
OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
EVP_DigestFinal_ex(&digest->ctx, dst, NULL);
}
......@@ -230,7 +235,7 @@ digest_finish(PX_MD * h, uint8 *dst)
static void
digest_free(PX_MD * h)
{
OSSLDigest *digest = (OSSLDigest *)h->p.ptr;
OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
EVP_MD_CTX_cleanup(&digest->ctx);
......@@ -560,7 +565,7 @@ ossl_des3_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
ossldata *od = c->ptr;
for (i = 0; i < dlen / bs; i++)
DES_ecb3_encrypt((void *)(data + i * bs), (void *)(res + i * bs),
DES_ecb3_encrypt((void *) (data + i * bs), (void *) (res + i * bs),
&od->u.des3.k1, &od->u.des3.k2, &od->u.des3.k3, 1);
return 0;
}
......@@ -574,7 +579,7 @@ ossl_des3_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
ossldata *od = c->ptr;
for (i = 0; i < dlen / bs; i++)
DES_ecb3_encrypt((void *)(data + i * bs), (void *)(res + i * bs),
DES_ecb3_encrypt((void *) (data + i * bs), (void *) (res + i * bs),
&od->u.des3.k1, &od->u.des3.k2, &od->u.des3.k3, 0);
return 0;
}
......
......@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.c,v 1.23 2006/09/05 21:26:48 tgl Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/pgcrypto.c,v 1.24 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......@@ -504,7 +504,7 @@ pg_random_bytes(PG_FUNCTION_ARGS)
VARATT_SIZEP(res) = VARHDRSZ + len;
/* generate result */
err = px_get_random_bytes((uint8*)VARDATA(res), len);
err = px_get_random_bytes((uint8 *) VARDATA(res), len);
if (err < 0)
ereport(ERROR,
(errcode(ERRCODE_EXTERNAL_ROUTINE_INVOCATION_EXCEPTION),
......
......@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-internal.c,v 1.6 2006/07/13 04:52:51 neilc Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-internal.c,v 1.7 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......@@ -36,14 +36,17 @@
#include "mbuf.h"
#include "pgp.h"
static mpz_t *mp_new()
static mpz_t *
mp_new()
{
mpz_t *mp = mp_int_alloc();
mp_int_init_size(mp, 256);
return mp;
}
static void mp_clear_free(mpz_t *a)
static void
mp_clear_free(mpz_t * a)
{
if (!a)
return;
......@@ -52,7 +55,8 @@ static void mp_clear_free(mpz_t *a)
}
static int mp_px_rand(uint32 bits, mpz_t *res)
static int
mp_px_rand(uint32 bits, mpz_t * res)
{
int err;
unsigned bytes = (bits + 7) / 8;
......@@ -61,16 +65,19 @@ static int mp_px_rand(uint32 bits, mpz_t *res)
buf = px_alloc(bytes);
err = px_get_random_bytes(buf, bytes);
if (err < 0) {
if (err < 0)
{
px_free(buf);
return err;
}
/* clear unnecessary bits and set last bit to one */
if (last_bits) {
if (last_bits)
{
buf[0] >>= 8 - last_bits;
buf[0] |= 1 << (last_bits - 1);
} else
}
else
buf[0] |= 1 << 7;
mp_int_read_unsigned(res, buf, bytes);
......@@ -80,9 +87,11 @@ static int mp_px_rand(uint32 bits, mpz_t *res)
return 0;
}
static void mp_modmul(mpz_t *a, mpz_t *b, mpz_t *p, mpz_t *res)
static void
mp_modmul(mpz_t * a, mpz_t * b, mpz_t * p, mpz_t * res)
{
mpz_t *tmp = mp_new();
mp_int_mul(a, b, tmp);
mp_int_mod(tmp, p, res);
mp_clear_free(tmp);
......@@ -92,6 +101,7 @@ static mpz_t *
mpi_to_bn(PGP_MPI * n)
{
mpz_t *bn = mp_new();
mp_int_read_unsigned(bn, n->data, n->bytes);
if (!bn)
......@@ -107,7 +117,7 @@ mpi_to_bn(PGP_MPI * n)
}
static PGP_MPI *
bn_to_mpi(mpz_t *bn)
bn_to_mpi(mpz_t * bn)
{
int res;
PGP_MPI *n;
......
......@@ -33,7 +33,7 @@
*
* $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $
*
* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.c,v 1.7 2006/07/13 04:15:25 neilc Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.c,v 1.8 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......@@ -534,7 +534,7 @@ SHA256_Update(SHA256_CTX * context, const uint8 *data, size_t len)
}
static void
SHA256_Last(SHA256_CTX *context)
SHA256_Last(SHA256_CTX * context)
{
unsigned int usedspace;
......@@ -1023,4 +1023,3 @@ SHA224_Final(uint8 digest[], SHA224_CTX * context)
/* Clean up state data: */
memset(context, 0, sizeof(*context));
}
/*
* $PostgreSQL: pgsql/contrib/pgrowlocks/pgrowlocks.c,v 1.4 2006/07/13 16:57:31 momjian Exp $
* $PostgreSQL: pgsql/contrib/pgrowlocks/pgrowlocks.c,v 1.5 2006/10/04 00:29:46 momjian Exp $
*
* Copyright (c) 2005-2006 Tatsuo Ishii
*
......@@ -63,7 +63,8 @@ extern Datum pgrowlocks(PG_FUNCTION_ARGS);
*/
#undef MAKERANGEVARFROMNAMELIST_HAS_TWO_ARGS
typedef struct {
typedef struct
{
Relation rel;
HeapScanDesc scan;
int ncolumns;
......@@ -97,7 +98,6 @@ pgrowlocks(PG_FUNCTION_ARGS)
relname = PG_GETARG_TEXT_P(0);
#ifdef MAKERANGEVARFROMNAMELIST_HAS_TWO_ARGS
relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname, "pgrowlocks"));
#else
relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));
#endif
......@@ -114,7 +114,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
funcctx = SRF_PERCALL_SETUP();
attinmeta = funcctx->attinmeta;
mydata = (MyData *)funcctx->user_fctx;
mydata = (MyData *) funcctx->user_fctx;
scan = mydata->scan;
/* scan the relation */
......@@ -133,7 +133,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
values = (char **) palloc(mydata->ncolumns * sizeof(char *));
i = 0;
values[i++] = (char *)DirectFunctionCall1(tidout, PointerGetDatum(&tuple->t_self));
values[i++] = (char *) DirectFunctionCall1(tidout, PointerGetDatum(&tuple->t_self));
#ifdef HEAP_XMAX_SHARED_LOCK
if (tuple->t_data->t_infomask & HEAP_XMAX_SHARED_LOCK)
......@@ -143,7 +143,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
#else
values[i++] = pstrdup("Exclusive");
#endif
values[i] = palloc(NCHARS*sizeof(char));
values[i] = palloc(NCHARS * sizeof(char));
snprintf(values[i++], NCHARS, "%d", HeapTupleHeaderGetXmax(tuple->t_data));
#ifdef HEAP_XMAX_SHARED_LOCK
if (tuple->t_data->t_infomask & HEAP_XMAX_IS_MULTI)
......@@ -160,12 +160,12 @@ pgrowlocks(PG_FUNCTION_ARGS)
elog(ERROR, "GetMultiXactIdMembers returns error");
}
values[i] = palloc(NCHARS*nxids);
values[i+1] = palloc(NCHARS*nxids);
values[i] = palloc(NCHARS * nxids);
values[i + 1] = palloc(NCHARS * nxids);
strcpy(values[i], "{");
strcpy(values[i+1], "{");
strcpy(values[i + 1], "{");
for (j=0;j<nxids;j++)
for (j = 0; j < nxids; j++)
{
char buf[NCHARS];
......@@ -174,31 +174,30 @@ pgrowlocks(PG_FUNCTION_ARGS)
if (isValidXid)
{
strcat(values[i], ",");
strcat(values[i+1], ",");
strcat(values[i + 1], ",");
}
snprintf(buf, NCHARS, "%d", xids[j]);
strcat(values[i], buf);
snprintf(buf, NCHARS, "%d", BackendXidGetPid(xids[j]));
strcat(values[i+1], buf);
strcat(values[i + 1], buf);
isValidXid = 1;
}
}
strcat(values[i], "}");
strcat(values[i+1], "}");
strcat(values[i + 1], "}");
i++;
}
else
{
values[i++] = pstrdup("false");
values[i] = palloc(NCHARS*sizeof(char));
values[i] = palloc(NCHARS * sizeof(char));
snprintf(values[i++], NCHARS, "{%d}", HeapTupleHeaderGetXmax(tuple->t_data));
values[i] = palloc(NCHARS*sizeof(char));
values[i] = palloc(NCHARS * sizeof(char));
snprintf(values[i++], NCHARS, "{%d}", BackendXidGetPid(HeapTupleHeaderGetXmax(tuple->t_data)));
}
#else
values[i++] = pstrdup("false");
values[i++] = pstrdup("{}");
......
/*
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.24 2006/09/04 02:03:04 tgl Exp $
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.25 2006/10/04 00:29:46 momjian Exp $
*
* Copyright (c) 2001,2002 Tatsuo Ishii
*
......@@ -59,28 +59,28 @@ typedef struct pgstattuple_type
uint64 free_space; /* free/reusable space in bytes */
} pgstattuple_type;
typedef void (*pgstat_page)(pgstattuple_type *, Relation, BlockNumber);
typedef void (*pgstat_page) (pgstattuple_type *, Relation, BlockNumber);
static Datum build_pgstattuple_type(pgstattuple_type *stat,
static Datum build_pgstattuple_type(pgstattuple_type * stat,
FunctionCallInfo fcinfo);
static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo);
static Datum pgstat_heap(Relation rel, FunctionCallInfo fcinfo);
static void pgstat_btree_page(pgstattuple_type *stat,
static void pgstat_btree_page(pgstattuple_type * stat,
Relation rel, BlockNumber blkno);
static void pgstat_hash_page(pgstattuple_type *stat,
static void pgstat_hash_page(pgstattuple_type * stat,
Relation rel, BlockNumber blkno);
static void pgstat_gist_page(pgstattuple_type *stat,
static void pgstat_gist_page(pgstattuple_type * stat,
Relation rel, BlockNumber blkno);
static Datum pgstat_index(Relation rel, BlockNumber start,
pgstat_page pagefn, FunctionCallInfo fcinfo);
static void pgstat_index_page(pgstattuple_type *stat, Page page,
static void pgstat_index_page(pgstattuple_type * stat, Page page,
OffsetNumber minoff, OffsetNumber maxoff);
/*
* build_pgstattuple_type -- build a pgstattuple_type tuple
*/
static Datum
build_pgstattuple_type(pgstattuple_type *stat, FunctionCallInfo fcinfo)
build_pgstattuple_type(pgstattuple_type * stat, FunctionCallInfo fcinfo)
{
#define NCOLUMNS 9
#define NCHARS 32
......@@ -190,7 +190,7 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
{
const char *err;
switch(rel->rd_rel->relkind)
switch (rel->rd_rel->relkind)
{
case RELKIND_RELATION:
case RELKIND_TOASTVALUE:
......@@ -198,7 +198,7 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
case RELKIND_SEQUENCE:
return pgstat_heap(rel, fcinfo);
case RELKIND_INDEX:
switch(rel->rd_rel->relam)
switch (rel->rd_rel->relam)
{
case BTREE_AM_OID:
return pgstat_index(rel, BTREE_METAPAGE + 1,
......@@ -247,7 +247,7 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
BlockNumber block = 0; /* next block to count free space in */
BlockNumber tupblock;
Buffer buffer;
pgstattuple_type stat = { 0 };
pgstattuple_type stat = {0};
scan = heap_beginscan(rel, SnapshotAny, 0, NULL);
......@@ -302,7 +302,7 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
relation_close(rel, AccessShareLock);
stat.table_len = (uint64) nblocks * BLCKSZ;
stat.table_len = (uint64) nblocks *BLCKSZ;
return build_pgstattuple_type(&stat, fcinfo);
}
......@@ -311,7 +311,7 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
* pgstat_btree_page -- check tuples in a btree page
*/
static void
pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
pgstat_btree_page(pgstattuple_type * stat, Relation rel, BlockNumber blkno)
{
Buffer buf;
Page page;
......@@ -329,6 +329,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
else
{
BTPageOpaque opaque;
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
if (opaque->btpo_flags & (BTP_DELETED | BTP_HALF_DEAD))
{
......@@ -353,7 +354,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
* pgstat_hash_page -- check tuples in a hash page
*/
static void
pgstat_hash_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
pgstat_hash_page(pgstattuple_type * stat, Relation rel, BlockNumber blkno)
{
Buffer buf;
Page page;
......@@ -365,6 +366,7 @@ pgstat_hash_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
if (PageGetSpecialSize(page) == MAXALIGN(sizeof(HashPageOpaqueData)))
{
HashPageOpaque opaque;
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
switch (opaque->hasho_flag)
{
......@@ -395,7 +397,7 @@ pgstat_hash_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
* pgstat_gist_page -- check tuples in a gist page
*/
static void
pgstat_gist_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno)
pgstat_gist_page(pgstattuple_type * stat, Relation rel, BlockNumber blkno)
{
Buffer buf;
Page page;
......@@ -427,7 +429,7 @@ pgstat_index(Relation rel, BlockNumber start, pgstat_page pagefn,
{
BlockNumber nblocks;
BlockNumber blkno;
pgstattuple_type stat = { 0 };
pgstattuple_type stat = {0};
blkno = start;
for (;;)
......@@ -440,7 +442,8 @@ pgstat_index(Relation rel, BlockNumber start, pgstat_page pagefn,
/* Quit if we've scanned the whole relation */
if (blkno >= nblocks)
{
stat.table_len = (uint64) nblocks * BLCKSZ;
stat.table_len = (uint64) nblocks *BLCKSZ;
break;
}
......@@ -457,7 +460,7 @@ pgstat_index(Relation rel, BlockNumber start, pgstat_page pagefn,
* pgstat_index_page -- for generic index page
*/
static void
pgstat_index_page(pgstattuple_type *stat, Page page,
pgstat_index_page(pgstattuple_type * stat, Page page,
OffsetNumber minoff, OffsetNumber maxoff)
{
OffsetNumber i;
......
......@@ -4,7 +4,7 @@
* Written by Victor B. Wagner <vitus@cryptocom.ru>, Cryptocom LTD
* This file is distributed under BSD-style license.
*
* $PostgreSQL: pgsql/contrib/sslinfo/sslinfo.c,v 1.4 2006/09/30 18:44:37 tgl Exp $
* $PostgreSQL: pgsql/contrib/sslinfo/sslinfo.c,v 1.5 2006/10/04 00:29:46 momjian Exp $
*/
#include "postgres.h"
......@@ -41,9 +41,10 @@ Datum ASN1_STRING_to_text(ASN1_STRING *str);
* is SSL session and false if it is local or non-ssl session.
*/
PG_FUNCTION_INFO_V1(ssl_is_used);
Datum ssl_is_used(PG_FUNCTION_ARGS)
Datum
ssl_is_used(PG_FUNCTION_ARGS)
{
PG_RETURN_BOOL(MyProcPort->ssl !=NULL);
PG_RETURN_BOOL(MyProcPort->ssl != NULL);
}
......@@ -54,7 +55,8 @@ Datum ssl_is_used(PG_FUNCTION_ARGS)
* is SSL session and client certificate is verified, otherwise false.
*/
PG_FUNCTION_INFO_V1(ssl_client_cert_present);
Datum ssl_client_cert_present(PG_FUNCTION_ARGS)
Datum
ssl_client_cert_present(PG_FUNCTION_ARGS)
{
PG_RETURN_BOOL(MyProcPort->peer != NULL);
}
......@@ -69,7 +71,8 @@ Datum ssl_client_cert_present(PG_FUNCTION_ARGS)
* SSL connection is established without sending client certificate.
*/
PG_FUNCTION_INFO_V1(ssl_client_serial);
Datum ssl_client_serial(PG_FUNCTION_ARGS)
Datum
ssl_client_serial(PG_FUNCTION_ARGS)
{
Datum result;
Port *port = MyProcPort;
......@@ -83,6 +86,7 @@ Datum ssl_client_serial(PG_FUNCTION_ARGS)
serial = X509_get_serialNumber(peer);
b = ASN1_INTEGER_to_BN(serial, NULL);
decimal = BN_bn2dec(b);
BN_free(b);
result = DirectFunctionCall3(numeric_in,
CStringGetDatum(decimal),
......@@ -106,17 +110,19 @@ Datum ssl_client_serial(PG_FUNCTION_ARGS)
* Returns Datum, which can be directly returned from a C language SQL
* function.
*/
Datum ASN1_STRING_to_text(ASN1_STRING *str)
Datum
ASN1_STRING_to_text(ASN1_STRING *str)
{
BIO *membuf = NULL;
size_t size, outlen;
size_t size,
outlen;
char *sp;
char *dp;
text *result;
membuf = BIO_new(BIO_s_mem());
(void) BIO_set_close(membuf, BIO_CLOSE);
ASN1_STRING_print_ex(membuf,str,
ASN1_STRING_print_ex(membuf, str,
((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB)
| ASN1_STRFLGS_UTF8_CONVERT));
......@@ -124,7 +130,7 @@ Datum ASN1_STRING_to_text(ASN1_STRING *str)
BIO_write(membuf, &outlen, 1);
size = BIO_get_mem_data(membuf, &sp);
dp = (char *) pg_do_encoding_conversion((unsigned char *) sp,
size-1,
size - 1,
PG_UTF8,
GetDatabaseEncoding());
outlen = strlen(dp);
......@@ -151,13 +157,16 @@ Datum ASN1_STRING_to_text(ASN1_STRING *str)
* Returns result of ASN1_STRING_to_text applied to appropriate
* part of name
*/
Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName)
Datum
X509_NAME_field_to_text(X509_NAME *name, text *fieldName)
{
char *sp;
char *string_fieldname;
char *dp;
size_t name_len = VARSIZE(fieldName) - VARHDRSZ;
int nid, index, i;
int nid,
index,
i;
ASN1_STRING *data;
string_fieldname = palloc(name_len + 1);
......@@ -175,7 +184,7 @@ Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName)
pfree(string_fieldname);
index = X509_NAME_get_index_by_NID(name, nid, -1);
if (index < 0)
return (Datum)0;
return (Datum) 0;
data = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(name, index));
return ASN1_STRING_to_text(data);
}
......@@ -198,7 +207,8 @@ Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName)
* there is no field with such name in the certificate.
*/
PG_FUNCTION_INFO_V1(ssl_client_dn_field);
Datum ssl_client_dn_field(PG_FUNCTION_ARGS)
Datum
ssl_client_dn_field(PG_FUNCTION_ARGS)
{
text *fieldname = PG_GETARG_TEXT_P(0);
Datum result;
......@@ -232,7 +242,8 @@ Datum ssl_client_dn_field(PG_FUNCTION_ARGS)
* there is no field with such name in the certificate.
*/
PG_FUNCTION_INFO_V1(ssl_issuer_field);
Datum ssl_issuer_field(PG_FUNCTION_ARGS)
Datum
ssl_issuer_field(PG_FUNCTION_ARGS)
{
text *fieldname = PG_GETARG_TEXT_P(0);
Datum result;
......@@ -260,21 +271,25 @@ Datum ssl_issuer_field(PG_FUNCTION_ARGS)
* Returns: text datum which contains string representation of
* X509_NAME
*/
Datum X509_NAME_to_text(X509_NAME *name)
Datum
X509_NAME_to_text(X509_NAME *name)
{
BIO *membuf = BIO_new(BIO_s_mem());
int i,nid,count = X509_NAME_entry_count(name);
int i,
nid,
count = X509_NAME_entry_count(name);
X509_NAME_ENTRY *e;
ASN1_STRING *v;
const char *field_name;
size_t size,outlen;
size_t size,
outlen;
char *sp;
char *dp;
text *result;
(void) BIO_set_close(membuf, BIO_CLOSE);
for (i=0; i<count; i++)
for (i = 0; i < count; i++)
{
e = X509_NAME_get_entry(name, i);
nid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(e));
......@@ -283,17 +298,17 @@ Datum X509_NAME_to_text(X509_NAME *name)
if (!field_name)
field_name = OBJ_nid2ln(nid);
BIO_printf(membuf, "/%s=", field_name);
ASN1_STRING_print_ex(membuf,v,
ASN1_STRING_print_ex(membuf, v,
((ASN1_STRFLGS_RFC2253 & ~ASN1_STRFLGS_ESC_MSB)
| ASN1_STRFLGS_UTF8_CONVERT));
}
i=0;
i = 0;
BIO_write(membuf, &i, 1);
size = BIO_get_mem_data(membuf, &sp);
dp = (char *) pg_do_encoding_conversion((unsigned char *) sp,
size-1,
size - 1,
PG_UTF8,
GetDatabaseEncoding());
BIO_free(membuf);
......@@ -301,8 +316,10 @@ Datum X509_NAME_to_text(X509_NAME *name)
result = palloc(VARHDRSZ + outlen);
memcpy(VARDATA(result), dp, outlen);
/* pg_do_encoding_conversion has annoying habit of returning
* source pointer */
/*
* pg_do_encoding_conversion has annoying habit of returning source
* pointer
*/
if (dp != sp)
pfree(dp);
VARATT_SIZEP(result) = outlen + VARHDRSZ;
......@@ -320,7 +337,8 @@ Datum X509_NAME_to_text(X509_NAME *name)
* Returns text datum.
*/
PG_FUNCTION_INFO_V1(ssl_client_dn);
Datum ssl_client_dn(PG_FUNCTION_ARGS)
Datum
ssl_client_dn(PG_FUNCTION_ARGS)
{
if (!(MyProcPort->peer))
PG_RETURN_NULL();
......@@ -338,7 +356,8 @@ Datum ssl_client_dn(PG_FUNCTION_ARGS)
* Returns text datum.
*/
PG_FUNCTION_INFO_V1(ssl_issuer_dn);
Datum ssl_issuer_dn(PG_FUNCTION_ARGS)
Datum
ssl_issuer_dn(PG_FUNCTION_ARGS)
{
if (!(MyProcPort->peer))
PG_RETURN_NULL();
......
......@@ -166,10 +166,13 @@ get_oidnamespace(Oid funcoid)
/* if path is relative, take it as relative to share dir */
char *
to_absfilename(char *filename) {
if (!is_absolute_path(filename)) {
to_absfilename(char *filename)
{
if (!is_absolute_path(filename))
{
char sharepath[MAXPGPATH];
char *absfn;
#ifdef WIN32
char delim = '\\';
#else
......
......@@ -14,7 +14,7 @@ text *mtextdup(text *in);
int text_cmp(text *a, text *b);
char * to_absfilename(char *filename);
char *to_absfilename(char *filename);
#define NEXTVAL(x) ( (text*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )
#define ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x))
......
/* $PostgreSQL: pgsql/contrib/tsearch2/dict.c,v 1.12 2006/05/31 14:05:31 teodor Exp $ */
/* $PostgreSQL: pgsql/contrib/tsearch2/dict.c,v 1.13 2006/10/04 00:29:46 momjian Exp $ */
/*
* interface functions to dictionary
......@@ -102,7 +102,8 @@ comparedict(const void *a, const void *b)
}
static void
insertdict(Oid id) {
insertdict(Oid id)
{
DictInfo newdict;
if (DList.len == DList.reallen)
......@@ -201,7 +202,7 @@ lexize(PG_FUNCTION_ARGS)
*ptr;
Datum *da;
ArrayType *a;
DictSubState dstate = { false, false, NULL };
DictSubState dstate = {false, false, NULL};
SET_FUNCOID();
dict = finddict(PG_GETARG_OID(0));
......@@ -215,7 +216,8 @@ lexize(PG_FUNCTION_ARGS)
)
);
if (dstate.getnext) {
if (dstate.getnext)
{
dstate.isend = true;
ptr = res = (TSLexeme *) DatumGetPointer(
FunctionCall4(&(dict->lexize_info),
......
/* $PostgreSQL: pgsql/contrib/tsearch2/dict.h,v 1.7 2006/05/31 14:05:31 teodor Exp $ */
/* $PostgreSQL: pgsql/contrib/tsearch2/dict.h,v 1.8 2006/10/04 00:29:46 momjian Exp $ */
#ifndef __DICT_H__
#define __DICT_H__
......@@ -30,10 +30,13 @@ DictInfo *finddict(Oid id);
Oid name2id_dict(text *name);
void reset_dict(void);
typedef struct {
bool isend; /* in: marks for lexize_info about text end is reached */
typedef struct
{
bool isend; /* in: marks for lexize_info about text end is
* reached */
bool getnext; /* out: dict wants next lexeme */
void *private; /* internal dict state between calls with getnext == true */
void *private; /* internal dict state between calls with
* getnext == true */
} DictSubState;
/* simple parser of cfg string */
......@@ -51,13 +54,8 @@ typedef struct
/*
* number of variant of split word , for example Word 'fotballklubber'
* (norwegian) has two varian to split: ( fotball, klubb ) and ( fot,
* ball, klubb ). So, dictionary should return:
* nvariant lexeme
* 1 fotball
* 1 klubb
* 2 fot
* 2 ball
* 2 klubb
* ball, klubb ). So, dictionary should return: nvariant lexeme 1
* fotball 1 klubb 2 fot 2 ball 2 klubb
*/
uint16 nvariant;
......@@ -74,7 +72,8 @@ typedef struct
* Lexize subsystem
*/
typedef struct ParsedLex {
typedef struct ParsedLex
{
int type;
char *lemm;
int lenlemm;
......@@ -82,12 +81,14 @@ typedef struct ParsedLex {
struct ParsedLex *next;
} ParsedLex;
typedef struct ListParsedLex {
typedef struct ListParsedLex
{
ParsedLex *head;
ParsedLex *tail;
} ListParsedLex;
typedef struct {
typedef struct
{
TSCfgInfo *cfg;
Oid curDictId;
int posDict;
......@@ -96,16 +97,18 @@ typedef struct {
ListParsedLex towork; /* current list to work */
ListParsedLex waste; /* list of lexemes that already lexized */
/* fields to store last variant to lexize (basically, thesaurus
or similar to, which wants several lexemes */
/*
* fields to store last variant to lexize (basically, thesaurus or similar
* to, which wants several lexemes
*/
ParsedLex *lastRes;
TSLexeme *tmpRes;
} LexizeData;
void LexizeInit(LexizeData *ld, TSCfgInfo *cfg);
void LexizeAddLemm(LexizeData *ld, int type, char *lemm, int lenlemm);
TSLexeme* LexizeExec(LexizeData *ld, ParsedLex **correspondLexem);
void LexizeInit(LexizeData * ld, TSCfgInfo * cfg);
void LexizeAddLemm(LexizeData * ld, int type, char *lemm, int lenlemm);
TSLexeme *LexizeExec(LexizeData * ld, ParsedLex ** correspondLexem);
#endif
This diff is collapsed.
This diff is collapsed.
/* $PostgreSQL: pgsql/contrib/tsearch2/gistidx.c,v 1.14 2006/06/28 12:00:06 teodor Exp $ */
/* $PostgreSQL: pgsql/contrib/tsearch2/gistidx.c,v 1.15 2006/10/04 00:29:46 momjian Exp $ */
#include "postgres.h"
......
This diff is collapsed.
This diff is collapsed.
......@@ -33,9 +33,9 @@ nstrdup(char *ptr, int len)
{
if (t_iseq(ptr, '\\'))
ptr++;
COPYCHAR( cptr, ptr );
cptr+=pg_mblen(ptr);
ptr+=pg_mblen(ptr);
COPYCHAR(cptr, ptr);
cptr += pg_mblen(ptr);
ptr += pg_mblen(ptr);
}
*cptr = '\0';
......@@ -53,9 +53,9 @@ parse_cfgdict(text *in, Map ** m)
while (ptr - VARDATA(in) < VARSIZE(in) - VARHDRSZ)
{
if ( t_iseq(ptr, ',') )
if (t_iseq(ptr, ','))
num++;
ptr+=pg_mblen(ptr);
ptr += pg_mblen(ptr);
}
*m = mptr = (Map *) palloc(sizeof(Map) * (num + 2));
......@@ -84,7 +84,7 @@ parse_cfgdict(text *in, Map ** m)
mptr->key = nstrdup(begin, ptr - begin);
state = CS_WAITEQ;
}
else if (t_iseq(ptr,'='))
else if (t_iseq(ptr, '='))
{
mptr->key = nstrdup(begin, ptr - begin);
state = CS_WAITVALUE;
......@@ -163,7 +163,7 @@ parse_cfgdict(text *in, Map ** m)
errmsg("bad parser state"),
errdetail("%d at position %d.",
state, (int) (ptr - VARDATA(in)))));
ptr+=pg_mblen(ptr);
ptr += pg_mblen(ptr);
}
if (state == CS_IN2VALUE)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment