Commit f99a569a authored by Bruce Momjian's avatar Bruce Momjian

pgindent run for 8.2.

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