8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
authorBruce Momjian <bruce@momjian.us>
Thu, 11 Jun 2009 14:49:15 +0000 (14:49 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 11 Jun 2009 14:49:15 +0000 (14:49 +0000)
provided by Andrew.

654 files changed:
contrib/auto_explain/auto_explain.c
contrib/btree_gin/btree_gin.c
contrib/btree_gist/btree_bit.c
contrib/btree_gist/btree_bytea.c
contrib/btree_gist/btree_cash.c
contrib/btree_gist/btree_date.c
contrib/btree_gist/btree_float4.c
contrib/btree_gist/btree_float8.c
contrib/btree_gist/btree_gist.c
contrib/btree_gist/btree_gist.h
contrib/btree_gist/btree_inet.c
contrib/btree_gist/btree_int2.c
contrib/btree_gist/btree_int4.c
contrib/btree_gist/btree_int8.c
contrib/btree_gist/btree_interval.c
contrib/btree_gist/btree_macaddr.c
contrib/btree_gist/btree_numeric.c
contrib/btree_gist/btree_oid.c
contrib/btree_gist/btree_text.c
contrib/btree_gist/btree_time.c
contrib/btree_gist/btree_ts.c
contrib/btree_gist/btree_utils_num.c
contrib/btree_gist/btree_utils_num.h
contrib/btree_gist/btree_utils_var.c
contrib/btree_gist/btree_utils_var.h
contrib/chkpass/chkpass.c
contrib/citext/citext.c
contrib/cube/cube.c
contrib/cube/cubedata.h
contrib/dblink/dblink.c
contrib/dict_int/dict_int.c
contrib/earthdistance/earthdistance.c
contrib/fuzzystrmatch/dmetaphone.c
contrib/fuzzystrmatch/fuzzystrmatch.c
contrib/hstore/crc32.c
contrib/hstore/crc32.h
contrib/hstore/hstore.h
contrib/hstore/hstore_gin.c
contrib/hstore/hstore_gist.c
contrib/hstore/hstore_io.c
contrib/hstore/hstore_op.c
contrib/intarray/_int.h
contrib/intarray/_int_bool.c
contrib/intarray/_int_gin.c
contrib/intarray/_int_gist.c
contrib/intarray/_int_op.c
contrib/intarray/_int_tool.c
contrib/intarray/_intbig_gist.c
contrib/isn/isn.c
contrib/ltree/_ltree_gist.c
contrib/ltree/_ltree_op.c
contrib/ltree/lquery_op.c
contrib/ltree/ltree.h
contrib/ltree/ltree_gist.c
contrib/ltree/ltree_io.c
contrib/ltree/ltree_op.c
contrib/ltree/ltxtquery_io.c
contrib/ltree/ltxtquery_op.c
contrib/oid2name/oid2name.c
contrib/pageinspect/btreefuncs.c
contrib/pageinspect/fsmfuncs.c
contrib/pageinspect/heapfuncs.c
contrib/pageinspect/rawpage.c
contrib/pg_buffercache/pg_buffercache_pages.c
contrib/pg_freespacemap/pg_freespacemap.c
contrib/pg_standby/pg_standby.c
contrib/pg_stat_statements/pg_stat_statements.c
contrib/pg_trgm/trgm.h
contrib/pg_trgm/trgm_gin.c
contrib/pg_trgm/trgm_gist.c
contrib/pg_trgm/trgm_op.c
contrib/pgbench/pgbench.c
contrib/pgcrypto/blf.c
contrib/pgcrypto/blf.h
contrib/pgcrypto/crypt-blowfish.c
contrib/pgcrypto/crypt-gensalt.c
contrib/pgcrypto/fortuna.c
contrib/pgcrypto/imath.c
contrib/pgcrypto/imath.h
contrib/pgcrypto/internal-sha2.c
contrib/pgcrypto/internal.c
contrib/pgcrypto/mbuf.c
contrib/pgcrypto/mbuf.h
contrib/pgcrypto/md5.c
contrib/pgcrypto/md5.h
contrib/pgcrypto/openssl.c
contrib/pgcrypto/pgp-cfb.c
contrib/pgcrypto/pgp-compress.c
contrib/pgcrypto/pgp-decrypt.c
contrib/pgcrypto/pgp-encrypt.c
contrib/pgcrypto/pgp-info.c
contrib/pgcrypto/pgp-mpi-internal.c
contrib/pgcrypto/pgp-mpi-openssl.c
contrib/pgcrypto/pgp-mpi.c
contrib/pgcrypto/pgp-pgsql.c
contrib/pgcrypto/pgp-pubdec.c
contrib/pgcrypto/pgp-pubenc.c
contrib/pgcrypto/pgp-pubkey.c
contrib/pgcrypto/pgp-s2k.c
contrib/pgcrypto/pgp.c
contrib/pgcrypto/pgp.h
contrib/pgcrypto/px-hmac.c
contrib/pgcrypto/px.c
contrib/pgcrypto/px.h
contrib/pgcrypto/rijndael.c
contrib/pgcrypto/rijndael.h
contrib/pgcrypto/sha2.c
contrib/pgcrypto/sha2.h
contrib/pgrowlocks/pgrowlocks.c
contrib/pgstattuple/pgstatindex.c
contrib/pgstattuple/pgstattuple.c
contrib/seg/seg.c
contrib/seg/segdata.h
contrib/spi/autoinc.c
contrib/spi/refint.c
contrib/spi/timetravel.c
contrib/tablefunc/tablefunc.c
contrib/tablefunc/tablefunc.h
contrib/test_parser/test_parser.c
contrib/tsearch2/tsearch2.c
contrib/uuid-ossp/uuid-ossp.c
contrib/xml2/xpath.c
contrib/xml2/xslt_proc.c
src/backend/access/common/heaptuple.c
src/backend/access/common/indextuple.c
src/backend/access/common/printtup.c
src/backend/access/common/reloptions.c
src/backend/access/common/tupdesc.c
src/backend/access/gin/ginarrayproc.c
src/backend/access/gin/ginbulk.c
src/backend/access/gin/gindatapage.c
src/backend/access/gin/ginentrypage.c
src/backend/access/gin/ginfast.c
src/backend/access/gin/ginget.c
src/backend/access/gin/gininsert.c
src/backend/access/gin/ginscan.c
src/backend/access/gin/ginutil.c
src/backend/access/gin/ginvacuum.c
src/backend/access/gin/ginxlog.c
src/backend/access/gist/gistget.c
src/backend/access/gist/gistproc.c
src/backend/access/gist/gistscan.c
src/backend/access/gist/gistsplit.c
src/backend/access/gist/gistutil.c
src/backend/access/gist/gistvacuum.c
src/backend/access/hash/hash.c
src/backend/access/hash/hashfunc.c
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashscan.c
src/backend/access/hash/hashsearch.c
src/backend/access/hash/hashsort.c
src/backend/access/hash/hashutil.c
src/backend/access/heap/heapam.c
src/backend/access/heap/hio.c
src/backend/access/heap/pruneheap.c
src/backend/access/heap/rewriteheap.c
src/backend/access/heap/tuptoaster.c
src/backend/access/heap/visibilitymap.c
src/backend/access/index/genam.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtxlog.c
src/backend/access/transam/clog.c
src/backend/access/transam/twophase.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogutils.c
src/backend/catalog/aclchk.c
src/backend/catalog/catalog.c
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/namespace.c
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_constraint.c
src/backend/catalog/pg_depend.c
src/backend/catalog/pg_inherits.c
src/backend/catalog/pg_operator.c
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_shdepend.c
src/backend/catalog/pg_type.c
src/backend/catalog/storage.c
src/backend/catalog/toasting.c
src/backend/commands/aggregatecmds.c
src/backend/commands/analyze.c
src/backend/commands/async.c
src/backend/commands/cluster.c
src/backend/commands/comment.c
src/backend/commands/conversioncmds.c
src/backend/commands/copy.c
src/backend/commands/dbcommands.c
src/backend/commands/explain.c
src/backend/commands/foreigncmds.c
src/backend/commands/functioncmds.c
src/backend/commands/indexcmds.c
src/backend/commands/lockcmds.c
src/backend/commands/operatorcmds.c
src/backend/commands/portalcmds.c
src/backend/commands/prepare.c
src/backend/commands/proclang.c
src/backend/commands/schemacmds.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/backend/commands/tsearchcmds.c
src/backend/commands/typecmds.c
src/backend/commands/user.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/backend/commands/variable.c
src/backend/commands/view.c
src/backend/executor/execCurrent.c
src/backend/executor/execMain.c
src/backend/executor/execQual.c
src/backend/executor/execTuples.c
src/backend/executor/execUtils.c
src/backend/executor/functions.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeBitmapIndexscan.c
src/backend/executor/nodeCtescan.c
src/backend/executor/nodeFunctionscan.c
src/backend/executor/nodeHash.c
src/backend/executor/nodeHashjoin.c
src/backend/executor/nodeIndexscan.c
src/backend/executor/nodeLimit.c
src/backend/executor/nodeMaterial.c
src/backend/executor/nodeMergejoin.c
src/backend/executor/nodeNestloop.c
src/backend/executor/nodeRecursiveunion.c
src/backend/executor/nodeSetOp.c
src/backend/executor/nodeSubplan.c
src/backend/executor/nodeTidscan.c
src/backend/executor/nodeUnique.c
src/backend/executor/nodeWindowAgg.c
src/backend/executor/nodeWorktablescan.c
src/backend/executor/spi.c
src/backend/executor/tstoreReceiver.c
src/backend/foreign/foreign.c
src/backend/libpq/auth.c
src/backend/libpq/be-fsstubs.c
src/backend/libpq/be-secure.c
src/backend/libpq/hba.c
src/backend/libpq/ip.c
src/backend/libpq/pqformat.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/list.c
src/backend/nodes/nodeFuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/nodes/tidbitmap.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/clausesel.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/joinrels.c
src/backend/optimizer/path/orindxpath.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/plan/planagg.c
src/backend/optimizer/plan/planmain.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/prep/prepjointree.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/placeholder.c
src/backend/optimizer/util/plancat.c
src/backend/optimizer/util/predtest.c
src/backend/optimizer/util/relnode.c
src/backend/optimizer/util/restrictinfo.c
src/backend/optimizer/util/var.c
src/backend/parser/analyze.c
src/backend/parser/parse_agg.c
src/backend/parser/parse_clause.c
src/backend/parser/parse_coerce.c
src/backend/parser/parse_cte.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_func.c
src/backend/parser/parse_node.c
src/backend/parser/parse_oper.c
src/backend/parser/parse_relation.c
src/backend/parser/parse_target.c
src/backend/parser/parse_type.c
src/backend/parser/parse_utilcmd.c
src/backend/parser/parser.c
src/backend/port/darwin/system.c
src/backend/port/dynloader/sco.c
src/backend/port/dynloader/solaris.c
src/backend/port/dynloader/sunos4.c
src/backend/port/dynloader/svr4.c
src/backend/port/dynloader/univel.c
src/backend/port/dynloader/univel.h
src/backend/port/dynloader/unixware.c
src/backend/port/dynloader/unixware.h
src/backend/port/dynloader/win32.h
src/backend/port/nextstep/port.c
src/backend/port/posix_sema.c
src/backend/port/sysv_sema.c
src/backend/port/win32/mingwcompat.c
src/backend/port/win32/socket.c
src/backend/port/win32/timer.c
src/backend/port/win32_sema.c
src/backend/port/win32_shmem.c
src/backend/postmaster/autovacuum.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/pgarch.c
src/backend/postmaster/pgstat.c
src/backend/postmaster/postmaster.c
src/backend/postmaster/syslogger.c
src/backend/postmaster/walwriter.c
src/backend/regex/regc_lex.c
src/backend/regex/regc_nfa.c
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteHandler.c
src/backend/rewrite/rewriteManip.c
src/backend/rewrite/rewriteRemove.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/localbuf.c
src/backend/storage/file/buffile.c
src/backend/storage/file/fd.c
src/backend/storage/freespace/freespace.c
src/backend/storage/freespace/fsmpage.c
src/backend/storage/freespace/indexfsm.c
src/backend/storage/ipc/ipc.c
src/backend/storage/ipc/pmsignal.c
src/backend/storage/ipc/procarray.c
src/backend/storage/ipc/sinval.c
src/backend/storage/ipc/sinvaladt.c
src/backend/storage/large_object/inv_api.c
src/backend/storage/lmgr/deadlock.c
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c
src/backend/storage/smgr/md.c
src/backend/storage/smgr/smgr.c
src/backend/tcop/postgres.c
src/backend/tcop/pquery.c
src/backend/tcop/utility.c
src/backend/tsearch/regis.c
src/backend/tsearch/spell.c
src/backend/tsearch/to_tsany.c
src/backend/tsearch/ts_locale.c
src/backend/tsearch/ts_parse.c
src/backend/tsearch/ts_selfuncs.c
src/backend/tsearch/ts_typanalyze.c
src/backend/tsearch/wparser.c
src/backend/utils/adt/acl.c
src/backend/utils/adt/array_userfuncs.c
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/bool.c
src/backend/utils/adt/cash.c
src/backend/utils/adt/date.c
src/backend/utils/adt/datetime.c
src/backend/utils/adt/dbsize.c
src/backend/utils/adt/float.c
src/backend/utils/adt/formatting.c
src/backend/utils/adt/int8.c
src/backend/utils/adt/like_match.c
src/backend/utils/adt/misc.c
src/backend/utils/adt/nabstime.c
src/backend/utils/adt/network.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/oracle_compat.c
src/backend/utils/adt/pg_locale.c
src/backend/utils/adt/pg_lzcompress.c
src/backend/utils/adt/pgstatfuncs.c
src/backend/utils/adt/quote.c
src/backend/utils/adt/regexp.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/adt/rowtypes.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/trigfuncs.c
src/backend/utils/adt/tsginidx.c
src/backend/utils/adt/tsgistidx.c
src/backend/utils/adt/tsquery.c
src/backend/utils/adt/tsquery_gist.c
src/backend/utils/adt/tsquery_op.c
src/backend/utils/adt/tsquery_util.c
src/backend/utils/adt/tsrank.c
src/backend/utils/adt/tsvector.c
src/backend/utils/adt/tsvector_op.c
src/backend/utils/adt/uuid.c
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varlena.c
src/backend/utils/adt/windowfuncs.c
src/backend/utils/adt/xml.c
src/backend/utils/cache/catcache.c
src/backend/utils/cache/inval.c
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/plancache.c
src/backend/utils/cache/relcache.c
src/backend/utils/cache/syscache.c
src/backend/utils/error/elog.c
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/fmgr/fmgr.c
src/backend/utils/fmgr/funcapi.c
src/backend/utils/init/miscinit.c
src/backend/utils/init/postinit.c
src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c
src/backend/utils/mb/mbutils.c
src/backend/utils/mb/wchar.c
src/backend/utils/mb/wstrcmp.c
src/backend/utils/mb/wstrncmp.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/help_config.c
src/backend/utils/mmgr/aset.c
src/backend/utils/resowner/resowner.c
src/backend/utils/sort/tuplesort.c
src/backend/utils/sort/tuplestore.c
src/backend/utils/time/snapmgr.c
src/backend/utils/time/tqual.c
src/bin/initdb/initdb.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/common.c
src/bin/pg_dump/dumputils.c
src/bin/pg_dump/keywords.c
src/bin/pg_dump/pg_backup.h
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump_sort.c
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_restore.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/bin/pgevent/pgevent.c
src/bin/psql/command.c
src/bin/psql/describe.c
src/bin/psql/help.c
src/bin/psql/mainloop.c
src/bin/psql/mbprint.c
src/bin/psql/mbprint.h
src/bin/psql/print.c
src/bin/psql/print.h
src/bin/psql/tab-complete.c
src/bin/scripts/common.c
src/bin/scripts/reindexdb.c
src/include/access/clog.h
src/include/access/genam.h
src/include/access/gin.h
src/include/access/gist_private.h
src/include/access/hash.h
src/include/access/heapam.h
src/include/access/hio.h
src/include/access/htup.h
src/include/access/nbtree.h
src/include/access/reloptions.h
src/include/access/visibilitymap.h
src/include/access/xact.h
src/include/access/xlogutils.h
src/include/c.h
src/include/catalog/catalog.h
src/include/catalog/catversion.h
src/include/catalog/dependency.h
src/include/catalog/genbki.h
src/include/catalog/heap.h
src/include/catalog/indexing.h
src/include/catalog/namespace.h
src/include/catalog/pg_amop.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_cast.h
src/include/catalog/pg_class.h
src/include/catalog/pg_conversion_fn.h
src/include/catalog/pg_foreign_server.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc_fn.h
src/include/catalog/pg_shdepend.h
src/include/catalog/pg_statistic.h
src/include/catalog/pg_type.h
src/include/catalog/pg_type_fn.h
src/include/catalog/pg_user_mapping.h
src/include/commands/comment.h
src/include/commands/explain.h
src/include/commands/proclang.h
src/include/commands/tablecmds.h
src/include/commands/trigger.h
src/include/commands/vacuum.h
src/include/executor/executor.h
src/include/executor/hashjoin.h
src/include/executor/spi.h
src/include/executor/tstoreReceiver.h
src/include/executor/tuptable.h
src/include/foreign/foreign.h
src/include/funcapi.h
src/include/libpq/hba.h
src/include/libpq/libpq-be.h
src/include/mb/pg_wchar.h
src/include/miscadmin.h
src/include/nodes/execnodes.h
src/include/nodes/makefuncs.h
src/include/nodes/nodeFuncs.h
src/include/nodes/nodes.h
src/include/nodes/parsenodes.h
src/include/nodes/pg_list.h
src/include/nodes/plannodes.h
src/include/nodes/primnodes.h
src/include/nodes/relation.h
src/include/nodes/tidbitmap.h
src/include/optimizer/clauses.h
src/include/optimizer/cost.h
src/include/optimizer/paths.h
src/include/optimizer/placeholder.h
src/include/optimizer/plancat.h
src/include/optimizer/planmain.h
src/include/optimizer/subselect.h
src/include/parser/gramparse.h
src/include/parser/parse_agg.h
src/include/parser/parse_clause.h
src/include/parser/parse_coerce.h
src/include/parser/parse_node.h
src/include/parser/parse_relation.h
src/include/pg_config_manual.h
src/include/pgstat.h
src/include/port.h
src/include/port/aix.h
src/include/port/bsdi.h
src/include/port/sco.h
src/include/port/sunos4.h
src/include/port/ultrix4.h
src/include/port/univel.h
src/include/port/unixware.h
src/include/port/win32.h
src/include/port/win32/pwd.h
src/include/port/win32/sys/wait.h
src/include/portability/instr_time.h
src/include/postmaster/bgwriter.h
src/include/regex/regex.h
src/include/rewrite/rewriteManip.h
src/include/storage/buf_internals.h
src/include/storage/bufmgr.h
src/include/storage/freespace.h
src/include/storage/fsm_internals.h
src/include/storage/ipc.h
src/include/storage/lmgr.h
src/include/storage/pmsignal.h
src/include/storage/procarray.h
src/include/storage/relfilenode.h
src/include/storage/shmem.h
src/include/storage/sinval.h
src/include/storage/sinvaladt.h
src/include/storage/smgr.h
src/include/tcop/dest.h
src/include/tcop/tcopprot.h
src/include/tsearch/ts_locale.h
src/include/tsearch/ts_public.h
src/include/tsearch/ts_utils.h
src/include/utils/acl.h
src/include/utils/cash.h
src/include/utils/date.h
src/include/utils/datetime.h
src/include/utils/elog.h
src/include/utils/guc.h
src/include/utils/guc_tables.h
src/include/utils/lsyscache.h
src/include/utils/rel.h
src/include/utils/selfuncs.h
src/include/utils/snapmgr.h
src/include/utils/snapshot.h
src/include/utils/timestamp.h
src/include/utils/tuplesort.h
src/include/utils/tuplestore.h
src/include/utils/xml.h
src/include/windowapi.h
src/interfaces/ecpg/compatlib/informix.c
src/interfaces/ecpg/ecpglib/connect.c
src/interfaces/ecpg/ecpglib/descriptor.c
src/interfaces/ecpg/ecpglib/error.c
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/misc.c
src/interfaces/ecpg/ecpglib/prepare.c
src/interfaces/ecpg/include/datetime.h
src/interfaces/ecpg/include/decimal.h
src/interfaces/ecpg/include/ecpglib.h
src/interfaces/ecpg/include/sqlda.h
src/interfaces/ecpg/include/sqltypes.h
src/interfaces/ecpg/pgtypeslib/datetime.c
src/interfaces/ecpg/pgtypeslib/dt.h
src/interfaces/ecpg/pgtypeslib/dt_common.c
src/interfaces/ecpg/pgtypeslib/interval.c
src/interfaces/ecpg/pgtypeslib/timestamp.c
src/interfaces/ecpg/preproc/c_keywords.c
src/interfaces/ecpg/preproc/ecpg.c
src/interfaces/ecpg/preproc/ecpg_keywords.c
src/interfaces/ecpg/preproc/extern.h
src/interfaces/ecpg/preproc/output.c
src/interfaces/ecpg/preproc/type.c
src/interfaces/ecpg/preproc/type.h
src/interfaces/ecpg/preproc/variable.c
src/interfaces/libpq/fe-auth.c
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-lobj.c
src/interfaces/libpq/fe-misc.c
src/interfaces/libpq/fe-protocol3.c
src/interfaces/libpq/fe-secure.c
src/interfaces/libpq/libpq-events.c
src/interfaces/libpq/libpq-events.h
src/interfaces/libpq/libpq-fe.h
src/interfaces/libpq/libpq-int.h
src/interfaces/libpq/pqexpbuffer.c
src/interfaces/libpq/pqexpbuffer.h
src/interfaces/libpq/pthread-win32.c
src/interfaces/libpq/win32.c
src/interfaces/libpq/win32.h
src/pl/plperl/plperl.c
src/pl/plperl/spi_internal.c
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_funcs.c
src/pl/plpgsql/src/plpgsql.h
src/pl/plpython/plpython.c
src/pl/tcl/pltcl.c
src/port/crypt.c
src/port/dirmod.c
src/port/exec.c
src/port/getopt.c
src/port/getopt_long.c
src/port/getrusage.c
src/port/open.c
src/port/path.c
src/port/pipe.c
src/port/pthread-win32.h
src/port/rand.c
src/port/strlcat.c
src/port/strtol.c
src/port/strtoul.c
src/port/win32env.c
src/test/examples/testlibpq.c
src/test/examples/testlibpq2.c
src/test/examples/testlibpq3.c
src/test/examples/testlibpq4.c
src/test/locale/test-ctype.c
src/test/regress/pg_regress.c
src/test/regress/pg_regress_main.c
src/timezone/localtime.c
src/timezone/pgtz.c
src/timezone/pgtz.h
src/timezone/private.h
src/timezone/strftime.c
src/timezone/tzfile.h
src/timezone/zic.c
src/tools/fsync/test_fsync.c
src/tutorial/complex.c

index 8e0f11038c9107ed94e30a219d15f2c823fd15c6..9108a77ba1efd89faf22ee1735338b12f4c11016 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 2008-2009, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.4 2009/01/05 13:35:38 tgl Exp $
+ *   $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.5 2009/06/11 14:48:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -19,7 +19,7 @@
 PG_MODULE_MAGIC;
 
 /* GUC variables */
-static int auto_explain_log_min_duration = -1;     /* msec or -1 */
+static int auto_explain_log_min_duration = -1; /* msec or -1 */
 static bool auto_explain_log_analyze = false;
 static bool auto_explain_log_verbose = false;
 static bool auto_explain_log_nested_statements = false;
@@ -28,21 +28,21 @@ static bool auto_explain_log_nested_statements = false;
 static int nesting_level = 0;
 
 /* Saved hook values in case of unload */
-static ExecutorStart_hook_type prev_ExecutorStart = NULL;
-static ExecutorRun_hook_type   prev_ExecutorRun = NULL;
-static ExecutorEnd_hook_type   prev_ExecutorEnd = NULL;
+static ExecutorStart_hook_type prev_ExecutorStart = NULL;
+static ExecutorRun_hook_type prev_ExecutorRun = NULL;
+static ExecutorEnd_hook_type prev_ExecutorEnd = NULL;
 
 #define auto_explain_enabled() \
    (auto_explain_log_min_duration >= 0 && \
     (nesting_level == 0 || auto_explain_log_nested_statements))
 
-void   _PG_init(void);
-void   _PG_fini(void);
+void       _PG_init(void);
+void       _PG_fini(void);
 
 static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags);
 static void explain_ExecutorRun(QueryDesc *queryDesc,
-                               ScanDirection direction,
-                               long count);
+                   ScanDirection direction,
+                   long count);
 static void explain_ExecutorEnd(QueryDesc *queryDesc);
 
 
@@ -54,8 +54,8 @@ _PG_init(void)
 {
    /* Define custom GUC variables. */
    DefineCustomIntVariable("auto_explain.log_min_duration",
-                           "Sets the minimum execution time above which plans will be logged.",
-                           "Zero prints all plans. -1 turns this feature off.",
+        "Sets the minimum execution time above which plans will be logged.",
+                        "Zero prints all plans. -1 turns this feature off.",
                            &auto_explain_log_min_duration,
                            -1,
                            -1, INT_MAX / 1000,
@@ -138,9 +138,9 @@ explain_ExecutorStart(QueryDesc *queryDesc, int eflags)
    if (auto_explain_enabled())
    {
        /*
-        * Set up to track total elapsed time in ExecutorRun.  Make sure
-        * the space is allocated in the per-query context so it will go
-        * away at ExecutorEnd.
+        * Set up to track total elapsed time in ExecutorRun.  Make sure the
+        * space is allocated in the per-query context so it will go away at
+        * ExecutorEnd.
         */
        if (queryDesc->totaltime == NULL)
        {
@@ -184,11 +184,11 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
 {
    if (queryDesc->totaltime && auto_explain_enabled())
    {
-       double  msec;
+       double      msec;
 
        /*
-        * Make sure stats accumulation is done.  (Note: it's okay if
-        * several levels of hook all do this.)
+        * Make sure stats accumulation is done.  (Note: it's okay if several
+        * levels of hook all do this.)
         */
        InstrEndLoop(queryDesc->totaltime);
 
@@ -196,11 +196,11 @@ explain_ExecutorEnd(QueryDesc *queryDesc)
        msec = queryDesc->totaltime->total * 1000.0;
        if (msec >= auto_explain_log_min_duration)
        {
-           StringInfoData  buf;
+           StringInfoData buf;
 
            initStringInfo(&buf);
            ExplainPrintPlan(&buf, queryDesc,
-                            queryDesc->doInstrument && auto_explain_log_analyze,
+                        queryDesc->doInstrument && auto_explain_log_analyze,
                             auto_explain_log_verbose);
 
            /* Remove last line break */
index 164eeb8d3b12685d674f348c364132a0d2a0c047..6fae89cad57c4a8be66b375bb9d1b936fc8e0e16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gin/btree_gin.c,v 1.1 2009/03/25 23:20:01 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/btree_gin/btree_gin.c,v 1.2 2009/06/11 14:48:50 momjian Exp $
  */
 #include "postgres.h"
 
@@ -19,20 +19,20 @@ PG_MODULE_MAGIC;
 
 typedef struct TypeInfo
 {
-    bool    is_varlena;
-   Datum   (*leftmostvalue)(void);
-   Datum   (*typecmp)(FunctionCallInfo);
+   bool        is_varlena;
+   Datum       (*leftmostvalue) (void);
+   Datum       (*typecmp) (FunctionCallInfo);
 } TypeInfo;
 
 typedef struct QueryInfo
 {
-   StrategyNumber      strategy;
-   Datum               datum;
+   StrategyNumber strategy;
+   Datum       datum;
 } QueryInfo;
 
 #define  GIN_EXTRACT_VALUE(type)                                           \
 PG_FUNCTION_INFO_V1(gin_extract_value_##type);                             \
-Datum       gin_extract_value_##type(PG_FUNCTION_ARGS);                        \
+Datum      gin_extract_value_##type(PG_FUNCTION_ARGS);                     \
 Datum                                                                      \
 gin_extract_value_##type(PG_FUNCTION_ARGS)                                 \
 {                                                                          \
@@ -59,7 +59,7 @@ gin_extract_value_##type(PG_FUNCTION_ARGS)                                    \
 
 #define GIN_EXTRACT_QUERY(type)                                                \
 PG_FUNCTION_INFO_V1(gin_extract_query_##type);                             \
-Datum       gin_extract_query_##type(PG_FUNCTION_ARGS);                        \
+Datum      gin_extract_query_##type(PG_FUNCTION_ARGS);                     \
 Datum                                                                      \
 gin_extract_query_##type(PG_FUNCTION_ARGS)                                 \
 {                                                                          \
@@ -67,7 +67,7 @@ gin_extract_query_##type(PG_FUNCTION_ARGS)                                    \
    int32      *nentries = (int32 *) PG_GETARG_POINTER(1);                  \
    StrategyNumber strategy = PG_GETARG_UINT16(2);                          \
    bool      **partialmatch = (bool **) PG_GETARG_POINTER(3);              \
-   Pointer   **extra_data = (Pointer **) PG_GETARG_POINTER(4);             \
+   Pointer   **extra_data = (Pointer **) PG_GETARG_POINTER(4);             \
    Datum      *entries = (Datum *) palloc(sizeof(Datum));                  \
    QueryInfo  *data = (QueryInfo *) palloc(sizeof(QueryInfo));             \
    bool       *ptr_partialmatch;                                           \
@@ -109,7 +109,7 @@ gin_extract_query_##type(PG_FUNCTION_ARGS)                                  \
  */
 #define GIN_COMPARE_PREFIX(type)                                           \
 PG_FUNCTION_INFO_V1(gin_compare_prefix_##type);                                \
-Datum       gin_compare_prefix_##type(PG_FUNCTION_ARGS);                   \
+Datum      gin_compare_prefix_##type(PG_FUNCTION_ARGS);                    \
 Datum                                                                      \
 gin_compare_prefix_##type(PG_FUNCTION_ARGS)                                    \
 {                                                                          \
@@ -120,10 +120,10 @@ gin_compare_prefix_##type(PG_FUNCTION_ARGS)                                   \
                cmp;                                                        \
                                                                            \
    cmp = DatumGetInt32(DirectFunctionCall2(                                \
-               TypeInfo_##type.typecmp,                                    \
-               (data->strategy == BTLessStrategyNumber ||                  \
+               TypeInfo_##type.typecmp,                                    \
+               (data->strategy == BTLessStrategyNumber ||                  \
                 data->strategy == BTLessEqualStrategyNumber)               \
-                ? data->datum : a,                                         \
+                ? data->datum : a,                                         \
                b));                                                        \
                                                                            \
    switch (data->strategy)                                                 \
@@ -166,7 +166,7 @@ gin_compare_prefix_##type(PG_FUNCTION_ARGS)                                 \
                res = 1;                                                    \
            break;                                                          \
        default:                                                            \
-           elog(ERROR, "unrecognized strategy number: %d",                 \
+           elog(ERROR, "unrecognized strategy number: %d",                 \
                 data->strategy);                                           \
            res = 0;                                                        \
    }                                                                       \
@@ -181,11 +181,11 @@ gin_compare_prefix_##type(PG_FUNCTION_ARGS)                                   \
 
 
 PG_FUNCTION_INFO_V1(gin_btree_consistent);
-Datum       gin_btree_consistent(PG_FUNCTION_ARGS);
+Datum      gin_btree_consistent(PG_FUNCTION_ARGS);
 Datum
 gin_btree_consistent(PG_FUNCTION_ARGS)
 {
-   bool       *recheck = (bool *) PG_GETARG_POINTER(5);
+   bool       *recheck = (bool *) PG_GETARG_POINTER(5);
 
    *recheck = false;
    PG_RETURN_BOOL(true);
@@ -197,6 +197,7 @@ leftmostvalue_int2(void)
    return Int16GetDatum(SHRT_MIN);
 }
 static TypeInfo TypeInfo_int2 = {false, leftmostvalue_int2, btint2cmp};
+
 GIN_SUPPORT(int2)
 
 static Datum
@@ -205,18 +206,20 @@ leftmostvalue_int4(void)
    return Int32GetDatum(INT_MIN);
 }
 static TypeInfo TypeInfo_int4 = {false, leftmostvalue_int4, btint4cmp};
+
 GIN_SUPPORT(int4)
 
 static Datum
 leftmostvalue_int8(void)
 {
    /*
-    * Use sequence's definition to keep compatibility.
-    * Another way may make a problem with INT64_IS_BUSTED
+    * Use sequence's definition to keep compatibility. Another way may make a
+    * problem with INT64_IS_BUSTED
     */
    return Int64GetDatum(SEQ_MINVALUE);
 }
 static TypeInfo TypeInfo_int8 = {false, leftmostvalue_int8, btint8cmp};
+
 GIN_SUPPORT(int8)
 
 static Datum
@@ -225,6 +228,7 @@ leftmostvalue_float4(void)
    return Float4GetDatum(-get_float4_infinity());
 }
 static TypeInfo TypeInfo_float4 = {false, leftmostvalue_float4, btfloat4cmp};
+
 GIN_SUPPORT(float4)
 
 static Datum
@@ -233,18 +237,20 @@ leftmostvalue_float8(void)
    return Float8GetDatum(-get_float8_infinity());
 }
 static TypeInfo TypeInfo_float8 = {false, leftmostvalue_float8, btfloat8cmp};
+
 GIN_SUPPORT(float8)
 
 static Datum
 leftmostvalue_money(void)
 {
    /*
-    * Use sequence's definition to keep compatibility.
-    * Another way may make a problem with INT64_IS_BUSTED
+    * Use sequence's definition to keep compatibility. Another way may make a
+    * problem with INT64_IS_BUSTED
     */
    return Int64GetDatum(SEQ_MINVALUE);
 }
 static TypeInfo TypeInfo_money = {false, leftmostvalue_money, cash_cmp};
+
 GIN_SUPPORT(money)
 
 static Datum
@@ -253,6 +259,7 @@ leftmostvalue_oid(void)
    return ObjectIdGetDatum(0);
 }
 static TypeInfo TypeInfo_oid = {false, leftmostvalue_oid, btoidcmp};
+
 GIN_SUPPORT(oid)
 
 static Datum
@@ -261,9 +268,11 @@ leftmostvalue_timestamp(void)
    return TimestampGetDatum(DT_NOBEGIN);
 }
 static TypeInfo TypeInfo_timestamp = {false, leftmostvalue_timestamp, timestamp_cmp};
+
 GIN_SUPPORT(timestamp)
 
 static TypeInfo TypeInfo_timestamptz = {false, leftmostvalue_timestamp, timestamp_cmp};
+
 GIN_SUPPORT(timestamptz)
 
 static Datum
@@ -272,19 +281,21 @@ leftmostvalue_time(void)
    return TimeADTGetDatum(0);
 }
 static TypeInfo TypeInfo_time = {false, leftmostvalue_time, time_cmp};
+
 GIN_SUPPORT(time)
 
 static Datum
 leftmostvalue_timetz(void)
 {
-   TimeTzADT   *v = palloc(sizeof(TimeTzADT));
+   TimeTzADT  *v = palloc(sizeof(TimeTzADT));
 
    v->time = 0;
-   v->zone = -24*3600; /* XXX is that true? */
+   v->zone = -24 * 3600;       /* XXX is that true? */
 
    return TimeTzADTPGetDatum(v);
 }
 static TypeInfo TypeInfo_timetz = {false, leftmostvalue_timetz, timetz_cmp};
+
 GIN_SUPPORT(timetz)
 
 static Datum
@@ -293,12 +304,13 @@ leftmostvalue_date(void)
    return DateADTGetDatum(DATEVAL_NOBEGIN);
 }
 static TypeInfo TypeInfo_date = {false, leftmostvalue_date, date_cmp};
+
 GIN_SUPPORT(date)
 
 static Datum
 leftmostvalue_interval(void)
 {
-   Interval *v = palloc(sizeof(Interval));
+   Interval   *v = palloc(sizeof(Interval));
 
    v->time = DT_NOBEGIN;
    v->day = 0;
@@ -306,16 +318,18 @@ leftmostvalue_interval(void)
    return IntervalPGetDatum(v);
 }
 static TypeInfo TypeInfo_interval = {false, leftmostvalue_interval, interval_cmp};
+
 GIN_SUPPORT(interval)
 
 static Datum
 leftmostvalue_macaddr(void)
 {
-   macaddr *v = palloc0(sizeof(macaddr));
+   macaddr    *v = palloc0(sizeof(macaddr));
 
    return MacaddrPGetDatum(v);
 }
 static TypeInfo TypeInfo_macaddr = {false, leftmostvalue_macaddr, macaddr_cmp};
+
 GIN_SUPPORT(macaddr)
 
 static Datum
@@ -327,9 +341,11 @@ leftmostvalue_inet(void)
                               Int32GetDatum(-1));
 }
 static TypeInfo TypeInfo_inet = {true, leftmostvalue_inet, network_cmp};
+
 GIN_SUPPORT(inet)
 
 static TypeInfo TypeInfo_cidr = {true, leftmostvalue_inet, network_cmp};
+
 GIN_SUPPORT(cidr)
 
 static Datum
@@ -338,6 +354,7 @@ leftmostvalue_text(void)
    return PointerGetDatum(cstring_to_text_with_len("", 0));
 }
 static TypeInfo TypeInfo_text = {true, leftmostvalue_text, bttextcmp};
+
 GIN_SUPPORT(text)
 
 static Datum
@@ -346,9 +363,11 @@ leftmostvalue_char(void)
    return CharGetDatum(SCHAR_MIN);
 }
 static TypeInfo TypeInfo_char = {false, leftmostvalue_char, btcharcmp};
+
 GIN_SUPPORT(char)
 
 static TypeInfo TypeInfo_bytea = {true, leftmostvalue_text, byteacmp};
+
 GIN_SUPPORT(bytea)
 
 static Datum
@@ -360,6 +379,7 @@ leftmostvalue_bit(void)
                               Int32GetDatum(-1));
 }
 static TypeInfo TypeInfo_bit = {true, leftmostvalue_bit, bitcmp};
+
 GIN_SUPPORT(bit)
 
 static Datum
@@ -371,6 +391,7 @@ leftmostvalue_varbit(void)
                               Int32GetDatum(-1));
 }
 static TypeInfo TypeInfo_varbit = {true, leftmostvalue_varbit, bitcmp};
+
 GIN_SUPPORT(varbit)
 
 /*
@@ -383,20 +404,20 @@ GIN_SUPPORT(varbit)
 #define NUMERIC_IS_LEFTMOST(x) ((x) == NULL)
 
 PG_FUNCTION_INFO_V1(gin_numeric_cmp);
-Datum       gin_numeric_cmp(PG_FUNCTION_ARGS);
+Datum      gin_numeric_cmp(PG_FUNCTION_ARGS);
 
 Datum
 gin_numeric_cmp(PG_FUNCTION_ARGS)
 {
-   Numeric a = (Numeric)PG_GETARG_POINTER(0);
-   Numeric b = (Numeric)PG_GETARG_POINTER(1);
-   int     res = 0;
+   Numeric     a = (Numeric) PG_GETARG_POINTER(0);
+   Numeric     b = (Numeric) PG_GETARG_POINTER(1);
+   int         res = 0;
 
-   if ( NUMERIC_IS_LEFTMOST(a) )
+   if (NUMERIC_IS_LEFTMOST(a))
    {
-       res = ( NUMERIC_IS_LEFTMOST(b) ) ? 0 : -1;
+       res = (NUMERIC_IS_LEFTMOST(b)) ? 0 : -1;
    }
-   else if ( NUMERIC_IS_LEFTMOST(b) )
+   else if (NUMERIC_IS_LEFTMOST(b))
    {
        res = 1;
    }
@@ -417,4 +438,5 @@ leftmostvalue_numeric(void)
 }
 
 static TypeInfo TypeInfo_numeric = {true, leftmostvalue_numeric, gin_numeric_cmp};
+
 GIN_SUPPORT(numeric)
index feadf6be48ba1c0370c7890f65b5ccf2303d4df6..3c5a2e0ce5b33a2ddfde0788e43efa09610ae937 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_bit.c,v 1.9 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_bit.c,v 1.10 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_var.h"
@@ -82,7 +82,7 @@ gbt_bit_xfrm(bytea *leaf)
 
 
 static GBT_VARKEY *
-gbt_bit_l2n(GBT_VARKEY * leaf)
+gbt_bit_l2n(GBT_VARKEY *leaf)
 {
 
    GBT_VARKEY *out = leaf;
@@ -131,6 +131,7 @@ gbt_bit_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    void       *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        retval = FALSE;
index 9619a7a0af09acf91511b09dd97ba7641a6d811f..9977b201c6a999c230735bbd6e5ff2602322dba0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_bytea.c,v 1.8 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_bytea.c,v 1.9 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_var.h"
@@ -101,6 +101,7 @@ gbt_bytea_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    void       *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        retval;
index 4543b082e9c4b83b68690f98124182f9532f9582..fbc79c133083ca5e3e1daf49c1a43c208e20bb41 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_cash.c,v 1.8 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_cash.c,v 1.9 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -9,7 +9,7 @@ typedef struct
 {
    Cash        lower;
    Cash        upper;
-}  cashKEY;
+} cashKEY;
 
 /*
 ** Cash ops
@@ -101,6 +101,7 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    Cash        query = PG_GETARG_CASH(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    cashKEY    *kkk = (cashKEY *) DatumGetPointer(entry->key);
@@ -109,8 +110,8 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index 5ee7273a0b95a1cc9f50ba36a2e6912f82b9a8e9..b9929922fec73533e86bffaad2ea069a86e091af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_date.c,v 1.6 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_date.c,v 1.7 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -9,7 +9,7 @@ typedef struct
 {
    DateADT     lower;
    DateADT     upper;
-}  dateKEY;
+} dateKEY;
 
 /*
 ** date ops
@@ -117,6 +117,7 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    DateADT     query = PG_GETARG_DATEADT(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    dateKEY    *kkk = (dateKEY *) DatumGetPointer(entry->key);
@@ -125,8 +126,8 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index 1def7479e0c0347c6eea55075224c1b3956fa42c..3a508ec0a6caaf5f37e9c9a004d7ee19b9bb1d84 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_float4.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_float4.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -8,7 +8,7 @@ typedef struct float4key
 {
    float4      lower;
    float4      upper;
-}  float4KEY;
+} float4KEY;
 
 /*
 ** float4 ops
@@ -100,6 +100,7 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    float4      query = PG_GETARG_FLOAT4(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    float4KEY  *kkk = (float4KEY *) DatumGetPointer(entry->key);
@@ -108,8 +109,8 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index 6117adf19e5da4da40c5f9bffc61e86294de15ab..66e63f31f86c3ec1c6dcffa5a427402ec0229e45 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_float8.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_float8.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -8,7 +8,7 @@ typedef struct float8key
 {
    float8      lower;
    float8      upper;
-}  float8KEY;
+} float8KEY;
 
 /*
 ** float8 ops
@@ -101,6 +101,7 @@ gbt_float8_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    float8      query = PG_GETARG_FLOAT8(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    float8KEY  *kkk = (float8KEY *) DatumGetPointer(entry->key);
@@ -109,8 +110,8 @@ gbt_float8_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index d3befb04f79d1be8dae8cb7e28146b494aaa949d..f109de4a6483b1b42685dcac2269d9bcca951317 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_gist.c,v 1.12 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_gist.c,v 1.13 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 
index dd708fb889ad2cd5bc175a4b2c1be1f31a6bcb99..425ce8cff4c3ee8423847dfe7dbe2580790231d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_gist.h,v 1.8 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_gist.h,v 1.9 2009/06/11 14:48:50 momjian Exp $
  */
 #ifndef __BTREE_GIST_H__
 #define __BTREE_GIST_H__
index d8c85d7433d3c48127b0cd63ae5bf1d06598ddee..32f9d11102dc2048c4cc8bf35dff9bfc5df63dfc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_inet.c,v 1.9 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_inet.c,v 1.10 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -11,7 +11,7 @@ typedef struct inetkey
 {
    double      lower;
    double      upper;
-}  inetKEY;
+} inetKEY;
 
 /*
 ** inet ops
@@ -118,6 +118,7 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    double      query = convert_network_to_scalar(PG_GETARG_DATUM(1), INETOID);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    inetKEY    *kkk = (inetKEY *) DatumGetPointer(entry->key);
@@ -126,8 +127,8 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are inexact */
    *recheck = true;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query,
                                      &strategy, GIST_LEAF(entry), &tinfo));
index fa03f364f8ec1cdbaa4d489c265aedd38dea39c5..4a1b1c4a3980dafecbdf3326f99adce6f3196d27 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_int2.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_int2.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -8,7 +8,7 @@ typedef struct int16key
 {
    int16       lower;
    int16       upper;
-}  int16KEY;
+} int16KEY;
 
 /*
 ** int16 ops
@@ -104,6 +104,7 @@ gbt_int2_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    int16       query = PG_GETARG_INT16(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    int16KEY   *kkk = (int16KEY *) DatumGetPointer(entry->key);
@@ -112,8 +113,8 @@ gbt_int2_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index 5d9b1a19f9c25603cef0dd2efb65801adc49c5d0..f3c29f60513067ac6d190febddda15807cf8437d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_int4.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_int4.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -8,7 +8,7 @@ typedef struct int32key
 {
    int32       lower;
    int32       upper;
-}  int32KEY;
+} int32KEY;
 
 /*
 ** int32 ops
@@ -101,6 +101,7 @@ gbt_int4_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    int32       query = PG_GETARG_INT32(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    int32KEY   *kkk = (int32KEY *) DatumGetPointer(entry->key);
@@ -109,8 +110,8 @@ gbt_int4_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index 59493081bdd73c599f34f0408ddd06d34c4d0940..c65e1d214dafd4649a09e76e84411982375e231c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_int8.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_int8.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -8,7 +8,7 @@ typedef struct int64key
 {
    int64       lower;
    int64       upper;
-}  int64KEY;
+} int64KEY;
 
 /*
 ** int64 ops
@@ -101,6 +101,7 @@ gbt_int8_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    int64       query = PG_GETARG_INT64(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    int64KEY   *kkk = (int64KEY *) DatumGetPointer(entry->key);
@@ -109,8 +110,8 @@ gbt_int8_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index e5c096cfda623d2b38ae70c772d5a5f7749b8c77..b1368479237f5d8c55855987144890572263c785 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_interval.c,v 1.11 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_interval.c,v 1.12 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -9,7 +9,7 @@ typedef struct
 {
    Interval    lower,
                upper;
-}  intvKEY;
+} intvKEY;
 
 
 /*
@@ -169,6 +169,7 @@ gbt_intv_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    Interval   *query = PG_GETARG_INTERVAL_P(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    intvKEY    *kkk = (intvKEY *) DatumGetPointer(entry->key);
@@ -177,8 +178,8 @@ gbt_intv_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo)
index da57e6d4e34663291579670700594dd0e70f7b64..5c5030faecc1187e1c6453238cbb3928233e2797 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_macaddr.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_macaddr.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -10,7 +10,7 @@ typedef struct
 {
    macaddr     lower;
    macaddr     upper;
-}  macKEY;
+} macKEY;
 
 /*
 ** OID ops
@@ -122,6 +122,7 @@ gbt_macad_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    macaddr    *query = (macaddr *) PG_GETARG_POINTER(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    macKEY     *kkk = (macKEY *) DatumGetPointer(entry->key);
@@ -130,8 +131,8 @@ gbt_macad_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo)
index 7b52d07353d5f67d9c8ffb205c1c66419928a9fd..810bb279daa9371fd7b217f8c5ba7c6220221806 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_numeric.c,v 1.12 2008/06/19 00:46:02 alvherre Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_numeric.c,v 1.13 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 
@@ -106,6 +106,7 @@ gbt_numeric_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    void       *query = (void *) DatumGetNumeric(PG_GETARG_DATUM(1));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        retval;
index 3334275530a60a6f2bc602115fa07fedf4d3f392..6a0805635df44f25fff9ed50aee890753d981c3b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_oid.c,v 1.7 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_oid.c,v 1.8 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -8,7 +8,7 @@ typedef struct
 {
    Oid         lower;
    Oid         upper;
-}  oidKEY;
+} oidKEY;
 
 /*
 ** OID ops
@@ -101,6 +101,7 @@ gbt_oid_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    Oid         query = PG_GETARG_OID(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    oidKEY     *kkk = (oidKEY *) DatumGetPointer(entry->key);
@@ -109,8 +110,8 @@ gbt_oid_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
index a0e817780e8290954de65841a992844262b22944..8b01eb7aac984fc0dd7385131861034610d54948 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_text.c,v 1.11 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_text.c,v 1.12 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_var.h"
@@ -135,6 +135,7 @@ gbt_text_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    void       *query = (void *) DatumGetTextP(PG_GETARG_DATUM(1));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        retval;
@@ -161,6 +162,7 @@ gbt_bpchar_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    void       *query = (void *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1)));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        retval;
index fff5e3b44699e8b30d97315e9899d84833d43ad7..7287755fc7081ef0a68f299cee3e3bfca80ef63c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_time.c,v 1.15 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_time.c,v 1.16 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -10,7 +10,7 @@ typedef struct
 {
    TimeADT     lower;
    TimeADT     upper;
-}  timeKEY;
+} timeKEY;
 
 /*
 ** time ops
@@ -175,6 +175,7 @@ gbt_time_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    TimeADT     query = PG_GETARG_TIMEADT(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    timeKEY    *kkk = (timeKEY *) DatumGetPointer(entry->key);
@@ -183,8 +184,8 @@ gbt_time_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
@@ -197,6 +198,7 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    TimeTzADT  *query = PG_GETARG_TIMETZADT_P(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    timeKEY    *kkk = (timeKEY *) DatumGetPointer(entry->key);
@@ -212,8 +214,8 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS)
    qqq = (query->time + query->zone);
 #endif
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo)
@@ -244,15 +246,15 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
 
    intr = DatumGetIntervalP(DirectFunctionCall2(
                                                 time_mi_time,
-                                         TimeADTGetDatumFast(newentry->upper),
-                                      TimeADTGetDatumFast(origentry->upper)));
+                                       TimeADTGetDatumFast(newentry->upper),
+                                    TimeADTGetDatumFast(origentry->upper)));
    res = INTERVAL_TO_SEC(intr);
    res = Max(res, 0);
 
    intr = DatumGetIntervalP(DirectFunctionCall2(
                                                 time_mi_time,
-                                        TimeADTGetDatumFast(origentry->lower),
-                                       TimeADTGetDatumFast(newentry->lower)));
+                                      TimeADTGetDatumFast(origentry->lower),
+                                     TimeADTGetDatumFast(newentry->lower)));
    res2 = INTERVAL_TO_SEC(intr);
    res2 = Max(res2, 0);
 
@@ -264,8 +266,8 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
    {
        intr = DatumGetIntervalP(DirectFunctionCall2(
                                                     time_mi_time,
-                                        TimeADTGetDatumFast(origentry->upper),
-                                      TimeADTGetDatumFast(origentry->lower)));
+                                      TimeADTGetDatumFast(origentry->upper),
+                                    TimeADTGetDatumFast(origentry->lower)));
        *result += FLT_MIN;
        *result += (float) (res / (res + INTERVAL_TO_SEC(intr)));
        *result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1));
index c20699fa914b82dc418c593723725e00194bbfa4..e0780ef3914d39fb54a036b0e0818500c6229592 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_ts.c,v 1.16 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_ts.c,v 1.17 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -9,7 +9,7 @@ typedef struct
 {
    Timestamp   lower;
    Timestamp   upper;
-}  tsKEY;
+} tsKEY;
 
 /*
 ** timestamp ops
@@ -192,6 +192,7 @@ gbt_ts_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    Timestamp   query = PG_GETARG_TIMESTAMP(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    tsKEY      *kkk = (tsKEY *) DatumGetPointer(entry->key);
@@ -200,8 +201,8 @@ gbt_ts_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk->lower;
-   key.upper = (GBT_NUMKEY *) & kkk->upper;
+   key.lower = (GBT_NUMKEY *) &kkk->lower;
+   key.upper = (GBT_NUMKEY *) &kkk->upper;
 
    PG_RETURN_BOOL(
                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
@@ -212,8 +213,9 @@ Datum
 gbt_tstz_consistent(PG_FUNCTION_ARGS)
 {
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-   TimestampTz query = PG_GETARG_TIMESTAMPTZ(1);
+   TimestampTz query = PG_GETARG_TIMESTAMPTZ(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    char       *kkk = (char *) DatumGetPointer(entry->key);
@@ -223,8 +225,8 @@ gbt_tstz_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are exact */
    *recheck = false;
 
-   key.lower = (GBT_NUMKEY *) & kkk[0];
-   key.upper = (GBT_NUMKEY *) & kkk[MAXALIGN(tinfo.size)];
+   key.lower = (GBT_NUMKEY *) &kkk[0];
+   key.upper = (GBT_NUMKEY *) &kkk[MAXALIGN(tinfo.size)];
    qqq = tstz_to_ts_gmt(query);
 
    PG_RETURN_BOOL(
index 357a8f165b6fa5ce1f967c08f8fcf7de4d352607..ff206dcda8288615e8810aef7c4083e382a63114 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_num.c,v 1.11 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_num.c,v 1.12 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 #include "btree_utils_num.h"
@@ -8,7 +8,7 @@
 
 
 GISTENTRY *
-gbt_num_compress(GISTENTRY *retval, GISTENTRY *entry, const gbtree_ninfo * tinfo)
+gbt_num_compress(GISTENTRY *retval, GISTENTRY *entry, const gbtree_ninfo *tinfo)
 {
    if (entry->leafkey)
    {
@@ -94,7 +94,7 @@ gbt_num_compress(GISTENTRY *retval, GISTENTRY *entry, const gbtree_ninfo * tinfo
 */
 
 void *
-gbt_num_union(GBT_NUMKEY * out, const GistEntryVector *entryvec, const gbtree_ninfo * tinfo)
+gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec, const gbtree_ninfo *tinfo)
 {
    int         i,
                numranges;
@@ -132,7 +132,7 @@ gbt_num_union(GBT_NUMKEY * out, const GistEntryVector *entryvec, const gbtree_ni
 */
 
 bool
-gbt_num_same(const GBT_NUMKEY * a, const GBT_NUMKEY * b, const gbtree_ninfo * tinfo)
+gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b, const gbtree_ninfo *tinfo)
 {
 
    GBT_NUMKEY_R b1,
@@ -154,7 +154,7 @@ gbt_num_same(const GBT_NUMKEY * a, const GBT_NUMKEY * b, const gbtree_ninfo * ti
 
 
 void
-gbt_num_bin_union(Datum *u, GBT_NUMKEY * e, const gbtree_ninfo * tinfo)
+gbt_num_bin_union(Datum *u, GBT_NUMKEY *e, const gbtree_ninfo *tinfo)
 {
 
    GBT_NUMKEY_R rd;
@@ -189,11 +189,11 @@ gbt_num_bin_union(Datum *u, GBT_NUMKEY * e, const gbtree_ninfo * tinfo)
 
 bool
 gbt_num_consistent(
-                  const GBT_NUMKEY_R * key,
+                  const GBT_NUMKEY_R *key,
                   const void *query,
                   const StrategyNumber *strategy,
                   bool is_leaf,
-                  const gbtree_ninfo * tinfo
+                  const gbtree_ninfo *tinfo
 )
 {
 
@@ -235,7 +235,7 @@ gbt_num_consistent(
 
 GIST_SPLITVEC *
 gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
-                 const gbtree_ninfo * tinfo)
+                 const gbtree_ninfo *tinfo)
 {
    OffsetNumber i,
                maxoff = entryvec->n - 1;
index 42573aa8e8013466e66275a0e91d3d1104d4bed7..dcd17bc4307620a56db86e7c9115cf61ba4615ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_num.h,v 1.13 2008/06/19 00:46:02 alvherre Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_num.h,v 1.14 2009/06/11 14:48:50 momjian Exp $
  */
 #ifndef __BTREE_UTILS_NUM_H__
 #define __BTREE_UTILS_NUM_H__
@@ -17,7 +17,7 @@ typedef struct
 {
    const GBT_NUMKEY *lower,
               *upper;
-}  GBT_NUMKEY_R;
+} GBT_NUMKEY_R;
 
 
 /* for sorting */
@@ -25,7 +25,7 @@ typedef struct
 {
    int         i;
    GBT_NUMKEY *t;
-}  Nsrt;
+} Nsrt;
 
 
 /* type description */
@@ -46,7 +46,7 @@ typedef struct
    bool        (*f_le) (const void *, const void *);   /* less equal */
    bool        (*f_lt) (const void *, const void *);   /* less then */
    int         (*f_cmp) (const void *, const void *);  /* key compare function */
-}  gbtree_ninfo;
+} gbtree_ninfo;
 
 
 /*
@@ -92,24 +92,24 @@ typedef struct
 #endif
 
 
-extern bool gbt_num_consistent(const GBT_NUMKEY_R * key, const void *query,
+extern bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query,
                   const StrategyNumber *strategy, bool is_leaf,
-                  const gbtree_ninfo * tinfo);
+                  const gbtree_ninfo *tinfo);
 
 extern GIST_SPLITVEC *gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
-                 const gbtree_ninfo * tinfo);
+                 const gbtree_ninfo *tinfo);
 
 extern GISTENTRY *gbt_num_compress(GISTENTRY *retval, GISTENTRY *entry,
-                const gbtree_ninfo * tinfo);
+                const gbtree_ninfo *tinfo);
 
 
-extern void *gbt_num_union(GBT_NUMKEY * out, const GistEntryVector *entryvec,
-             const gbtree_ninfo * tinfo);
+extern void *gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec,
+             const gbtree_ninfo *tinfo);
 
-extern bool gbt_num_same(const GBT_NUMKEY * a, const GBT_NUMKEY * b,
-            const gbtree_ninfo * tinfo);
+extern bool gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b,
+            const gbtree_ninfo *tinfo);
 
-extern void gbt_num_bin_union(Datum *u, GBT_NUMKEY * e,
-                 const gbtree_ninfo * tinfo);
+extern void gbt_num_bin_union(Datum *u, GBT_NUMKEY *e,
+                 const gbtree_ninfo *tinfo);
 
 #endif
index 4f1b7e49a3535ce66ca330f2045a63ab0193855c..57d12e4cda22ff0aa5c5ce4ff140f31dea5fba20 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_var.c,v 1.20 2008/06/19 00:46:02 alvherre Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_var.c,v 1.21 2009/06/11 14:48:50 momjian Exp $
  */
 #include "btree_gist.h"
 
@@ -38,7 +38,7 @@ gbt_var_decompress(PG_FUNCTION_ARGS)
 
 /* Returns a better readable representaion of variable key ( sets pointer ) */
 GBT_VARKEY_R
-gbt_var_key_readable(const GBT_VARKEY * k)
+gbt_var_key_readable(const GBT_VARKEY *k)
 {
 
    GBT_VARKEY_R r;
@@ -53,7 +53,7 @@ gbt_var_key_readable(const GBT_VARKEY * k)
 
 
 GBT_VARKEY *
-gbt_var_key_copy(const GBT_VARKEY_R * u, bool force_node)
+gbt_var_key_copy(const GBT_VARKEY_R *u, bool force_node)
 {
    GBT_VARKEY *r = NULL;
 
@@ -75,7 +75,7 @@ gbt_var_key_copy(const GBT_VARKEY_R * u, bool force_node)
 
 
 static GBT_VARKEY *
-gbt_var_leaf2node(GBT_VARKEY * leaf, const gbtree_vinfo * tinfo)
+gbt_var_leaf2node(GBT_VARKEY *leaf, const gbtree_vinfo *tinfo)
 {
    GBT_VARKEY *out = leaf;
 
@@ -90,7 +90,7 @@ gbt_var_leaf2node(GBT_VARKEY * leaf, const gbtree_vinfo * tinfo)
  * returns the common prefix length of a node key
 */
 static int32
-gbt_var_node_cp_len(const GBT_VARKEY * node, const gbtree_vinfo * tinfo)
+gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
 {
 
    GBT_VARKEY_R r = gbt_var_key_readable(node);
@@ -141,7 +141,7 @@ gbt_var_node_cp_len(const GBT_VARKEY * node, const gbtree_vinfo * tinfo)
  * returns true, if query matches prefix ( common prefix )
 */
 static bool
-gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo * tinfo)
+gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo *tinfo)
 {
 
    bool        out = FALSE;
@@ -186,7 +186,7 @@ gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo * tin
 */
 
 static bool
-gbt_var_node_pf_match(const GBT_VARKEY_R * node, const bytea *query, const gbtree_vinfo * tinfo)
+gbt_var_node_pf_match(const GBT_VARKEY_R *node, const bytea *query, const gbtree_vinfo *tinfo)
 {
 
    return (tinfo->trnc && (
@@ -202,7 +202,7 @@ gbt_var_node_pf_match(const GBT_VARKEY_R * node, const bytea *query, const gbtre
 *  cpf_length .. common prefix length
 */
 static GBT_VARKEY *
-gbt_var_node_truncate(const GBT_VARKEY * node, int32 cpf_length, const gbtree_vinfo * tinfo)
+gbt_var_node_truncate(const GBT_VARKEY *node, int32 cpf_length, const gbtree_vinfo *tinfo)
 {
    GBT_VARKEY *out = NULL;
    GBT_VARKEY_R r = gbt_var_key_readable(node);
@@ -231,7 +231,7 @@ gbt_var_node_truncate(const GBT_VARKEY * node, int32 cpf_length, const gbtree_vi
 
 
 void
-gbt_var_bin_union(Datum *u, GBT_VARKEY * e, const gbtree_vinfo * tinfo)
+gbt_var_bin_union(Datum *u, GBT_VARKEY *e, const gbtree_vinfo *tinfo)
 {
 
    GBT_VARKEY *nk = NULL;
@@ -279,7 +279,7 @@ gbt_var_bin_union(Datum *u, GBT_VARKEY * e, const gbtree_vinfo * tinfo)
 
 
 GISTENTRY *
-gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo * tinfo)
+gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo)
 {
 
    GISTENTRY  *retval;
@@ -307,7 +307,7 @@ gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo * tinfo)
 
 
 GBT_VARKEY *
-gbt_var_union(const GistEntryVector *entryvec, int32 *size, const gbtree_vinfo * tinfo)
+gbt_var_union(const GistEntryVector *entryvec, int32 *size, const gbtree_vinfo *tinfo)
 {
 
    int         i = 0,
@@ -346,7 +346,7 @@ gbt_var_union(const GistEntryVector *entryvec, int32 *size, const gbtree_vinfo *
 
 
 bool
-gbt_var_same(bool *result, const Datum d1, const Datum d2, const gbtree_vinfo * tinfo)
+gbt_var_same(bool *result, const Datum d1, const Datum d2, const gbtree_vinfo *tinfo)
 {
 
    GBT_VARKEY *t1 = (GBT_VARKEY *) DatumGetPointer(d1);
@@ -371,7 +371,7 @@ gbt_var_same(bool *result, const Datum d1, const Datum d2, const gbtree_vinfo *
 
 
 float *
-gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n, const gbtree_vinfo * tinfo)
+gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n, const gbtree_vinfo *tinfo)
 {
 
    GBT_VARKEY *orge = (GBT_VARKEY *) DatumGetPointer(o->key);
@@ -449,7 +449,7 @@ gbt_vsrt_cmp(const void *a, const void *b, void *arg)
 }
 
 GIST_SPLITVEC *
-gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, const gbtree_vinfo * tinfo)
+gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, const gbtree_vinfo *tinfo)
 {
    OffsetNumber i,
                maxoff = entryvec->n - 1;
@@ -541,11 +541,11 @@ gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, const gbtre
  */
 bool
 gbt_var_consistent(
-                  GBT_VARKEY_R * key,
+                  GBT_VARKEY_R *key,
                   const void *query,
                   const StrategyNumber *strategy,
                   bool is_leaf,
-                  const gbtree_vinfo * tinfo
+                  const gbtree_vinfo *tinfo
 )
 {
    bool        retval = FALSE;
index 53d720adc55747a876f5afbe5c4b5e27c16d796d..49f5d59ee2413b3f3bc10d5ab7de143bc96da6b3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_var.h,v 1.8 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/btree_gist/btree_utils_var.h,v 1.9 2009/06/11 14:48:50 momjian Exp $
  */
 #ifndef __BTREE_UTILS_VAR_H__
 #define __BTREE_UTILS_VAR_H__
@@ -16,14 +16,14 @@ typedef struct
 {
    bytea      *lower,
               *upper;
-}  GBT_VARKEY_R;
+} GBT_VARKEY_R;
 
 /* used for key sorting */
 typedef struct
 {
    int         i;
    GBT_VARKEY *t;
-}  Vsrt;
+} Vsrt;
 
 /*
   type description
@@ -49,32 +49,32 @@ typedef struct
    bool        (*f_lt) (const void *, const void *);   /* less then */
    int32       (*f_cmp) (const bytea *, const bytea *);        /* node compare */
    GBT_VARKEY *(*f_l2n) (GBT_VARKEY *);        /* convert leaf to node */
-}  gbtree_vinfo;
+} gbtree_vinfo;
 
 
 
-extern GBT_VARKEY_R gbt_var_key_readable(const GBT_VARKEY * k);
+extern GBT_VARKEY_R gbt_var_key_readable(const GBT_VARKEY *k);
 
-extern GBT_VARKEY *gbt_var_key_copy(const GBT_VARKEY_R * u, bool force_node);
+extern GBT_VARKEY *gbt_var_key_copy(const GBT_VARKEY_R *u, bool force_node);
 
-extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo * tinfo);
+extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo);
 
 extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size,
-             const gbtree_vinfo * tinfo);
+             const gbtree_vinfo *tinfo);
 
 extern bool gbt_var_same(bool *result, const Datum d1, const Datum d2,
-            const gbtree_vinfo * tinfo);
+            const gbtree_vinfo *tinfo);
 
 extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
-               const gbtree_vinfo * tinfo);
+               const gbtree_vinfo *tinfo);
 
-extern bool gbt_var_consistent(GBT_VARKEY_R * key, const void *query,
+extern bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query,
                   const StrategyNumber *strategy, bool is_leaf,
-                  const gbtree_vinfo * tinfo);
+                  const gbtree_vinfo *tinfo);
 
 extern GIST_SPLITVEC *gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
-                 const gbtree_vinfo * tinfo);
-extern void gbt_var_bin_union(Datum *u, GBT_VARKEY * e,
-                 const gbtree_vinfo * tinfo);
+                 const gbtree_vinfo *tinfo);
+extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e,
+                 const gbtree_vinfo *tinfo);
 
 #endif
index ed6a7566b25eef4db268a176110edc576ac62e65..56a998ec839cc5d2469fe99e6c88b60e8b7a695e 100644 (file)
@@ -4,7 +4,7 @@
  * darcy@druid.net
  * http://www.druid.net/darcy/
  *
- * $PostgreSQL: pgsql/contrib/chkpass/chkpass.c,v 1.20 2008/03/25 22:42:41 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/chkpass/chkpass.c,v 1.21 2009/06/11 14:48:50 momjian Exp $
  * best viewed with tabs set to 4
  */
 
@@ -37,7 +37,7 @@ PG_MODULE_MAGIC;
 typedef struct chkpass
 {
    char        password[16];
-}  chkpass;
+} chkpass;
 
 /*
  * Various forward declarations:
index eb885c0037eb15e2e9d47ad71e73de486a38b507..371e70f74d799bd7743527d3f2f21bb4f866b62f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/citext/citext.c,v 1.1 2008/07/29 18:31:20 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/citext/citext.c,v 1.2 2009/06/11 14:48:50 momjian Exp $
  */
 #include "postgres.h"
 
@@ -13,27 +13,27 @@ PG_MODULE_MAGIC;
 #endif
 
 /*
- *      ====================
- *      FORWARD DECLARATIONS
- *      ====================
+ *     ====================
+ *     FORWARD DECLARATIONS
+ *     ====================
  */
 
-static int32  citextcmp      (text *left, text *right);
-extern Datum  citext_cmp     (PG_FUNCTION_ARGS);
-extern Datum  citext_hash    (PG_FUNCTION_ARGS);
-extern Datum  citext_eq      (PG_FUNCTION_ARGS);
-extern Datum  citext_ne      (PG_FUNCTION_ARGS);
-extern Datum  citext_gt      (PG_FUNCTION_ARGS);
-extern Datum  citext_ge      (PG_FUNCTION_ARGS);
-extern Datum  citext_lt      (PG_FUNCTION_ARGS);
-extern Datum  citext_le      (PG_FUNCTION_ARGS);
-extern Datum  citext_smaller (PG_FUNCTION_ARGS);
-extern Datum  citext_larger  (PG_FUNCTION_ARGS);
+static int32 citextcmp(text *left, text *right);
+extern Datum citext_cmp(PG_FUNCTION_ARGS);
+extern Datum citext_hash(PG_FUNCTION_ARGS);
+extern Datum citext_eq(PG_FUNCTION_ARGS);
+extern Datum citext_ne(PG_FUNCTION_ARGS);
+extern Datum citext_gt(PG_FUNCTION_ARGS);
+extern Datum citext_ge(PG_FUNCTION_ARGS);
+extern Datum citext_lt(PG_FUNCTION_ARGS);
+extern Datum citext_le(PG_FUNCTION_ARGS);
+extern Datum citext_smaller(PG_FUNCTION_ARGS);
+extern Datum citext_larger(PG_FUNCTION_ARGS);
 
 /*
- *      =================
- *      UTILITY FUNCTIONS
- *      =================
+ *     =================
+ *     UTILITY FUNCTIONS
+ *     =================
  */
 
 /*
@@ -42,27 +42,28 @@ extern Datum  citext_larger  (PG_FUNCTION_ARGS);
  * Returns int32 negative, zero, or positive.
  */
 static int32
-citextcmp (text *left, text *right)
+citextcmp(text *left, text *right)
 {
-   char   *lcstr, *rcstr;
-   int32   result;
+   char       *lcstr,
+              *rcstr;
+   int32       result;
 
-   lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left));
-   rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
+   lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left));
+   rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
 
-   result = varstr_cmp(lcstr, strlen(lcstr),
-                      rcstr, strlen(rcstr));
+   result = varstr_cmp(lcstr, strlen(lcstr),
+                       rcstr, strlen(rcstr));
 
-   pfree(lcstr);
-   pfree(rcstr);
+   pfree(lcstr);
+   pfree(rcstr);
 
-   return result;
+   return result;
 }
 
 /*
- *      ==================
- *      INDEXING FUNCTIONS
- *      ==================
+ *     ==================
+ *     INDEXING FUNCTIONS
+ *     ==================
  */
 
 PG_FUNCTION_INFO_V1(citext_cmp);
@@ -70,16 +71,16 @@ PG_FUNCTION_INFO_V1(citext_cmp);
 Datum
 citext_cmp(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   int32 result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   int32       result;
 
-   result = citextcmp(left, right);
+   result = citextcmp(left, right);
 
-   PG_FREE_IF_COPY(left, 0);
-   PG_FREE_IF_COPY(right, 1);
+   PG_FREE_IF_COPY(left, 0);
+   PG_FREE_IF_COPY(right, 1);
 
-   PG_RETURN_INT32(result);
+   PG_RETURN_INT32(result);
 }
 
 PG_FUNCTION_INFO_V1(citext_hash);
@@ -87,24 +88,24 @@ PG_FUNCTION_INFO_V1(citext_hash);
 Datum
 citext_hash(PG_FUNCTION_ARGS)
 {
-   text       *txt = PG_GETARG_TEXT_PP(0);
-   char       *str;
-   Datum       result;
+   text       *txt = PG_GETARG_TEXT_PP(0);
+   char       *str;
+   Datum       result;
 
-   str    = str_tolower(VARDATA_ANY(txt), VARSIZE_ANY_EXHDR(txt));
-   result = hash_any((unsigned char *) str, strlen(str));
-   pfree(str);
+   str = str_tolower(VARDATA_ANY(txt), VARSIZE_ANY_EXHDR(txt));
+   result = hash_any((unsigned char *) str, strlen(str));
+   pfree(str);
 
-   /* Avoid leaking memory for toasted inputs */
-   PG_FREE_IF_COPY(txt, 0);
+   /* Avoid leaking memory for toasted inputs */
+   PG_FREE_IF_COPY(txt, 0);
 
-   PG_RETURN_DATUM(result);
+   PG_RETURN_DATUM(result);
 }
 
 /*
- *      ==================
- *      OPERATOR FUNCTIONS
- *      ==================
+ *     ==================
+ *     OPERATOR FUNCTIONS
+ *     ==================
  */
 
 PG_FUNCTION_INFO_V1(citext_eq);
@@ -112,29 +113,29 @@ PG_FUNCTION_INFO_V1(citext_eq);
 Datum
 citext_eq(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   char *lcstr, *rcstr;
-   bool  result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   char       *lcstr,
+              *rcstr;
+   bool        result;
 
-   /* We can't compare lengths in advance of downcasing ... */
+   /* We can't compare lengths in advance of downcasing ... */
 
-   lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left));
-   rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
+   lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left));
+   rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
 
-   /*
-    * Since we only care about equality or not-equality, we can
-    * avoid all the expense of strcoll() here, and just do bitwise
-    * comparison.
-    */
-   result = (strcmp(lcstr, rcstr) == 0);
+   /*
+    * Since we only care about equality or not-equality, we can avoid all the
+    * expense of strcoll() here, and just do bitwise comparison.
+    */
+   result = (strcmp(lcstr, rcstr) == 0);
 
-   pfree(lcstr);
-   pfree(rcstr);
-   PG_FREE_IF_COPY(left, 0);
-   PG_FREE_IF_COPY(right, 1);
+   pfree(lcstr);
+   pfree(rcstr);
+   PG_FREE_IF_COPY(left, 0);
+   PG_FREE_IF_COPY(right, 1);
 
-   PG_RETURN_BOOL(result);
+   PG_RETURN_BOOL(result);
 }
 
 PG_FUNCTION_INFO_V1(citext_ne);
@@ -142,29 +143,29 @@ PG_FUNCTION_INFO_V1(citext_ne);
 Datum
 citext_ne(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   char *lcstr, *rcstr;
-   bool  result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   char       *lcstr,
+              *rcstr;
+   bool        result;
 
-   /* We can't compare lengths in advance of downcasing ... */
+   /* We can't compare lengths in advance of downcasing ... */
 
-   lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left));
-   rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
+   lcstr = str_tolower(VARDATA_ANY(left), VARSIZE_ANY_EXHDR(left));
+   rcstr = str_tolower(VARDATA_ANY(right), VARSIZE_ANY_EXHDR(right));
 
-   /*
-    * Since we only care about equality or not-equality, we can
-    * avoid all the expense of strcoll() here, and just do bitwise
-    * comparison.
-    */
-   result = (strcmp(lcstr, rcstr) != 0);
+   /*
+    * Since we only care about equality or not-equality, we can avoid all the
+    * expense of strcoll() here, and just do bitwise comparison.
+    */
+   result = (strcmp(lcstr, rcstr) != 0);
 
-   pfree(lcstr);
-   pfree(rcstr);
-   PG_FREE_IF_COPY(left, 0);
-   PG_FREE_IF_COPY(right, 1);
+   pfree(lcstr);
+   pfree(rcstr);
+   PG_FREE_IF_COPY(left, 0);
+   PG_FREE_IF_COPY(right, 1);
 
-   PG_RETURN_BOOL(result);
+   PG_RETURN_BOOL(result);
 }
 
 PG_FUNCTION_INFO_V1(citext_lt);
@@ -172,16 +173,16 @@ PG_FUNCTION_INFO_V1(citext_lt);
 Datum
 citext_lt(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   bool  result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   bool        result;
 
-   result = citextcmp(left, right) < 0;
+   result = citextcmp(left, right) < 0;
 
-   PG_FREE_IF_COPY(left, 0);
-   PG_FREE_IF_COPY(right, 1);
+   PG_FREE_IF_COPY(left, 0);
+   PG_FREE_IF_COPY(right, 1);
 
-   PG_RETURN_BOOL(result);
+   PG_RETURN_BOOL(result);
 }
 
 PG_FUNCTION_INFO_V1(citext_le);
@@ -189,16 +190,16 @@ PG_FUNCTION_INFO_V1(citext_le);
 Datum
 citext_le(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   bool  result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   bool        result;
 
-   result = citextcmp(left, right) <= 0;
+   result = citextcmp(left, right) <= 0;
 
-   PG_FREE_IF_COPY(left, 0);
-   PG_FREE_IF_COPY(right, 1);
+   PG_FREE_IF_COPY(left, 0);
+   PG_FREE_IF_COPY(right, 1);
 
-   PG_RETURN_BOOL(result);
+   PG_RETURN_BOOL(result);
 }
 
 PG_FUNCTION_INFO_V1(citext_gt);
@@ -206,16 +207,16 @@ PG_FUNCTION_INFO_V1(citext_gt);
 Datum
 citext_gt(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   bool  result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   bool        result;
 
-   result = citextcmp(left, right) > 0;
+   result = citextcmp(left, right) > 0;
 
-   PG_FREE_IF_COPY(left, 0);
-   PG_FREE_IF_COPY(right, 1);
+   PG_FREE_IF_COPY(left, 0);
+   PG_FREE_IF_COPY(right, 1);
 
-   PG_RETURN_BOOL(result);
+   PG_RETURN_BOOL(result);
 }
 
 PG_FUNCTION_INFO_V1(citext_ge);
@@ -223,22 +224,22 @@ PG_FUNCTION_INFO_V1(citext_ge);
 Datum
 citext_ge(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   bool  result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   bool        result;
 
-   result = citextcmp(left, right) >= 0;
+   result = citextcmp(left, right) >= 0;
 
-   PG_FREE_IF_COPY(left, 0);
-   PG_FREE_IF_COPY(right, 1);
+   PG_FREE_IF_COPY(left, 0);
+   PG_FREE_IF_COPY(right, 1);
 
-   PG_RETURN_BOOL(result);
+   PG_RETURN_BOOL(result);
 }
 
 /*
- *      ===================
- *      AGGREGATE FUNCTIONS
- *      ===================
+ *     ===================
+ *     AGGREGATE FUNCTIONS
+ *     ===================
  */
 
 PG_FUNCTION_INFO_V1(citext_smaller);
@@ -246,12 +247,12 @@ PG_FUNCTION_INFO_V1(citext_smaller);
 Datum
 citext_smaller(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   text *result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   text       *result;
 
-   result = citextcmp(left, right) < 0 ? left : right;
-   PG_RETURN_TEXT_P(result);
+   result = citextcmp(left, right) < 0 ? left : right;
+   PG_RETURN_TEXT_P(result);
 }
 
 PG_FUNCTION_INFO_V1(citext_larger);
@@ -259,10 +260,10 @@ PG_FUNCTION_INFO_V1(citext_larger);
 Datum
 citext_larger(PG_FUNCTION_ARGS)
 {
-   text *left  = PG_GETARG_TEXT_PP(0);
-   text *right = PG_GETARG_TEXT_PP(1);
-   text *result;
+   text       *left = PG_GETARG_TEXT_PP(0);
+   text       *right = PG_GETARG_TEXT_PP(1);
+   text       *result;
 
-   result = citextcmp(left, right) > 0 ? left : right;
-   PG_RETURN_TEXT_P(result);
+   result = citextcmp(left, right) > 0 ? left : right;
+   PG_RETURN_TEXT_P(result);
 }
index 72ec3ba2ad209ecfb58b58fd128b8756e5bb4257..62cd3a2d02a07c922b1a58f41b501c1639d4354b 100644 (file)
@@ -1,5 +1,5 @@
 /******************************************************************************
-  $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.36 2008/05/29 18:46:40 tgl Exp $
+  $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.37 2009/06/11 14:48:50 momjian Exp $
 
   This file contains routines that can be bound to a Postgres backend and
   called by the backend in the process of processing queries.  The calling
@@ -134,14 +134,14 @@ Datum     cube_enlarge(PG_FUNCTION_ARGS);
 /*
 ** For internal use only
 */
-int32      cube_cmp_v0(NDBOX * a, NDBOX * b);
-bool       cube_contains_v0(NDBOX * a, NDBOX * b);
-bool       cube_overlap_v0(NDBOX * a, NDBOX * b);
-NDBOX     *cube_union_v0(NDBOX * a, NDBOX * b);
-void       rt_cube_size(NDBOX * a, double *sz);
-NDBOX     *g_cube_binary_union(NDBOX * r1, NDBOX * r2, int *sizep);
-bool       g_cube_leaf_consistent(NDBOX * key, NDBOX * query, StrategyNumber strategy);
-bool       g_cube_internal_consistent(NDBOX * key, NDBOX * query, StrategyNumber strategy);
+int32      cube_cmp_v0(NDBOX *a, NDBOX *b);
+bool       cube_contains_v0(NDBOX *a, NDBOX *b);
+bool       cube_overlap_v0(NDBOX *a, NDBOX *b);
+NDBOX     *cube_union_v0(NDBOX *a, NDBOX *b);
+void       rt_cube_size(NDBOX *a, double *sz);
+NDBOX     *g_cube_binary_union(NDBOX *r1, NDBOX *r2, int *sizep);
+bool       g_cube_leaf_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
+bool       g_cube_internal_consistent(NDBOX *key, NDBOX *query, StrategyNumber strategy);
 
 /*
 ** Auxiliary funxtions
@@ -201,7 +201,7 @@ cube_a_f8_f8(PG_FUNCTION_ARGS)
    dur = ARRPTR(ur);
    dll = ARRPTR(ll);
 
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * 2 * dim;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * 2 * dim;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = dim;
@@ -237,7 +237,7 @@ cube_a_f8(PG_FUNCTION_ARGS)
 
    dur = ARRPTR(ur);
 
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * 2 * dim;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * 2 * dim;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = dim;
@@ -270,7 +270,7 @@ cube_subset(PG_FUNCTION_ARGS)
    dx = (int4 *) ARR_DATA_PTR(idx);
 
    dim = ARRNELEMS(idx);
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * 2 * dim;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * 2 * dim;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = dim;
@@ -359,6 +359,7 @@ g_cube_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    NDBOX      *query = PG_GETARG_NDBOX(1);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        res;
@@ -652,8 +653,8 @@ g_cube_same(PG_FUNCTION_ARGS)
 ** SUPPORT ROUTINES
 */
 bool
-g_cube_leaf_consistent(NDBOX * key,
-                      NDBOX * query,
+g_cube_leaf_consistent(NDBOX *key,
+                      NDBOX *query,
                       StrategyNumber strategy)
 {
    bool        retval;
@@ -684,8 +685,8 @@ g_cube_leaf_consistent(NDBOX * key,
 }
 
 bool
-g_cube_internal_consistent(NDBOX * key,
-                          NDBOX * query,
+g_cube_internal_consistent(NDBOX *key,
+                          NDBOX *query,
                           StrategyNumber strategy)
 {
    bool        retval;
@@ -714,7 +715,7 @@ g_cube_internal_consistent(NDBOX * key,
 }
 
 NDBOX *
-g_cube_binary_union(NDBOX * r1, NDBOX * r2, int *sizep)
+g_cube_binary_union(NDBOX *r1, NDBOX *r2, int *sizep)
 {
    NDBOX      *retval;
 
@@ -727,7 +728,7 @@ g_cube_binary_union(NDBOX * r1, NDBOX * r2, int *sizep)
 
 /* cube_union_v0 */
 NDBOX *
-cube_union_v0(NDBOX * a, NDBOX * b)
+cube_union_v0(NDBOX *a, NDBOX *b)
 {
    int         i;
    NDBOX      *result;
@@ -887,7 +888,7 @@ cube_size(PG_FUNCTION_ARGS)
 }
 
 void
-rt_cube_size(NDBOX * a, double *size)
+rt_cube_size(NDBOX *a, double *size)
 {
    int         i,
                j;
@@ -906,7 +907,7 @@ rt_cube_size(NDBOX * a, double *size)
 /* make up a metric in which one box will be 'lower' than the other
    -- this can be useful for sorting and to determine uniqueness */
 int32
-cube_cmp_v0(NDBOX * a, NDBOX * b)
+cube_cmp_v0(NDBOX *a, NDBOX *b)
 {
    int         i;
    int         dim;
@@ -1093,7 +1094,7 @@ cube_ge(PG_FUNCTION_ARGS)
 /* Contains */
 /* Box(A) CONTAINS Box(B) IFF pt(A) < pt(B) */
 bool
-cube_contains_v0(NDBOX * a, NDBOX * b)
+cube_contains_v0(NDBOX *a, NDBOX *b)
 {
    int         i;
 
@@ -1163,7 +1164,7 @@ cube_contained(PG_FUNCTION_ARGS)
 /* Overlap */
 /* Box(A) Overlap Box(B) IFF (pt(a)LL < pt(B)UR) && (pt(b)LL < pt(a)UR) */
 bool
-cube_overlap_v0(NDBOX * a, NDBOX * b)
+cube_overlap_v0(NDBOX *a, NDBOX *b)
 {
    int         i;
 
@@ -1374,7 +1375,7 @@ cube_enlarge(PG_FUNCTION_ARGS)
        dim = n;
    if (a->dim > dim)
        dim = a->dim;
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * dim * 2;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * dim * 2;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = dim;
@@ -1415,7 +1416,7 @@ cube_f8(PG_FUNCTION_ARGS)
    NDBOX      *result;
    int         size;
 
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * 2;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * 2;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = 1;
@@ -1433,7 +1434,7 @@ cube_f8_f8(PG_FUNCTION_ARGS)
    NDBOX      *result;
    int         size;
 
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * 2;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * 2;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = 1;
@@ -1454,7 +1455,7 @@ cube_c_f8(PG_FUNCTION_ARGS)
    int         size;
    int         i;
 
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * (c->dim + 1) *2;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * (c->dim + 1) *2;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = c->dim + 1;
@@ -1481,7 +1482,7 @@ cube_c_f8_f8(PG_FUNCTION_ARGS)
    int         size;
    int         i;
 
-   size = offsetof(NDBOX, x[0]) + sizeof(double) * (c->dim + 1) *2;
+   size = offsetof(NDBOX, x[0]) +sizeof(double) * (c->dim + 1) *2;
    result = (NDBOX *) palloc0(size);
    SET_VARSIZE(result, size);
    result->dim = c->dim + 1;
index b5ec0e70c6e0bfd95811aaa987d9625b06fd6c9f..1100602cfc4a3912d705c0ab42fd4381820105de 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/cube/cubedata.h,v 1.9 2007/03/07 21:21:12 teodor Exp $ */
+/* $PostgreSQL: pgsql/contrib/cube/cubedata.h,v 1.10 2009/06/11 14:48:50 momjian Exp $ */
 
 #define CUBE_MAX_DIM (100)
 
@@ -7,7 +7,7 @@ typedef struct NDBOX
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    unsigned int dim;
    double      x[1];
-}  NDBOX;
+} NDBOX;
 
 #define DatumGetNDBOX(x)   ((NDBOX*)DatumGetPointer(x))
 #define PG_GETARG_NDBOX(x) DatumGetNDBOX( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) )
index 9cd047b1eade1c0678978293cb21a0597de13461..6f3cc71f166c301a150ef00456aa06f68219979e 100644 (file)
@@ -8,7 +8,7 @@
  * Darko Prenosil <Darko.Prenosil@finteh.hr>
  * Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
  *
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.81 2009/06/09 17:41:02 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.82 2009/06/11 14:48:50 momjian Exp $
  * Copyright (c) 2001-2009, PostgreSQL Global Development Group
  * ALL RIGHTS RESERVED;
  *
@@ -74,7 +74,7 @@ typedef struct remoteConn
    PGconn     *conn;           /* Hold the remote connection */
    int         openCursorCount;    /* The number of open cursors */
    bool        newXactForCursor;       /* Opened a transaction for a cursor */
-}  remoteConn;
+} remoteConn;
 
 /*
  * Internal declarations
@@ -82,7 +82,7 @@ typedef struct remoteConn
 static Datum dblink_record_internal(FunctionCallInfo fcinfo, bool is_async);
 static remoteConn *getConnectionByName(const char *name);
 static HTAB *createConnHash(void);
-static void createNewConnection(const char *name, remoteConn * rconn);
+static void createNewConnection(const char *name, remoteConn *rconn);
 static void deleteConnection(const char *name);
 static char **get_pkey_attnames(Oid relid, int16 *numatts);
 static char **get_text_array_contents(ArrayType *array, int *numitems);
@@ -116,7 +116,7 @@ typedef struct remoteConnHashEnt
 {
    char        name[NAMEDATALEN];
    remoteConn *rconn;
-}  remoteConnHashEnt;
+} remoteConnHashEnt;
 
 /* initial number of connection hashes */
 #define NUMCONN 16
@@ -576,9 +576,9 @@ dblink_fetch(PG_FUNCTION_ARGS)
        funcctx = SRF_FIRSTCALL_INIT();
 
        /*
-        * Try to execute the query.  Note that since libpq uses malloc,
-        * the PGresult will be long-lived even though we are still in
-        * short-lived memory context.
+        * Try to execute the query.  Note that since libpq uses malloc, the
+        * PGresult will be long-lived even though we are still in a
+        * short-lived memory context.
         */
        res = PQexec(conn, buf.data);
        if (!res ||
@@ -629,8 +629,8 @@ dblink_fetch(PG_FUNCTION_ARGS)
                            "the specified FROM clause rowtype")));
 
        /*
-        * fast track when no results.  We could exit earlier, but then
-        * we'd not report error if the result tuple type is wrong.
+        * fast track when no results.  We could exit earlier, but then we'd
+        * not report error if the result tuple type is wrong.
         */
        if (funcctx->max_calls < 1)
        {
@@ -815,7 +815,7 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
                /* shouldn't happen */
                elog(ERROR, "wrong number of arguments");
        }
-       else /* is_async */
+       else    /* is_async */
        {
            /* get async result */
            if (PG_NARGS() == 2)
@@ -837,106 +837,105 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
        if (!conn)
            DBLINK_CONN_NOT_AVAIL;
 
-           /* synchronous query, or async result retrieval */
-           if (!is_async)
-               res = PQexec(conn, sql);
-           else
-           {
-               res = PQgetResult(conn);
-               /* NULL means we're all done with the async results */
-               if (!res)
-               {
-                   MemoryContextSwitchTo(oldcontext);
-                   SRF_RETURN_DONE(funcctx);
-               }
-           }
-
-           if (!res ||
-               (PQresultStatus(res) != PGRES_COMMAND_OK &&
-                PQresultStatus(res) != PGRES_TUPLES_OK))
+       /* synchronous query, or async result retrieval */
+       if (!is_async)
+           res = PQexec(conn, sql);
+       else
+       {
+           res = PQgetResult(conn);
+           /* NULL means we're all done with the async results */
+           if (!res)
            {
-               dblink_res_error(conname, res, "could not execute query", fail);
-               if (freeconn)
-                   PQfinish(conn);
                MemoryContextSwitchTo(oldcontext);
                SRF_RETURN_DONE(funcctx);
            }
+       }
 
-           if (PQresultStatus(res) == PGRES_COMMAND_OK)
-           {
-               is_sql_cmd = true;
-
-               /* need a tuple descriptor representing one TEXT column */
-               tupdesc = CreateTemplateTupleDesc(1, false);
-               TupleDescInitEntry(tupdesc, (AttrNumber) 1, "status",
-                                  TEXTOID, -1, 0);
-
-               /*
-                * and save a copy of the command status string to return as
-                * our result tuple
-                */
-               sql_cmd_status = PQcmdStatus(res);
-               funcctx->max_calls = 1;
-           }
-           else
-               funcctx->max_calls = PQntuples(res);
-
-           /* got results, keep track of them */
-           funcctx->user_fctx = res;
-
-           /* if needed, close the connection to the database and cleanup */
+       if (!res ||
+           (PQresultStatus(res) != PGRES_COMMAND_OK &&
+            PQresultStatus(res) != PGRES_TUPLES_OK))
+       {
+           dblink_res_error(conname, res, "could not execute query", fail);
            if (freeconn)
                PQfinish(conn);
+           MemoryContextSwitchTo(oldcontext);
+           SRF_RETURN_DONE(funcctx);
+       }
 
-           if (!is_sql_cmd)
-           {
-               /* get a tuple descriptor for our result type */
-               switch (get_call_result_type(fcinfo, NULL, &tupdesc))
-               {
-                   case TYPEFUNC_COMPOSITE:
-                       /* success */
-                       break;
-                   case TYPEFUNC_RECORD:
-                       /* failed to determine actual type of RECORD */
-                       ereport(ERROR,
-                               (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                       errmsg("function returning record called in context "
-                              "that cannot accept type record")));
-                       break;
-                   default:
-                       /* result type isn't composite */
-                       elog(ERROR, "return type must be a row type");
-                       break;
-               }
+       if (PQresultStatus(res) == PGRES_COMMAND_OK)
+       {
+           is_sql_cmd = true;
 
-               /* make sure we have a persistent copy of the tupdesc */
-               tupdesc = CreateTupleDescCopy(tupdesc);
-           }
+           /* need a tuple descriptor representing one TEXT column */
+           tupdesc = CreateTemplateTupleDesc(1, false);
+           TupleDescInitEntry(tupdesc, (AttrNumber) 1, "status",
+                              TEXTOID, -1, 0);
 
            /*
-            * check result and tuple descriptor have the same number of
-            * columns
+            * and save a copy of the command status string to return as our
+            * result tuple
             */
-           if (PQnfields(res) != tupdesc->natts)
-               ereport(ERROR,
-                       (errcode(ERRCODE_DATATYPE_MISMATCH),
-                        errmsg("remote query result rowtype does not match "
-                               "the specified FROM clause rowtype")));
+           sql_cmd_status = PQcmdStatus(res);
+           funcctx->max_calls = 1;
+       }
+       else
+           funcctx->max_calls = PQntuples(res);
 
-           /* fast track when no results */
-           if (funcctx->max_calls < 1)
+       /* got results, keep track of them */
+       funcctx->user_fctx = res;
+
+       /* if needed, close the connection to the database and cleanup */
+       if (freeconn)
+           PQfinish(conn);
+
+       if (!is_sql_cmd)
+       {
+           /* get a tuple descriptor for our result type */
+           switch (get_call_result_type(fcinfo, NULL, &tupdesc))
            {
-               if (res)
-                   PQclear(res);
-               MemoryContextSwitchTo(oldcontext);
-               SRF_RETURN_DONE(funcctx);
+               case TYPEFUNC_COMPOSITE:
+                   /* success */
+                   break;
+               case TYPEFUNC_RECORD:
+                   /* failed to determine actual type of RECORD */
+                   ereport(ERROR,
+                           (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                       errmsg("function returning record called in context "
+                              "that cannot accept type record")));
+                   break;
+               default:
+                   /* result type isn't composite */
+                   elog(ERROR, "return type must be a row type");
+                   break;
            }
 
-           /* store needed metadata for subsequent calls */
-           attinmeta = TupleDescGetAttInMetadata(tupdesc);
-           funcctx->attinmeta = attinmeta;
+           /* make sure we have a persistent copy of the tupdesc */
+           tupdesc = CreateTupleDescCopy(tupdesc);
+       }
 
+       /*
+        * check result and tuple descriptor have the same number of columns
+        */
+       if (PQnfields(res) != tupdesc->natts)
+           ereport(ERROR,
+                   (errcode(ERRCODE_DATATYPE_MISMATCH),
+                    errmsg("remote query result rowtype does not match "
+                           "the specified FROM clause rowtype")));
+
+       /* fast track when no results */
+       if (funcctx->max_calls < 1)
+       {
+           if (res)
+               PQclear(res);
            MemoryContextSwitchTo(oldcontext);
+           SRF_RETURN_DONE(funcctx);
+       }
+
+       /* store needed metadata for subsequent calls */
+       attinmeta = TupleDescGetAttInMetadata(tupdesc);
+       funcctx->attinmeta = attinmeta;
+
+       MemoryContextSwitchTo(oldcontext);
 
    }
 
@@ -2014,7 +2013,7 @@ quote_literal_cstr(char *rawstr)
 
    rawstr_text = cstring_to_text(rawstr);
    result_text = DatumGetTextP(DirectFunctionCall1(quote_literal,
-                                                   PointerGetDatum(rawstr_text)));
+                                             PointerGetDatum(rawstr_text)));
    result = text_to_cstring(result_text);
 
    return result;
@@ -2033,7 +2032,7 @@ quote_ident_cstr(char *rawstr)
 
    rawstr_text = cstring_to_text(rawstr);
    result_text = DatumGetTextP(DirectFunctionCall1(quote_ident,
-                                                   PointerGetDatum(rawstr_text)));
+                                             PointerGetDatum(rawstr_text)));
    result = text_to_cstring(result_text);
 
    return result;
@@ -2229,7 +2228,7 @@ createConnHash(void)
 }
 
 static void
-createNewConnection(const char *name, remoteConn * rconn)
+createNewConnection(const char *name, remoteConn *rconn)
 {
    remoteConnHashEnt *hentry;
    bool        found;
@@ -2296,7 +2295,7 @@ dblink_security_check(PGconn *conn, remoteConn *rconn)
 }
 
 /*
- * For non-superusers, insist that the connstr specify a password.  This
+ * For non-superusers, insist that the connstr specify a password. This
  * prevents a password from being picked up from .pgpass, a service file,
  * the environment, etc.  We don't want the postgres user's passwords
  * to be accessible to non-superusers.
@@ -2306,9 +2305,9 @@ dblink_connstr_check(const char *connstr)
 {
    if (!superuser())
    {
-       PQconninfoOption   *options;
-       PQconninfoOption   *option;
-       bool                connstr_gives_password = false;
+       PQconninfoOption *options;
+       PQconninfoOption *option;
+       bool        connstr_gives_password = false;
 
        options = PQconninfoParse(connstr, NULL);
        if (options)
@@ -2329,9 +2328,9 @@ dblink_connstr_check(const char *connstr)
 
        if (!connstr_gives_password)
            ereport(ERROR,
-                   (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED),
-                    errmsg("password is required"),
-                    errdetail("Non-superusers must provide a password in the connection string.")));
+                 (errcode(ERRCODE_S_R_E_PROHIBITED_SQL_STATEMENT_ATTEMPTED),
+                  errmsg("password is required"),
+                  errdetail("Non-superusers must provide a password in the connection string.")));
    }
 }
 
@@ -2377,13 +2376,13 @@ dblink_res_error(const char *conname, PGresult *res, const char *dblink_context_
        dblink_context_conname = conname;
 
    ereport(level,
-       (errcode(sqlstate),
-        message_primary ? errmsg("%s", message_primary) : errmsg("unknown error"),
-        message_detail ? errdetail("%s", message_detail) : 0,
-        message_hint ? errhint("%s", message_hint) : 0,
-        message_context ? errcontext("%s", message_context) : 0,
-        errcontext("Error occurred on dblink connection named \"%s\": %s.",
-                   dblink_context_conname, dblink_context_msg)));
+           (errcode(sqlstate),
+   message_primary ? errmsg("%s", message_primary) : errmsg("unknown error"),
+            message_detail ? errdetail("%s", message_detail) : 0,
+            message_hint ? errhint("%s", message_hint) : 0,
+            message_context ? errcontext("%s", message_context) : 0,
+         errcontext("Error occurred on dblink connection named \"%s\": %s.",
+                    dblink_context_conname, dblink_context_msg)));
 }
 
 /*
@@ -2392,12 +2391,12 @@ dblink_res_error(const char *conname, PGresult *res, const char *dblink_context_
 static char *
 get_connect_string(const char *servername)
 {
-   ForeignServer      *foreign_server = NULL;
-   UserMapping        *user_mapping;
-   ListCell           *cell;
-   StringInfo          buf = makeStringInfo();
+   ForeignServer *foreign_server = NULL;
+   UserMapping *user_mapping;
+   ListCell   *cell;
+   StringInfo  buf = makeStringInfo();
    ForeignDataWrapper *fdw;
-   AclResult           aclresult;
+   AclResult   aclresult;
 
    /* first gather the server connstr options */
    if (strlen(servername) < NAMEDATALEN)
@@ -2405,39 +2404,39 @@ get_connect_string(const char *servername)
 
    if (foreign_server)
    {
-       Oid     serverid = foreign_server->serverid;
-       Oid     fdwid = foreign_server->fdwid;
-       Oid     userid = GetUserId();
+       Oid         serverid = foreign_server->serverid;
+       Oid         fdwid = foreign_server->fdwid;
+       Oid         userid = GetUserId();
 
        user_mapping = GetUserMapping(userid, serverid);
-       fdw = GetForeignDataWrapper(fdwid);
+       fdw = GetForeignDataWrapper(fdwid);
 
        /* Check permissions, user must have usage on the server. */
        aclresult = pg_foreign_server_aclcheck(serverid, userid, ACL_USAGE);
        if (aclresult != ACLCHECK_OK)
            aclcheck_error(aclresult, ACL_KIND_FOREIGN_SERVER, foreign_server->servername);
 
-       foreach (cell, fdw->options)
+       foreach(cell, fdw->options)
        {
-           DefElem        *def = lfirst(cell);
+           DefElem    *def = lfirst(cell);
 
            appendStringInfo(buf, "%s='%s' ", def->defname,
                             escape_param_str(strVal(def->arg)));
        }
 
-       foreach (cell, foreign_server->options)
+       foreach(cell, foreign_server->options)
        {
-           DefElem        *def = lfirst(cell);
-   
+           DefElem    *def = lfirst(cell);
+
            appendStringInfo(buf, "%s='%s' ", def->defname,
                             escape_param_str(strVal(def->arg)));
        }
-   
-       foreach (cell, user_mapping->options)
+
+       foreach(cell, user_mapping->options)
        {
-   
-           DefElem        *def = lfirst(cell);
-   
+
+           DefElem    *def = lfirst(cell);
+
            appendStringInfo(buf, "%s='%s' ", def->defname,
                             escape_param_str(strVal(def->arg)));
        }
@@ -2456,8 +2455,8 @@ get_connect_string(const char *servername)
 static char *
 escape_param_str(const char *str)
 {
-   const char     *cp;
-   StringInfo      buf = makeStringInfo();
+   const char *cp;
+   StringInfo  buf = makeStringInfo();
 
    for (cp = str; *cp; cp++)
    {
index 36562a2d7f21a7c1fd2842c86f9d22b9f6166226..e555cdb89351c7efeda2b04d513ba576ec4f923f 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 2007-2009, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/contrib/dict_int/dict_int.c,v 1.4 2009/01/01 17:23:32 momjian Exp $
+ *   $PostgreSQL: pgsql/contrib/dict_int/dict_int.c,v 1.5 2009/06/11 14:48:50 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -23,7 +23,7 @@ typedef struct
 {
    int         maxlen;
    bool        rejectlong;
-}  DictInt;
+} DictInt;
 
 
 PG_FUNCTION_INFO_V1(dintdict_init);
index 6c191a5c38e09257c88ec258e65a81a59a885a8d..4dce1f828ea89b7f21780fa46b93736ff66ba168 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/earthdistance/earthdistance.c,v 1.15 2008/04/21 01:11:43 tgl Exp $ */
+/* $PostgreSQL: pgsql/contrib/earthdistance/earthdistance.c,v 1.16 2009/06/11 14:48:51 momjian Exp $ */
 
 #include "postgres.h"
 
@@ -91,7 +91,7 @@ geo_distance_internal(Point *pt1, Point *pt2)
  *  distance between the points in miles on earth's surface
  *
  * If float8 is passed-by-value, the oldstyle version-0 calling convention
- * is unportable, so we use version-1.  However, if it's passed-by-reference,
+ * is unportable, so we use version-1. However, if it's passed-by-reference,
  * continue to use oldstyle.  This is just because we'd like earthdistance
  * to serve as a canary for any unintentional breakage of version-0 functions
  * with float8 results.
@@ -100,6 +100,7 @@ geo_distance_internal(Point *pt1, Point *pt2)
 #ifdef USE_FLOAT8_BYVAL
 
 Datum      geo_distance(PG_FUNCTION_ARGS);
+
 PG_FUNCTION_INFO_V1(geo_distance);
 
 Datum
@@ -112,8 +113,7 @@ geo_distance(PG_FUNCTION_ARGS)
    result = geo_distance_internal(pt1, pt2);
    PG_RETURN_FLOAT8(result);
 }
-
-#else /* !USE_FLOAT8_BYVAL */
+#else                          /* !USE_FLOAT8_BYVAL */
 
 double    *geo_distance(Point *pt1, Point *pt2);
 
@@ -126,4 +126,4 @@ geo_distance(Point *pt1, Point *pt2)
    return resultp;
 }
 
-#endif /* USE_FLOAT8_BYVAL */
+#endif   /* USE_FLOAT8_BYVAL */
index 5bb07640bf61cd876d3db7b2cd8eddfc2ce46157..113acb566a6ebf01c0d94f708931cdf2dfcd2e35 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This is a port of the Double Metaphone algorithm for use in PostgreSQL.
  *
- * $PostgreSQL: pgsql/contrib/fuzzystrmatch/dmetaphone.c,v 1.12 2008/03/25 22:42:41 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/fuzzystrmatch/dmetaphone.c,v 1.13 2009/06/11 14:48:51 momjian Exp $
  *
  * Double Metaphone computes 2 "sounds like" strings - a primary and an
  * alternate. In most cases they are the same, but for foreign names
@@ -224,7 +224,7 @@ typedef struct
    int         free_string_on_destroy;
 }
 
-           metastring;
+metastring;
 
 /*
  * remaining perl module funcs unchanged except for declaring them static
@@ -258,7 +258,7 @@ NewMetaString(char *init_str)
 
 
 static void
-DestroyMetaString(metastring * s)
+DestroyMetaString(metastring *s)
 {
    if (s == NULL)
        return;
@@ -271,7 +271,7 @@ DestroyMetaString(metastring * s)
 
 
 static void
-IncreaseBuffer(metastring * s, int chars_needed)
+IncreaseBuffer(metastring *s, int chars_needed)
 {
    META_REALLOC(s->str, (s->bufsize + chars_needed + 10), char);
    assert(s->str != NULL);
@@ -280,7 +280,7 @@ IncreaseBuffer(metastring * s, int chars_needed)
 
 
 static void
-MakeUpper(metastring * s)
+MakeUpper(metastring *s)
 {
    char       *i;
 
@@ -290,7 +290,7 @@ MakeUpper(metastring * s)
 
 
 static int
-IsVowel(metastring * s, int pos)
+IsVowel(metastring *s, int pos)
 {
    char        c;
 
@@ -307,7 +307,7 @@ IsVowel(metastring * s, int pos)
 
 
 static int
-SlavoGermanic(metastring * s)
+SlavoGermanic(metastring *s)
 {
    if ((char *) strstr(s->str, "W"))
        return 1;
@@ -323,7 +323,7 @@ SlavoGermanic(metastring * s)
 
 
 static char
-GetAt(metastring * s, int pos)
+GetAt(metastring *s, int pos)
 {
    if ((pos < 0) || (pos >= s->length))
        return '\0';
@@ -333,7 +333,7 @@ GetAt(metastring * s, int pos)
 
 
 static void
-SetAt(metastring * s, int pos, char c)
+SetAt(metastring *s, int pos, char c)
 {
    if ((pos < 0) || (pos >= s->length))
        return;
@@ -346,7 +346,7 @@ SetAt(metastring * s, int pos, char c)
    Caveats: the START value is 0 based
 */
 static int
-StringAt(metastring * s, int start, int length,...)
+StringAt(metastring *s, int start, int length,...)
 {
    char       *test;
    char       *pos;
@@ -373,7 +373,7 @@ StringAt(metastring * s, int start, int length,...)
 
 
 static void
-MetaphAdd(metastring * s, char *new_str)
+MetaphAdd(metastring *s, char *new_str)
 {
    int         add_length;
 
index 387f1249422db778c84135f1c082f608b2a7cb52..b3def054a91bd0e40961a9b9e86707b36797406b 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Joe Conway <mail@joeconway.com>
  *
- * $PostgreSQL: pgsql/contrib/fuzzystrmatch/fuzzystrmatch.c,v 1.29 2009/04/07 15:53:54 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/fuzzystrmatch/fuzzystrmatch.c,v 1.30 2009/06/11 14:48:51 momjian Exp $
  * Copyright (c) 2001-2009, PostgreSQL Global Development Group
  * ALL RIGHTS RESERVED;
  *
@@ -90,8 +90,8 @@ soundex_code(char letter)
  */
 #define MAX_LEVENSHTEIN_STRLEN     255
 
-static int levenshtein_internal(const char *s, const char *t,
-                                int ins_c, int del_c, int sub_c);
+static int levenshtein_internal(const char *s, const char *t,
+                    int ins_c, int del_c, int sub_c);
 
 
 /*
@@ -186,18 +186,20 @@ getcode(char c)
 
 /*
  * levenshtein_internal - Calculates Levenshtein distance metric
- *                        between supplied strings. Generally
- *                        (1, 1, 1) penalty costs suffices common
- *                        cases, but your mileage may vary.
+ *                       between supplied strings. Generally
+ *                       (1, 1, 1) penalty costs suffices common
+ *                       cases, but your mileage may vary.
  */
 static int
 levenshtein_internal(const char *s, const char *t,
                     int ins_c, int del_c, int sub_c)
 {
-   int      m, n;
-   int     *prev;
-   int     *curr;
-   int      i, j;
+   int         m,
+               n;
+   int        *prev;
+   int        *curr;
+   int         i,
+               j;
    const char *x;
    const char *y;
 
@@ -205,9 +207,8 @@ levenshtein_internal(const char *s, const char *t,
    n = strlen(t);
 
    /*
-    * If either m or n is 0, the answer is the other value. This makes
-    * sense since it would take that many insertions to build a matching
-    * string
+    * If either m or n is 0, the answer is the other value. This makes sense
+    * since it would take that many insertions to build a matching string
     */
    if (!m)
        return n;
@@ -230,10 +231,10 @@ levenshtein_internal(const char *s, const char *t,
    ++n;
 
    /*
-    * Instead of building an (m+1)x(n+1) array, we'll use two
-    * different arrays of size m+1 for storing accumulated values.
-    * At each step one represents the "previous" row and one is the
-    * "current" row of the notional large array.
+    * Instead of building an (m+1)x(n+1) array, we'll use two different
+    * arrays of size m+1 for storing accumulated values. At each step one
+    * represents the "previous" row and one is the "current" row of the
+    * notional large array.
     */
    prev = (int *) palloc(2 * m * sizeof(int));
    curr = prev + m;
@@ -245,24 +246,24 @@ levenshtein_internal(const char *s, const char *t,
    /* Loop through rows of the notional array */
    for (y = t, j = 1; j < n; y++, j++)
    {
-       int *temp;
+       int        *temp;
 
        /*
-        * First cell must increment sequentially, as we're on the
-        * j'th row of the (m+1)x(n+1) array.
+        * First cell must increment sequentially, as we're on the j'th row of
+        * the (m+1)x(n+1) array.
         */
        curr[0] = j;
-       
+
        for (x = s, i = 1; i < m; x++, i++)
        {
-           int ins;
-           int del;
-           int sub;
+           int         ins;
+           int         del;
+           int         sub;
 
            /* Calculate costs for probable operations. */
-           ins = prev[i] + ins_c;                      /* Insertion    */
-           del = curr[i-1] + del_c;                    /* Deletion     */
-           sub = prev[i-1] + ((*x == *y) ? 0 : sub_c); /* Substitution */
+           ins = prev[i] + ins_c;      /* Insertion    */
+           del = curr[i - 1] + del_c;  /* Deletion     */
+           sub = prev[i - 1] + ((*x == *y) ? 0 : sub_c);       /* Substitution */
 
            /* Take the one with minimum cost. */
            curr[i] = Min(ins, del);
@@ -276,10 +277,10 @@ levenshtein_internal(const char *s, const char *t,
    }
 
    /*
-    * Because the final value was swapped from the previous row to
-    * the current row, that's where we'll find it.
+    * Because the final value was swapped from the previous row to the
+    * current row, that's where we'll find it.
     */
-   return prev[m-1];
+   return prev[m - 1];
 }
 
 
@@ -287,11 +288,11 @@ PG_FUNCTION_INFO_V1(levenshtein_with_costs);
 Datum
 levenshtein_with_costs(PG_FUNCTION_ARGS)
 {
-   char    *src = TextDatumGetCString(PG_GETARG_DATUM(0));
-   char    *dst = TextDatumGetCString(PG_GETARG_DATUM(1));
-   int      ins_c = PG_GETARG_INT32(2);
-   int      del_c = PG_GETARG_INT32(3);
-   int      sub_c = PG_GETARG_INT32(4);
+   char       *src = TextDatumGetCString(PG_GETARG_DATUM(0));
+   char       *dst = TextDatumGetCString(PG_GETARG_DATUM(1));
+   int         ins_c = PG_GETARG_INT32(2);
+   int         del_c = PG_GETARG_INT32(3);
+   int         sub_c = PG_GETARG_INT32(4);
 
    PG_RETURN_INT32(levenshtein_internal(src, dst, ins_c, del_c, sub_c));
 }
@@ -301,8 +302,8 @@ PG_FUNCTION_INFO_V1(levenshtein);
 Datum
 levenshtein(PG_FUNCTION_ARGS)
 {
-   char    *src = TextDatumGetCString(PG_GETARG_DATUM(0));
-   char    *dst = TextDatumGetCString(PG_GETARG_DATUM(1));
+   char       *src = TextDatumGetCString(PG_GETARG_DATUM(0));
+   char       *dst = TextDatumGetCString(PG_GETARG_DATUM(1));
 
    PG_RETURN_INT32(levenshtein_internal(src, dst, 1, 1, 1));
 }
@@ -417,9 +418,9 @@ Lookahead(char *word, int how_far)
 
 
 static int
-_metaphone(char *word,             /* IN */
+_metaphone(char *word,         /* IN */
           int max_phonemes,
-          char **phoned_word)      /* OUT */
+          char **phoned_word)  /* OUT */
 {
    int         w_idx = 0;      /* point in the phonization we're at. */
    int         p_idx = 0;      /* end of the phoned phrase */
index b1f80fde0781b0ecbadc4df53858b39ae93e350f..dc5765d056db1738ec8817cba0dd5c5d5aaaaeae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/hstore/crc32.c,v 1.3 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/hstore/crc32.c,v 1.4 2009/06/11 14:48:51 momjian Exp $
  *
  * Both POSIX and CRC32 checksums */
 
index d2d6c8bd9a65e19507de8bd397dc3436328ad07b..e008b1a6646bf55a94a3a3497d9a42272c8dfcec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/hstore/crc32.h,v 1.2 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/hstore/crc32.h,v 1.3 2009/06/11 14:48:51 momjian Exp $
  */
 #ifndef _CRC32_H
 #define _CRC32_H
index 2a2c3bad58a4f769ec8a3453d2c441f9a20e327a..e8ea58b567272cfe068b16fa9d21e3980faec0bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/hstore/hstore.h,v 1.7 2009/03/15 22:05:17 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/hstore/hstore.h,v 1.8 2009/06/11 14:48:51 momjian Exp $
  */
 #ifndef __HSTORE_H__
 #define __HSTORE_H__
@@ -14,7 +14,7 @@ typedef struct
    uint32
                valisnull:1,
                pos:31;
-}  HEntry;
+} HEntry;
 
 /* these are determined by the sizes of the keylen and vallen fields */
 /* in struct HEntry and struct Pairs */
@@ -27,7 +27,7 @@ typedef struct
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    int4        size;
    char        data[1];
-}  HStore;
+} HStore;
 
 #define HSHRDSIZE  (VARHDRSZ + sizeof(int4))
 #define CALCDATASIZE(x, lenstr) ( (x) * sizeof(HEntry) + HSHRDSIZE + (lenstr) )
@@ -45,15 +45,15 @@ typedef struct
    uint16      vallen;
    bool        isnull;
    bool        needfree;
-}  Pairs;
+} Pairs;
 
 int            comparePairs(const void *a, const void *b);
-int            uniquePairs(Pairs * a, int4 l, int4 *buflen);
+int            uniquePairs(Pairs *a, int4 l, int4 *buflen);
 
-size_t      hstoreCheckKeyLen(size_t len);
-size_t      hstoreCheckValLen(size_t len);
+size_t     hstoreCheckKeyLen(size_t len);
+size_t     hstoreCheckValLen(size_t len);
 
 #define HStoreContainsStrategyNumber   7
 #define HStoreExistsStrategyNumber     9
 
-#endif /* __HSTORE_H__ */
+#endif   /* __HSTORE_H__ */
index 01d7258f8f9cec20413887cf333f4284353512ac..9c9a83d128679c905e924a6534a90869ef9929ee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/hstore/hstore_gin.c,v 1.5 2009/03/25 22:19:01 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/hstore/hstore_gin.c,v 1.6 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -122,6 +122,7 @@ gin_consistent_hstore(PG_FUNCTION_ARGS)
    bool       *check = (bool *) PG_GETARG_POINTER(0);
    StrategyNumber strategy = PG_GETARG_UINT16(1);
    HStore     *query = PG_GETARG_HS(2);
+
    /* int32    nkeys = PG_GETARG_INT32(3); */
    /* Pointer     *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(5);
@@ -132,8 +133,8 @@ gin_consistent_hstore(PG_FUNCTION_ARGS)
        int         i;
 
        /*
-        * Index lost information about correspondence of keys
-        * and values, so we need recheck
+        * Index lost information about correspondence of keys and values, so
+        * we need recheck
         */
        *recheck = true;
        for (i = 0; res && i < 2 * query->size; i++)
index ecfed0f5dabc5871767a619176076cb5a089bef0..0f6eac347c7646b78ae5978cde7704a6b47be8e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/hstore/hstore_gist.c,v 1.9 2008/05/12 00:00:42 alvherre Exp $
+ * $PostgreSQL: pgsql/contrib/hstore/hstore_gist.c,v 1.10 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -42,7 +42,7 @@ typedef struct
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    int4        flag;
    char        data[1];
-}  GISTTYPE;
+} GISTTYPE;
 
 #define ALLISTRUE      0x04
 
@@ -255,7 +255,7 @@ hemdistsign(BITVECP a, BITVECP b)
 }
 
 static int
-hemdist(GISTTYPE * a, GISTTYPE * b)
+hemdist(GISTTYPE *a, GISTTYPE *b)
 {
    if (ISALLTRUE(a))
    {
@@ -271,7 +271,7 @@ hemdist(GISTTYPE * a, GISTTYPE * b)
 }
 
 static int4
-unionkey(BITVECP sbase, GISTTYPE * add)
+unionkey(BITVECP sbase, GISTTYPE *add)
 {
    int4        i;
    BITVECP     sadd = GETSIGN(add);
@@ -514,6 +514,7 @@ ghstore_consistent(PG_FUNCTION_ARGS)
 {
    GISTTYPE   *entry = (GISTTYPE *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        res = true;
index 140336a2e6040828a26a4a3d5536c568806068d5..3b19702520e9dcaf62ba24a98d723049453a3481 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/hstore/hstore_io.c,v 1.10 2009/04/02 17:57:05 teodor Exp $
+ * $PostgreSQL: pgsql/contrib/hstore/hstore_io.c,v 1.11 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -20,7 +20,7 @@ typedef struct
    Pairs      *pairs;
    int         pcur;
    int         plen;
-}  HSParser;
+} HSParser;
 
 #define RESIZEPRSBUF \
 do { \
@@ -41,7 +41,7 @@ do { \
 #define GV_WAITESCESCIN 4
 
 static bool
-get_val(HSParser * state, bool ignoreeq, bool *escaped)
+get_val(HSParser *state, bool ignoreeq, bool *escaped)
 {
    int         st = GV_WAITVAL;
 
@@ -165,7 +165,7 @@ get_val(HSParser * state, bool ignoreeq, bool *escaped)
 
 
 static void
-parse_hstore(HSParser * state)
+parse_hstore(HSParser *state)
 {
    int         st = WKEY;
    bool        escaped = false;
@@ -287,7 +287,7 @@ comparePairs(const void *a, const void *b)
 }
 
 int
-uniquePairs(Pairs * a, int4 l, int4 *buflen)
+uniquePairs(Pairs *a, int4 l, int4 *buflen)
 {
    Pairs      *ptr,
               *res;
@@ -328,7 +328,7 @@ uniquePairs(Pairs * a, int4 l, int4 *buflen)
 }
 
 static void
-freeHSParse(HSParser * state)
+freeHSParse(HSParser *state)
 {
    int         i;
 
@@ -447,7 +447,7 @@ hstore_out(PG_FUNCTION_ARGS)
    HStore     *in = PG_GETARG_HS(0);
    int         buflen,
                i,
-               nnulls=0;
+               nnulls = 0;
    char       *out,
               *ptr;
    char       *base = STRPTR(in);
@@ -465,11 +465,11 @@ hstore_out(PG_FUNCTION_ARGS)
        if (entries[i].valisnull)
            nnulls++;
 
-   buflen = (4 /* " */ + 2 /* => */ ) * ( in->size - nnulls ) +
-       ( 2 /* " */ + 2 /* => */ + 4 /* NULL */ ) * nnulls  +
-       2 /* ,  */ * ( in->size - 1 ) +
-       2 /* esc */ * (VARSIZE(in) - CALCDATASIZE(in->size, 0)) + 
-       1 /* \0 */;
+   buflen = (4 /* " */ + 2 /* => */ ) * (in->size - nnulls) +
+       (2 /* " */ + 2 /* => */ + 4 /* NULL */ ) * nnulls +
+       2 /* ,  */ * (in->size - 1) +
+       2 /* esc */ * (VARSIZE(in) - CALCDATASIZE(in->size, 0)) +
+       1 /* \0 */ ;
 
    out = ptr = palloc(buflen);
    for (i = 0; i < in->size; i++)
index dfd762b029b26a9302a4a76219be63821a582bbd..8d471e30f1d3350e3972a2124ed0311646b79df9 100644 (file)
@@ -12,7 +12,7 @@
 
 
 static HEntry *
-findkey(HStore * hs, char *key, int keylen)
+findkey(HStore *hs, char *key, int keylen)
 {
    HEntry     *StopLow = ARRPTR(hs);
    HEntry     *StopHigh = StopLow + hs->size;
@@ -407,10 +407,10 @@ typedef struct
 {
    HStore     *hs;
    int         i;
-}  AKStore;
+} AKStore;
 
 static void
-setup_firstcall(FuncCallContext *funcctx, HStore * hs)
+setup_firstcall(FuncCallContext *funcctx, HStore *hs)
 {
    MemoryContext oldcontext;
    AKStore    *st;
index debc324933c4e1f6f23662330380de7ec7cc6393..35dbb54796f36e2ece52fb6c90118b885cdca8e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_int.h,v 1.16 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/intarray/_int.h,v 1.17 2009/06/11 14:48:51 momjian Exp $
  */
 #ifndef ___INT_H__
 #define ___INT_H__
@@ -78,7 +78,7 @@ typedef struct
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    int4        flag;
    char        data[1];
-}  GISTTYPE;
+} GISTTYPE;
 
 #define ALLISTRUE      0x04
 
@@ -131,14 +131,14 @@ typedef struct ITEM
    int2        type;
    int2        left;
    int4        val;
-}  ITEM;
+} ITEM;
 
 typedef struct
 {
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    int4        size;
    char        data[1];
-}  QUERYTYPE;
+} QUERYTYPE;
 
 #define HDRSIZEQT  (VARHDRSZ + sizeof(int4))
 #define COMPUTESIZE(size)  ( HDRSIZEQT + size * sizeof(ITEM) )
@@ -151,10 +151,10 @@ typedef struct
 #define OPEN   4
 #define CLOSE  5
 
-bool       signconsistent(QUERYTYPE * query, BITVEC sign, bool calcnot);
-bool       execconsistent(QUERYTYPE * query, ArrayType *array, bool calcnot);
-bool       ginconsistent(QUERYTYPE * query, bool *check);
-int4       shorterquery(ITEM * q, int4 len);
+bool       signconsistent(QUERYTYPE *query, BITVEC sign, bool calcnot);
+bool       execconsistent(QUERYTYPE *query, ArrayType *array, bool calcnot);
+bool       ginconsistent(QUERYTYPE *query, bool *check);
+int4       shorterquery(ITEM *q, int4 len);
 
 int            compASC(const void *a, const void *b);
 
@@ -165,4 +165,4 @@ if (ARRNELEMS(a) > 1)                                           \
        qsort((void*)ARRPTR(a), ARRNELEMS(a),sizeof(int4),      \
                (direction) ? compASC : compDESC )
 
-#endif /* ___INT_H__ */
+#endif   /* ___INT_H__ */
index 2cba9b66c121c23762f5071dc22945b987aa5f64..438db2ca95dbd3ba1846d452864e6a900aec06c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_int_bool.c,v 1.15 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/intarray/_int_bool.c,v 1.16 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -54,13 +54,13 @@ typedef struct
    NODE       *str;
    /* number in str */
    int4        num;
-}  WORKSTATE;
+} WORKSTATE;
 
 /*
  * get token from query string
  */
 static int4
-gettoken(WORKSTATE * state, int4 *val)
+gettoken(WORKSTATE *state, int4 *val)
 {
    char        nnn[16],
               *curnnn;
@@ -143,7 +143,7 @@ gettoken(WORKSTATE * state, int4 *val)
  * push new one in polish notation reverse view
  */
 static void
-pushquery(WORKSTATE * state, int4 type, int4 val)
+pushquery(WORKSTATE *state, int4 type, int4 val)
 {
    NODE       *tmp = (NODE *) palloc(sizeof(NODE));
 
@@ -160,7 +160,7 @@ pushquery(WORKSTATE * state, int4 type, int4 val)
  * make polish notation of query
  */
 static int4
-makepol(WORKSTATE * state)
+makepol(WORKSTATE *state)
 {
    int4        val,
                type;
@@ -239,7 +239,7 @@ typedef struct
  * is there value 'val' in array or not ?
  */
 static bool
-checkcondition_arr(void *checkval, ITEM * item)
+checkcondition_arr(void *checkval, ITEM *item)
 {
    int4       *StopLow = ((CHKVAL *) checkval)->arrb;
    int4       *StopHigh = ((CHKVAL *) checkval)->arre;
@@ -261,7 +261,7 @@ checkcondition_arr(void *checkval, ITEM * item)
 }
 
 static bool
-checkcondition_bit(void *checkval, ITEM * item)
+checkcondition_bit(void *checkval, ITEM *item)
 {
    return GETBIT(checkval, HASHVAL(item->val));
 }
@@ -270,7 +270,7 @@ checkcondition_bit(void *checkval, ITEM * item)
  * check for boolean condition
  */
 static bool
-execute(ITEM * curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM * item))
+execute(ITEM *curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM *item))
 {
 
    if (curitem->type == VAL)
@@ -302,7 +302,7 @@ execute(ITEM * curitem, void *checkval, bool calcnot, bool (*chkcond) (void *che
  * signconsistent & execconsistent called by *_consistent
  */
 bool
-signconsistent(QUERYTYPE * query, BITVEC sign, bool calcnot)
+signconsistent(QUERYTYPE *query, BITVEC sign, bool calcnot)
 {
    return execute(
                   GETQUERY(query) + query->size - 1,
@@ -312,7 +312,7 @@ signconsistent(QUERYTYPE * query, BITVEC sign, bool calcnot)
 }
 
 bool
-execconsistent(QUERYTYPE * query, ArrayType *array, bool calcnot)
+execconsistent(QUERYTYPE *query, ArrayType *array, bool calcnot)
 {
    CHKVAL      chkval;
 
@@ -333,7 +333,7 @@ typedef struct
 } GinChkVal;
 
 static bool
-checkcondition_gin(void *checkval, ITEM * item)
+checkcondition_gin(void *checkval, ITEM *item)
 {
    GinChkVal  *gcv = (GinChkVal *) checkval;
 
@@ -341,7 +341,7 @@ checkcondition_gin(void *checkval, ITEM * item)
 }
 
 bool
-ginconsistent(QUERYTYPE * query, bool *check)
+ginconsistent(QUERYTYPE *query, bool *check)
 {
    GinChkVal   gcv;
    ITEM       *items = GETQUERY(query);
@@ -408,7 +408,7 @@ boolop(PG_FUNCTION_ARGS)
 }
 
 static void
-findoprnd(ITEM * ptr, int4 *pos)
+findoprnd(ITEM *ptr, int4 *pos)
 {
 #ifdef BS_DEBUG
    elog(DEBUG3, (ptr[*pos].type == OPR) ?
@@ -618,7 +618,7 @@ bqarr_out(PG_FUNCTION_ARGS)
 }
 
 static int4
-countdroptree(ITEM * q, int4 pos)
+countdroptree(ITEM *q, int4 pos)
 {
    if (q[pos].type == VAL)
        return 1;
@@ -634,7 +634,7 @@ countdroptree(ITEM * q, int4 pos)
  * we can modify query tree for clearing
  */
 int4
-shorterquery(ITEM * q, int4 len)
+shorterquery(ITEM *q, int4 len)
 {
    int4        index,
                posnot,
index 598cdeca5709fbda4d1acce42f6b6646ce49be8f..2bf8fc54bb495389094a585a3e6407fb94b300c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_int_gin.c,v 1.9 2009/03/25 22:19:01 tgl Exp $ 
+ * $PostgreSQL: pgsql/contrib/intarray/_int_gin.c,v 1.10 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -90,6 +90,7 @@ ginint4_consistent(PG_FUNCTION_ARGS)
 {
    bool       *check = (bool *) PG_GETARG_POINTER(0);
    StrategyNumber strategy = PG_GETARG_UINT16(1);
+
    /* int32    nkeys = PG_GETARG_INT32(3); */
    /* Pointer     *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(5);
index 13fee25ec721b6dd2a596638b5e4db24b36565d1..29e08eda664cc19248ec46577aab573cbe9c8a74 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_int_gist.c,v 1.22 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/intarray/_int_gist.c,v 1.23 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -42,6 +42,7 @@ g_int_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    ArrayType  *query = (ArrayType *) PG_DETOAST_DATUM_COPY(PG_GETARG_POINTER(1));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        retval;
index b29a405e355e828319663173b2ecf2a60a45d086..54858322a2eea0ade14940ae121731971744405b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_int_op.c,v 1.8 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/intarray/_int_op.c,v 1.9 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
index 7f7e4d43a9e225195463d609a91b48ce479d439a..8c0ec29c31bfcf4057edeb0039427ca6488402d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_int_tool.c,v 1.11 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/intarray/_int_tool.c,v 1.12 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
index d1e3f19037ddec336cd45f585901ffb25d628359..f9c5986db2227bb955a5f4a33397ce0c19a23afc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/intarray/_intbig_gist.c,v 1.19 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/intarray/_intbig_gist.c,v 1.20 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -78,7 +78,7 @@ _intbig_out(PG_FUNCTION_ARGS)
 ** intbig functions
 *********************************************************************/
 static bool
-_intbig_overlap(GISTTYPE * a, ArrayType *b)
+_intbig_overlap(GISTTYPE *a, ArrayType *b)
 {
    int         num = ARRNELEMS(b);
    int4       *ptr = ARRPTR(b);
@@ -96,7 +96,7 @@ _intbig_overlap(GISTTYPE * a, ArrayType *b)
 }
 
 static bool
-_intbig_contains(GISTTYPE * a, ArrayType *b)
+_intbig_contains(GISTTYPE *a, ArrayType *b)
 {
    int         num = ARRNELEMS(b);
    int4       *ptr = ARRPTR(b);
@@ -243,7 +243,7 @@ hemdistsign(BITVECP a, BITVECP b)
 }
 
 static int
-hemdist(GISTTYPE * a, GISTTYPE * b)
+hemdist(GISTTYPE *a, GISTTYPE *b)
 {
    if (ISALLTRUE(a))
    {
@@ -265,7 +265,7 @@ g_intbig_decompress(PG_FUNCTION_ARGS)
 }
 
 static int4
-unionkey(BITVECP sbase, GISTTYPE * add)
+unionkey(BITVECP sbase, GISTTYPE *add)
 {
    int4        i;
    BITVECP     sadd = GETSIGN(add);
@@ -506,6 +506,7 @@ g_intbig_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    ArrayType  *query = (ArrayType *) PG_DETOAST_DATUM(PG_GETARG_POINTER(1));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    bool        retval;
index 4991616915410d5223584581c127df5b57a7c701..449f70b811ad0adce4bf4a71637db459f6f0df73 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/contrib/isn/isn.c,v 1.10 2009/01/01 17:23:32 momjian Exp $
+ *   $PostgreSQL: pgsql/contrib/isn/isn.c,v 1.11 2009/06/11 14:48:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -33,7 +33,7 @@ enum isn_type
    INVALID, ANY, EAN13, ISBN, ISMN, ISSN, UPC
 };
 
-static const char * const isn_names[] = {"EAN13/UPC/ISxN", "EAN13/UPC/ISxN", "EAN13", "ISBN", "ISMN", "ISSN", "UPC"};
+static const char *const isn_names[] = {"EAN13/UPC/ISxN", "EAN13/UPC/ISxN", "EAN13", "ISBN", "ISMN", "ISSN", "UPC"};
 
 static bool g_weak = false;
 static bool g_initialized = false;
@@ -336,7 +336,7 @@ checkdig(char *num, unsigned size)
  * If errorOK is true, just return "false" for bad input.
  */
 static bool
-ean2isn(ean13 ean, bool errorOK, ean13 * result, enum isn_type accept)
+ean2isn(ean13 ean, bool errorOK, ean13 *result, enum isn_type accept)
 {
    enum isn_type type = INVALID;
 
@@ -668,7 +668,7 @@ eantoobig:
  * (even if the check digit is valid)
  */
 static bool
-string2ean(const char *str, bool errorOK, ean13 * result,
+string2ean(const char *str, bool errorOK, ean13 *result,
           enum isn_type accept)
 {
    bool        digit,
index 3d9145cf6b07856863b554d002304573d18c173d..15c4cc022d77ca9ad3b1f8a62ef7f55556a1cdd8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/ltree/_ltree_gist.c,v 1.25 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/ltree/_ltree_gist.c,v 1.26 2009/06/11 14:48:51 momjian Exp $
  *
  *
  * GiST support for ltree[]
@@ -59,7 +59,7 @@ static const uint8 number_of_ones[256] = {
 
 
 static void
-hashing(BITVECP sign, ltree * t)
+hashing(BITVECP sign, ltree *t)
 {
    int         tlen = t->numlevel;
    ltree_level *cur = LTREE_FIRST(t);
@@ -173,7 +173,7 @@ _ltree_same(PG_FUNCTION_ARGS)
 }
 
 static int4
-unionkey(BITVECP sbase, ltree_gist * add)
+unionkey(BITVECP sbase, ltree_gist *add)
 {
    int4        i;
    BITVECP     sadd = LTG_SIGN(add);
@@ -245,7 +245,7 @@ hemdistsign(BITVECP a, BITVECP b)
 }
 
 static int
-hemdist(ltree_gist * a, ltree_gist * b)
+hemdist(ltree_gist *a, ltree_gist *b)
 {
    if (LTG_ISALLTRUE(a))
    {
@@ -448,7 +448,7 @@ _ltree_picksplit(PG_FUNCTION_ARGS)
 }
 
 static bool
-gist_te(ltree_gist * key, ltree * query)
+gist_te(ltree_gist *key, ltree *query)
 {
    ltree_level *curq = LTREE_FIRST(query);
    BITVECP     sign = LTG_SIGN(key);
@@ -471,13 +471,13 @@ gist_te(ltree_gist * key, ltree * query)
 }
 
 static bool
-checkcondition_bit(void *checkval, ITEM * val)
+checkcondition_bit(void *checkval, ITEM *val)
 {
    return (FLG_CANLOOKSIGN(val->flag)) ? GETBIT(checkval, AHASHVAL(val->val)) : true;
 }
 
 static bool
-gist_qtxt(ltree_gist * key, ltxtquery * query)
+gist_qtxt(ltree_gist *key, ltxtquery *query)
 {
    if (LTG_ISALLTRUE(key))
        return true;
@@ -490,7 +490,7 @@ gist_qtxt(ltree_gist * key, ltxtquery * query)
 }
 
 static bool
-gist_qe(ltree_gist * key, lquery * query)
+gist_qe(ltree_gist *key, lquery *query)
 {
    lquery_level *curq = LQUERY_FIRST(query);
    BITVECP     sign = LTG_SIGN(key);
@@ -529,7 +529,7 @@ gist_qe(ltree_gist * key, lquery * query)
 }
 
 static bool
-_arrq_cons(ltree_gist * key, ArrayType *_query)
+_arrq_cons(ltree_gist *key, ArrayType *_query)
 {
    lquery     *query = (lquery *) ARR_DATA_PTR(_query);
    int         num = ArrayGetNItems(ARR_NDIM(_query), ARR_DIMS(_query));
@@ -559,6 +559,7 @@ _ltree_consistent(PG_FUNCTION_ARGS)
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    char       *query = (char *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1)));
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
index c0d0a95001961b26415f032c101c119b9b3ca24b..f9e90e978dd962956924fa9d5d992c063cbaee10 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/ltree/_ltree_op.c,v 1.12 2008/05/17 01:28:19 adunstan Exp $ 
+ * $PostgreSQL: pgsql/contrib/ltree/_ltree_op.c,v 1.13 2009/06/11 14:48:51 momjian Exp $
  *
  *
  * op function for ltree[]
@@ -43,7 +43,7 @@ typedef Datum (*PGCALL2) (PG_FUNCTION_ARGS);
 #define NEXTVAL(x) ( (ltree*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )
 
 static bool
-array_iterator(ArrayType *la, PGCALL2 callback, void *param, ltree ** found)
+array_iterator(ArrayType *la, PGCALL2 callback, void *param, ltree **found)
 {
    int         num = ArrayGetNItems(ARR_NDIM(la), ARR_DIMS(la));
    ltree      *item = (ltree *) ARR_DATA_PTR(la);
index 9dc710557453a0972f82b988fbca1a524e8ca5ac..df4f0794f2be4a5a01520af92718d024821421ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * op function for ltree and lquery
  * Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.13 2008/06/30 18:30:48 teodor Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/lquery_op.c,v 1.14 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -27,22 +27,22 @@ typedef struct
    int         nt;
    int         posq;
    int         post;
-}  FieldNot;
+} FieldNot;
 
 static char *
 getlexeme(char *start, char *end, int *len)
 {
    char       *ptr;
-   int        charlen;
-   
-   while (start < end && (charlen = pg_mblen(start)) == 1 && t_iseq(start,'_') )
+   int         charlen;
+
+   while (start < end && (charlen = pg_mblen(start)) == 1 && t_iseq(start, '_'))
        start += charlen;
 
    ptr = start;
    if (ptr >= end)
        return NULL;
 
-   while (ptr < end && !( (charlen = pg_mblen(ptr)) == 1 && t_iseq(ptr, '_') ) )
+   while (ptr < end && !((charlen = pg_mblen(ptr)) == 1 && t_iseq(ptr, '_')))
        ptr += charlen;
 
    *len = ptr - start;
@@ -50,7 +50,7 @@ getlexeme(char *start, char *end, int *len)
 }
 
 bool
-compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
+           compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
 {
    char       *endt = t->name + t->len;
    char       *endq = qn + len;
@@ -90,11 +90,11 @@ compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *,
 int
 ltree_strncasecmp(const char *a, const char *b, size_t s)
 {
-   char    *al = str_tolower(a, s);
-   char    *bl = str_tolower(b, s);
-   int      res;
-   
-   res = strncmp(al, bl,s);
+   char       *al = str_tolower(a, s);
+   char       *bl = str_tolower(b, s);
+   int         res;
+
+   res = strncmp(al, bl, s);
 
    pfree(al);
    pfree(bl);
@@ -103,7 +103,7 @@ ltree_strncasecmp(const char *a, const char *b, size_t s)
 }
 
 static bool
-checkLevel(lquery_level * curq, ltree_level * curt)
+checkLevel(lquery_level *curq, ltree_level *curt)
 {
    int         (*cmpptr) (const char *, const char *, size_t);
    lquery_variant *curvar = LQL_FIRST(curq);
@@ -154,7 +154,7 @@ static struct
 };
 
 static bool
-checkCond(lquery_level * curq, int query_numlevel, ltree_level * curt, int tree_numlevel, FieldNot * ptr)
+checkCond(lquery_level *curq, int query_numlevel, ltree_level *curt, int tree_numlevel, FieldNot *ptr)
 {
    uint32      low_pos = 0,
                high_pos = 0,
index 9cdfedab04f68d8513c7113cc61d84104effde30..f16c6f9a32a06930267a9385087a6d6a8a72cc05 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.21 2008/06/30 18:30:48 teodor Exp $ */
+/* $PostgreSQL: pgsql/contrib/ltree/ltree.h,v 1.22 2009/06/11 14:48:51 momjian Exp $ */
 
 #ifndef __LTREE_H__
 #define __LTREE_H__
@@ -11,7 +11,7 @@ typedef struct
 {
    uint16      len;
    char        name[1];
-}  ltree_level;
+} ltree_level;
 
 #define LEVEL_HDRSIZE  (offsetof(ltree_level,name))
 #define LEVEL_NEXT(x)  ( (ltree_level*)( ((char*)(x)) + MAXALIGN(((ltree_level*)(x))->len + LEVEL_HDRSIZE) ) )
@@ -21,7 +21,7 @@ typedef struct
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    uint16      numlevel;
    char        data[1];
-}  ltree;
+} ltree;
 
 #define LTREE_HDRSIZE  MAXALIGN( offsetof(ltree, data) )
 #define LTREE_FIRST(x) ( (ltree_level*)( ((char*)(x))+LTREE_HDRSIZE ) )
@@ -35,7 +35,7 @@ typedef struct
    uint16      len;
    uint8       flag;
    char        name[1];
-}  lquery_variant;
+} lquery_variant;
 
 #define LVAR_HDRSIZE   MAXALIGN(offsetof(lquery_variant, name))
 #define LVAR_NEXT(x)   ( (lquery_variant*)( ((char*)(x)) + MAXALIGN(((lquery_variant*)(x))->len) + LVAR_HDRSIZE ) )
@@ -52,7 +52,7 @@ typedef struct
    uint16      low;
    uint16      high;
    char        variants[1];
-}  lquery_level;
+} lquery_level;
 
 #define LQL_HDRSIZE MAXALIGN( offsetof(lquery_level,variants) )
 #define LQL_NEXT(x) ( (lquery_level*)( ((char*)(x)) + MAXALIGN(((lquery_level*)(x))->totallen) ) )
@@ -73,14 +73,14 @@ typedef struct
    uint16      firstgood;
    uint16      flag;
    char        data[1];
-}  lquery;
+} lquery;
 
 #define LQUERY_HDRSIZE  MAXALIGN( offsetof(lquery, data) )
 #define LQUERY_FIRST(x)   ( (lquery_level*)( ((char*)(x))+LQUERY_HDRSIZE ) )
 
 #define LQUERY_HASNOT      0x01
 
-#define ISALNUM(x) ( t_isalpha(x) || t_isdigit(x)  || ( pg_mblen(x) == 1 && t_iseq((x), '_') ) )
+#define ISALNUM(x) ( t_isalpha(x) || t_isdigit(x)  || ( pg_mblen(x) == 1 && t_iseq((x), '_') ) )
 
 /* full text query */
 
@@ -97,7 +97,7 @@ typedef struct ITEM
    /* user-friendly value */
    uint8       length;
    uint16      distance;
-}  ITEM;
+} ITEM;
 
 /*
  *Storage:
@@ -108,7 +108,7 @@ typedef struct
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    int4        size;
    char        data[1];
-}  ltxtquery;
+} ltxtquery;
 
 #define HDRSIZEQT      MAXALIGN(VARHDRSZ + sizeof(int4))
 #define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + (size) * sizeof(ITEM) + (lenofoperand) )
@@ -153,15 +153,15 @@ Datum     ltree_textadd(PG_FUNCTION_ARGS);
 /* Util function */
 Datum      ltree_in(PG_FUNCTION_ARGS);
 
-bool ltree_execute(ITEM * curitem, void *checkval,
-             bool calcnot, bool (*chkcond) (void *checkval, ITEM * val));
+bool ltree_execute(ITEM *curitem, void *checkval,
+             bool calcnot, bool (*chkcond) (void *checkval, ITEM *val));
 
-int            ltree_compare(const ltree * a, const ltree * b);
-bool       inner_isparent(const ltree * c, const ltree * p);
-bool       compare_subnode(ltree_level * t, char *q, int len,
-                   int (*cmpptr) (const char *, const char *, size_t), bool anyend);
-ltree     *lca_inner(ltree ** a, int len);
-int        ltree_strncasecmp(const char *a, const char *b, size_t s);
+int            ltree_compare(const ltree *a, const ltree *b);
+bool       inner_isparent(const ltree *c, const ltree *p);
+bool compare_subnode(ltree_level *t, char *q, int len,
+           int (*cmpptr) (const char *, const char *, size_t), bool anyend);
+ltree     *lca_inner(ltree **a, int len);
+int            ltree_strncasecmp(const char *a, const char *b, size_t s);
 
 #define PG_GETARG_LTREE(x) ((ltree*)DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(x))))
 #define PG_GETARG_LTREE_COPY(x) ((ltree*)DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(x))))
@@ -207,7 +207,7 @@ typedef struct
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    uint32      flag;
    char        data[1];
-}  ltree_gist;
+} ltree_gist;
 
 #define LTG_ONENODE 0x01
 #define LTG_ALLTRUE 0x02
index d7c9403dc7a39df11a4b651b009e03515ddeaff0..d48ca8e1d4ee387a81cc70e987cee0476876269a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * GiST support for ltree
  * Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.24 2008/05/12 00:00:42 alvherre Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.25 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -150,7 +150,7 @@ ltree_same(PG_FUNCTION_ARGS)
 }
 
 static void
-hashing(BITVECP sign, ltree * t)
+hashing(BITVECP sign, ltree *t)
 {
    int         tlen = t->numlevel;
    ltree_level *cur = LTREE_FIRST(t);
@@ -271,7 +271,7 @@ typedef struct rix
 {
    int         index;
    ltree      *r;
-}  RIX;
+} RIX;
 
 static int
 treekey_cmp(const void *a, const void *b)
@@ -441,7 +441,7 @@ ltree_picksplit(PG_FUNCTION_ARGS)
 }
 
 static bool
-gist_isparent(ltree_gist * key, ltree * query)
+gist_isparent(ltree_gist *key, ltree *query)
 {
    int4        numlevel = query->numlevel;
    int         i;
@@ -461,7 +461,7 @@ gist_isparent(ltree_gist * key, ltree * query)
 }
 
 static ltree *
-copy_ltree(ltree * src)
+copy_ltree(ltree *src)
 {
    ltree      *dst = (ltree *) palloc(VARSIZE(src));
 
@@ -470,7 +470,7 @@ copy_ltree(ltree * src)
 }
 
 static bool
-gist_ischild(ltree_gist * key, ltree * query)
+gist_ischild(ltree_gist *key, ltree *query)
 {
    ltree      *left = copy_ltree(LTG_GETLNODE(key));
    ltree      *right = copy_ltree(LTG_GETRNODE(key));
@@ -495,7 +495,7 @@ gist_ischild(ltree_gist * key, ltree * query)
 }
 
 static bool
-gist_qe(ltree_gist * key, lquery * query)
+gist_qe(ltree_gist *key, lquery *query)
 {
    lquery_level *curq = LQUERY_FIRST(query);
    BITVECP     sign = LTG_SIGN(key);
@@ -534,7 +534,7 @@ gist_qe(ltree_gist * key, lquery * query)
 }
 
 static int
-gist_tqcmp(ltree * t, lquery * q)
+gist_tqcmp(ltree *t, lquery *q)
 {
    ltree_level *al = LTREE_FIRST(t);
    lquery_level *ql = LQUERY_FIRST(q);
@@ -563,7 +563,7 @@ gist_tqcmp(ltree * t, lquery * q)
 }
 
 static bool
-gist_between(ltree_gist * key, lquery * query)
+gist_between(ltree_gist *key, lquery *query)
 {
    if (query->firstgood == 0)
        return true;
@@ -578,13 +578,13 @@ gist_between(ltree_gist * key, lquery * query)
 }
 
 static bool
-checkcondition_bit(void *checkval, ITEM * val)
+checkcondition_bit(void *checkval, ITEM *val)
 {
    return (FLG_CANLOOKSIGN(val->flag)) ? GETBIT(checkval, HASHVAL(val->val)) : true;
 }
 
 static bool
-gist_qtxt(ltree_gist * key, ltxtquery * query)
+gist_qtxt(ltree_gist *key, ltxtquery *query)
 {
    if (LTG_ISALLTRUE(key))
        return true;
@@ -597,7 +597,7 @@ gist_qtxt(ltree_gist * key, ltxtquery * query)
 }
 
 static bool
-arrq_cons(ltree_gist * key, ArrayType *_query)
+arrq_cons(ltree_gist *key, ArrayType *_query)
 {
    lquery     *query = (lquery *) ARR_DATA_PTR(_query);
    int         num = ArrayGetNItems(ARR_NDIM(_query), ARR_DIMS(_query));
@@ -626,6 +626,7 @@ ltree_consistent(PG_FUNCTION_ARGS)
 {
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
index 19645be38f7f27cd8c635d4fd0ffdb1c6f655ca5..a88eb16cb97d506df3a9f87eb73d6a56fc9b9e65 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * in/out function for ltree and lquery
  * Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.17 2008/06/30 18:30:48 teodor Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltree_io.c,v 1.18 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -32,10 +32,10 @@ Datum       lquery_out(PG_FUNCTION_ARGS);
 typedef struct
 {
    char       *start;
-   int         len;  /* length in bytes */ 
+   int         len;            /* length in bytes */
    int         flag;
-   int         wlen; /* length in characters */
-}  nodeitem;
+   int         wlen;           /* length in characters */
+} nodeitem;
 
 #define LTPRS_WAITNAME 0
 #define LTPRS_WAITDELIM 1
@@ -52,16 +52,16 @@ ltree_in(PG_FUNCTION_ARGS)
    int         state = LTPRS_WAITNAME;
    ltree      *result;
    ltree_level *curlevel;
-   int         charlen;
-   int         pos=0;
+   int         charlen;
+   int         pos = 0;
 
    ptr = buf;
    while (*ptr)
    {
        charlen = pg_mblen(ptr);
-       if ( charlen == 1 && t_iseq(ptr, '.') )
+       if (charlen == 1 && t_iseq(ptr, '.'))
            num++;
-       ptr+=charlen;
+       ptr += charlen;
    }
 
    list = lptr = (nodeitem *) palloc(sizeof(nodeitem) * (num + 1));
@@ -83,7 +83,7 @@ ltree_in(PG_FUNCTION_ARGS)
        }
        else if (state == LTPRS_WAITDELIM)
        {
-           if ( charlen == 1 && t_iseq(ptr, '.') )
+           if (charlen == 1 && t_iseq(ptr, '.'))
            {
                lptr->len = ptr - lptr->start;
                if (lptr->wlen > 255)
@@ -92,7 +92,7 @@ ltree_in(PG_FUNCTION_ARGS)
                             errmsg("name of level is too long"),
                             errdetail("Name length is %d, must "
                                       "be < 256, in position %d.",
-                                    lptr->wlen, pos)));
+                                      lptr->wlen, pos)));
 
                totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE);
                lptr++;
@@ -105,7 +105,7 @@ ltree_in(PG_FUNCTION_ARGS)
            /* internal error */
            elog(ERROR, "internal error in parser");
 
-       ptr+=charlen;
+       ptr += charlen;
        lptr->wlen++;
        pos++;
    }
@@ -209,14 +209,14 @@ lquery_in(PG_FUNCTION_ARGS)
    bool        hasnot = false;
    bool        wasbad = false;
    int         charlen;
-   int         pos=0;
+   int         pos = 0;
 
    ptr = buf;
    while (*ptr)
    {
        charlen = pg_mblen(ptr);
 
-       if ( charlen == 1 )
+       if (charlen == 1)
        {
            if (t_iseq(ptr, '.'))
                num++;
@@ -224,7 +224,7 @@ lquery_in(PG_FUNCTION_ARGS)
                numOR++;
        }
 
-       ptr+=charlen;
+       ptr += charlen;
    }
 
    num++;
@@ -243,7 +243,7 @@ lquery_in(PG_FUNCTION_ARGS)
                state = LQPRS_WAITDELIM;
                curqlevel->numvar = 1;
            }
-           else if (charlen==1 && t_iseq(ptr, '!'))
+           else if (charlen == 1 && t_iseq(ptr, '!'))
            {
                GETVAR(curqlevel) = lptr = (nodeitem *) palloc0(sizeof(nodeitem) * (numOR + 1));
                lptr->start = ptr + 1;
@@ -252,7 +252,7 @@ lquery_in(PG_FUNCTION_ARGS)
                curqlevel->flag |= LQL_NOT;
                hasnot = true;
            }
-           else if (charlen==1 && t_iseq(ptr, '*'))
+           else if (charlen == 1 && t_iseq(ptr, '*'))
                state = LQPRS_WAITOPEN;
            else
                UNCHAR;
@@ -271,28 +271,28 @@ lquery_in(PG_FUNCTION_ARGS)
        }
        else if (state == LQPRS_WAITDELIM)
        {
-           if (charlen==1 && t_iseq(ptr, '@'))
+           if (charlen == 1 && t_iseq(ptr, '@'))
            {
                if (lptr->start == ptr)
                    UNCHAR;
                lptr->flag |= LVAR_INCASE;
                curqlevel->flag |= LVAR_INCASE;
            }
-           else if (charlen==1 && t_iseq(ptr, '*'))
+           else if (charlen == 1 && t_iseq(ptr, '*'))
            {
                if (lptr->start == ptr)
                    UNCHAR;
                lptr->flag |= LVAR_ANYEND;
                curqlevel->flag |= LVAR_ANYEND;
            }
-           else if (charlen==1 && t_iseq(ptr, '%'))
+           else if (charlen == 1 && t_iseq(ptr, '%'))
            {
                if (lptr->start == ptr)
                    UNCHAR;
                lptr->flag |= LVAR_SUBLEXEME;
                curqlevel->flag |= LVAR_SUBLEXEME;
            }
-           else if (charlen==1 && t_iseq(ptr, '|'))
+           else if (charlen == 1 && t_iseq(ptr, '|'))
            {
                lptr->len = ptr - lptr->start -
                    ((lptr->flag & LVAR_SUBLEXEME) ? 1 : 0) -
@@ -304,11 +304,11 @@ lquery_in(PG_FUNCTION_ARGS)
                             errmsg("name of level is too long"),
                             errdetail("Name length is %d, must "
                                       "be < 256, in position %d.",
-                                    lptr->wlen, pos)));
+                                      lptr->wlen, pos)));
 
                state = LQPRS_WAITVAR;
            }
-           else if (charlen==1 && t_iseq(ptr, '.'))
+           else if (charlen == 1 && t_iseq(ptr, '.'))
            {
                lptr->len = ptr - lptr->start -
                    ((lptr->flag & LVAR_SUBLEXEME) ? 1 : 0) -
@@ -320,7 +320,7 @@ lquery_in(PG_FUNCTION_ARGS)
                             errmsg("name of level is too long"),
                             errdetail("Name length is %d, must "
                                       "be < 256, in position %d.",
-                                    lptr->wlen, pos)));
+                                      lptr->wlen, pos)));
 
                state = LQPRS_WAITLEVEL;
                curqlevel = NEXTLEV(curqlevel);
@@ -335,9 +335,9 @@ lquery_in(PG_FUNCTION_ARGS)
        }
        else if (state == LQPRS_WAITOPEN)
        {
-           if (charlen==1 && t_iseq(ptr, '{'))
+           if (charlen == 1 && t_iseq(ptr, '{'))
                state = LQPRS_WAITFNUM;
-           else if (charlen==1 && t_iseq(ptr, '.'))
+           else if (charlen == 1 && t_iseq(ptr, '.'))
            {
                curqlevel->low = 0;
                curqlevel->high = 0xffff;
@@ -349,7 +349,7 @@ lquery_in(PG_FUNCTION_ARGS)
        }
        else if (state == LQPRS_WAITFNUM)
        {
-           if (charlen==1 && t_iseq(ptr, ','))
+           if (charlen == 1 && t_iseq(ptr, ','))
                state = LQPRS_WAITSNUM;
            else if (t_isdigit(ptr))
            {
@@ -366,7 +366,7 @@ lquery_in(PG_FUNCTION_ARGS)
                curqlevel->high = atoi(ptr);
                state = LQPRS_WAITCLOSE;
            }
-           else if (charlen==1 && t_iseq(ptr, '}'))
+           else if (charlen == 1 && t_iseq(ptr, '}'))
            {
                curqlevel->high = 0xffff;
                state = LQPRS_WAITEND;
@@ -376,26 +376,26 @@ lquery_in(PG_FUNCTION_ARGS)
        }
        else if (state == LQPRS_WAITCLOSE)
        {
-           if (charlen==1 && t_iseq(ptr, '}'))
+           if (charlen == 1 && t_iseq(ptr, '}'))
                state = LQPRS_WAITEND;
            else if (!t_isdigit(ptr))
                UNCHAR;
        }
        else if (state == LQPRS_WAITND)
        {
-           if (charlen==1 && t_iseq(ptr, '}'))
+           if (charlen == 1 && t_iseq(ptr, '}'))
            {
                curqlevel->high = curqlevel->low;
                state = LQPRS_WAITEND;
            }
-           else if (charlen==1 && t_iseq(ptr, ','))
+           else if (charlen == 1 && t_iseq(ptr, ','))
                state = LQPRS_WAITSNUM;
            else if (!t_isdigit(ptr))
                UNCHAR;
        }
        else if (state == LQPRS_WAITEND)
        {
-           if (charlen==1 && t_iseq(ptr, '.'))
+           if (charlen == 1 && t_iseq(ptr, '.'))
            {
                state = LQPRS_WAITLEVEL;
                curqlevel = NEXTLEV(curqlevel);
@@ -407,8 +407,8 @@ lquery_in(PG_FUNCTION_ARGS)
            /* internal error */
            elog(ERROR, "internal error in parser");
 
-       ptr+=charlen;
-       if ( state == LQPRS_WAITDELIM )
+       ptr += charlen;
+       if (state == LQPRS_WAITDELIM)
            lptr->wlen++;
        pos++;
    }
index a6f0ef3f24fea6e1e360e21fc2e691c3ee285270..2e6d5367d8953beabc525b7d1f77bcd1bc82f187 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * op function for ltree
  * Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.19 2008/05/12 00:00:43 alvherre Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.20 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -58,7 +58,7 @@ Datum     text2ltree(PG_FUNCTION_ARGS);
 Datum      ltreeparentsel(PG_FUNCTION_ARGS);
 
 int
-ltree_compare(const ltree * a, const ltree * b)
+ltree_compare(const ltree *a, const ltree *b)
 {
    ltree_level *al = LTREE_FIRST(a);
    ltree_level *bl = LTREE_FIRST(b);
@@ -152,7 +152,7 @@ nlevel(PG_FUNCTION_ARGS)
 }
 
 bool
-inner_isparent(const ltree * c, const ltree * p)
+inner_isparent(const ltree *c, const ltree *p)
 {
    ltree_level *cl = LTREE_FIRST(c);
    ltree_level *pl = LTREE_FIRST(p);
@@ -201,7 +201,7 @@ ltree_risparent(PG_FUNCTION_ARGS)
 
 
 static ltree *
-inner_subltree(ltree * t, int4 startpos, int4 endpos)
+inner_subltree(ltree *t, int4 startpos, int4 endpos)
 {
    char       *start = NULL,
               *end = NULL;
@@ -283,7 +283,7 @@ subpath(PG_FUNCTION_ARGS)
 }
 
 static ltree *
-ltree_concat(ltree * a, ltree * b)
+ltree_concat(ltree *a, ltree *b)
 {
    ltree      *r;
 
@@ -422,7 +422,7 @@ ltree_textadd(PG_FUNCTION_ARGS)
 }
 
 ltree *
-lca_inner(ltree ** a, int len)
+lca_inner(ltree **a, int len)
 {
    int         tmp,
                num = ((*a)->numlevel) ? (*a)->numlevel - 1 : 0;
@@ -626,11 +626,11 @@ ltreeparentsel(PG_FUNCTION_ARGS)
        else if (hist_size < 100)
        {
            /*
-            * For histogram sizes from 10 to 100, we combine the
-            * histogram and default selectivities, putting increasingly
-            * more trust in the histogram for larger sizes.
+            * For histogram sizes from 10 to 100, we combine the histogram
+            * and default selectivities, putting increasingly more trust in
+            * the histogram for larger sizes.
             */
-           double  hist_weight = hist_size / 100.0;
+           double      hist_weight = hist_size / 100.0;
 
            selec = selec * hist_weight +
                DEFAULT_PARENT_SEL * (1.0 - hist_weight);
index eece52972aa0461bb65961fa041dae3bd32af827..b158c4b4416f16d9593f153c17b5a9558c30b7d9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * txtquery io
  * Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltxtquery_io.c,v 1.16 2008/06/30 18:30:48 teodor Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltxtquery_io.c,v 1.17 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -51,30 +51,30 @@ typedef struct
    int4        sumlen;
    char       *op;
    char       *curop;
-}  QPRS_STATE;
+} QPRS_STATE;
 
 /*
  * get token from query string
  */
 static int4
-gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, uint16 *flag)
+gettoken_query(QPRS_STATE *state, int4 *val, int4 *lenval, char **strval, uint16 *flag)
 {
-   int charlen;
+   int         charlen;
 
-   for(;;) 
+   for (;;)
    {
        charlen = pg_mblen(state->buf);
 
        switch (state->state)
        {
            case WAITOPERAND:
-               if (charlen==1 && t_iseq(state->buf, '!'))
+               if (charlen == 1 && t_iseq(state->buf, '!'))
                {
                    (state->buf)++;
                    *val = (int4) '!';
                    return OPR;
                }
-               else if (charlen==1 && t_iseq(state->buf, '('))
+               else if (charlen == 1 && t_iseq(state->buf, '('))
                {
                    state->count++;
                    (state->buf)++;
@@ -101,11 +101,11 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, uint1
                                 errmsg("modificators syntax error")));
                    *lenval += charlen;
                }
-               else if (charlen==1 && t_iseq(state->buf, '%'))
+               else if (charlen == 1 && t_iseq(state->buf, '%'))
                    *flag |= LVAR_SUBLEXEME;
-               else if (charlen==1 && t_iseq(state->buf, '@'))
+               else if (charlen == 1 && t_iseq(state->buf, '@'))
                    *flag |= LVAR_INCASE;
-               else if (charlen==1 && t_iseq(state->buf, '*'))
+               else if (charlen == 1 && t_iseq(state->buf, '*'))
                    *flag |= LVAR_ANYEND;
                else
                {
@@ -114,14 +114,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, uint1
                }
                break;
            case WAITOPERATOR:
-               if (charlen==1 && ( t_iseq(state->buf, '&') || t_iseq(state->buf, '|') ))
+               if (charlen == 1 && (t_iseq(state->buf, '&') || t_iseq(state->buf, '|')))
                {
                    state->state = WAITOPERAND;
                    *val = (int4) *(state->buf);
                    (state->buf)++;
                    return OPR;
                }
-               else if (charlen==1 && t_iseq(state->buf, ')'))
+               else if (charlen == 1 && t_iseq(state->buf, ')'))
                {
                    (state->buf)++;
                    state->count--;
@@ -129,7 +129,7 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, uint1
                }
                else if (*(state->buf) == '\0')
                    return (state->count) ? ERR : END;
-               else if (charlen==1 && !t_iseq(state->buf, ' '))
+               else if (charlen == 1 && !t_iseq(state->buf, ' '))
                    return ERR;
                break;
            default:
@@ -146,7 +146,7 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, uint1
  * push new one in polish notation reverse view
  */
 static void
-pushquery(QPRS_STATE * state, int4 type, int4 val, int4 distance, int4 lenval, uint16 flag)
+pushquery(QPRS_STATE *state, int4 type, int4 val, int4 distance, int4 lenval, uint16 flag)
 {
    NODE       *tmp = (NODE *) palloc(sizeof(NODE));
 
@@ -172,7 +172,7 @@ pushquery(QPRS_STATE * state, int4 type, int4 val, int4 distance, int4 lenval, u
  * This function is used for query_txt parsing
  */
 static void
-pushval_asis(QPRS_STATE * state, int type, char *strval, int lenval, uint16 flag)
+pushval_asis(QPRS_STATE *state, int type, char *strval, int lenval, uint16 flag)
 {
    if (lenval > 0xffff)
        ereport(ERROR,
@@ -203,7 +203,7 @@ pushval_asis(QPRS_STATE * state, int type, char *strval, int lenval, uint16 flag
  * make polish notaion of query
  */
 static int4
-makepol(QPRS_STATE * state)
+makepol(QPRS_STATE *state)
 {
    int4        val = 0,
                type;
@@ -275,7 +275,7 @@ makepol(QPRS_STATE * state)
 }
 
 static void
-findoprnd(ITEM * ptr, int4 *pos)
+findoprnd(ITEM *ptr, int4 *pos)
 {
    if (ptr[*pos].type == VAL || ptr[*pos].type == VALTRUE)
    {
index 647d978fec63bb77f5513c3582b20b00876f4cba..559c05e2bf7226429ee75e4a9e9b341772d26b4f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * txtquery operations with ltree
  * Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltxtquery_op.c,v 1.9 2008/06/30 18:30:48 teodor Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltxtquery_op.c,v 1.10 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres.h"
 
@@ -16,7 +16,7 @@ PG_FUNCTION_INFO_V1(ltxtq_rexec);
  * check for boolean condition
  */
 bool
-ltree_execute(ITEM * curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM * val))
+ltree_execute(ITEM *curitem, void *checkval, bool calcnot, bool (*chkcond) (void *checkval, ITEM *val))
 {
    if (curitem->type == VAL)
        return (*chkcond) (checkval, curitem);
@@ -50,7 +50,7 @@ typedef struct
 } CHKVAL;
 
 static bool
-checkcondition_str(void *checkval, ITEM * val)
+checkcondition_str(void *checkval, ITEM *val)
 {
    ltree_level *level = LTREE_FIRST(((CHKVAL *) checkval)->node);
    int         tlen = ((CHKVAL *) checkval)->node->numlevel;
index 7b9046bb18b45ccf6e3fc90c9f62ccb9be2c43bd..9d896b84f5d9f6bb10ac0cc09f271d63687da24e 100644 (file)
@@ -5,7 +5,7 @@
  * Originally by
  * B. Palmer, bpalmer@crimelabs.net 1-17-2001
  *
- * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.35 2009/02/27 09:30:21 petere Exp $
+ * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.36 2009/06/11 14:48:51 momjian Exp $
  */
 #include "postgres_fe.h"
 
@@ -24,7 +24,7 @@ typedef struct
    char      **array;
    int         num;
    int         alloc;
-}  eary;
+} eary;
 
 /* these are the opts structures for command line params */
 struct options
@@ -51,8 +51,8 @@ static void help(const char *progname);
 void       get_opts(int, char **, struct options *);
 void      *myalloc(size_t size);
 char      *mystrdup(const char *str);
-void       add_one_elt(char *eltname, eary * eary);
-char      *get_comma_elts(eary * eary);
+void       add_one_elt(char *eltname, eary *eary);
+char      *get_comma_elts(eary *eary);
 PGconn    *sql_conn(struct options *);
 int            sql_exec(PGconn *, const char *sql, bool quiet);
 void       sql_exec_dumpalldbs(PGconn *, struct options *);
@@ -230,18 +230,19 @@ mystrdup(const char *str)
  * Add one element to a (possibly empty) eary struct.
  */
 void
-add_one_elt(char *eltname, eary * eary)
+add_one_elt(char *eltname, eary *eary)
 {
    if (eary->alloc == 0)
    {
-       eary->alloc = 8;
-       eary->array = (char **) myalloc(8 * sizeof(char *));
+       eary      ->alloc = 8;
+       eary      ->array = (char **) myalloc(8 * sizeof(char *));
    }
    else if (eary->num >= eary->alloc)
    {
-       eary->alloc *= 2;
-       eary->array = (char **)
-           realloc(eary->array, eary->alloc * sizeof(char *));
+       eary      ->alloc *= 2;
+       eary      ->array = (char **)
+       realloc(eary->array, eary->alloc * sizeof(char *));
+
        if (!eary->array)
        {
            fprintf(stderr, "out of memory");
@@ -249,8 +250,8 @@ add_one_elt(char *eltname, eary * eary)
        }
    }
 
-   eary->array[eary->num] = mystrdup(eltname);
-   eary->num++;
+   eary      ->array[eary->num] = mystrdup(eltname);
+   eary      ->num++;
 }
 
 /*
@@ -261,7 +262,7 @@ add_one_elt(char *eltname, eary * eary)
  * SQL statement.
  */
 char *
-get_comma_elts(eary * eary)
+get_comma_elts(eary *eary)
 {
    char       *ret,
               *ptr;
@@ -310,8 +311,8 @@ sql_conn(struct options * my_opts)
        new_pass = false;
        conn = PQsetdbLogin(my_opts->hostname,
                            my_opts->port,
-                           NULL,   /* options */
-                           NULL,   /* tty */
+                           NULL,       /* options */
+                           NULL,       /* tty */
                            my_opts->dbname,
                            my_opts->username,
                            password);
index 85935b99905627a1928ae7134ce4befa9c2fe19e..4f56864d2e18bfae67aba76bb529997c82f946f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/pageinspect/btreefuncs.c,v 1.9 2009/03/31 22:54:31 tgl Exp $ 
+ * $PostgreSQL: pgsql/contrib/pageinspect/btreefuncs.c,v 1.10 2009/06/11 14:48:51 momjian Exp $
  *
  *
  * btreefuncs.c
@@ -83,7 +83,7 @@ typedef struct BTPageStat
    }           btpo;
    uint16      btpo_flags;
    BTCycleId   btpo_cycleid;
-}  BTPageStat;
+} BTPageStat;
 
 
 /* -------------------------------------------------
@@ -93,7 +93,7 @@ typedef struct BTPageStat
  * -------------------------------------------------
  */
 static void
-GetBTPageStatistics(BlockNumber blkno, Buffer buffer, BTPageStat * stat)
+GetBTPageStatistics(BlockNumber blkno, Buffer buffer, BTPageStat *stat)
 {
    Page        page = BufferGetPage(buffer);
    PageHeader  phdr = (PageHeader) page;
@@ -191,9 +191,9 @@ bt_page_stats(PG_FUNCTION_ARGS)
             RelationGetRelationName(rel));
 
    /*
-    * Reject attempts to read non-local temporary relations; we would
-    * be likely to get wrong data since we have no visibility into the
-    * owning session's local buffers.
+    * Reject attempts to read non-local temporary relations; we would be
+    * likely to get wrong data since we have no visibility into the owning
+    * session's local buffers.
     */
    if (RELATION_IS_OTHER_TEMP(rel))
        ereport(ERROR,
@@ -309,14 +309,14 @@ bt_page_items(PG_FUNCTION_ARGS)
                 RelationGetRelationName(rel));
 
        /*
-        * Reject attempts to read non-local temporary relations; we would
-        * be likely to get wrong data since we have no visibility into the
+        * Reject attempts to read non-local temporary relations; we would be
+        * likely to get wrong data since we have no visibility into the
         * owning session's local buffers.
         */
        if (RELATION_IS_OTHER_TEMP(rel))
            ereport(ERROR,
                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                    errmsg("cannot access temporary tables of other sessions")));
+               errmsg("cannot access temporary tables of other sessions")));
 
        if (blkno == 0)
            elog(ERROR, "block 0 is a meta page");
@@ -458,9 +458,9 @@ bt_metap(PG_FUNCTION_ARGS)
             RelationGetRelationName(rel));
 
    /*
-    * Reject attempts to read non-local temporary relations; we would
-    * be likely to get wrong data since we have no visibility into the
-    * owning session's local buffers.
+    * Reject attempts to read non-local temporary relations; we would be
+    * likely to get wrong data since we have no visibility into the owning
+    * session's local buffers.
     */
    if (RELATION_IS_OTHER_TEMP(rel))
        ereport(ERROR,
index 71f1e23fa6bdcb1d3330d6adc10250e7771c0bd4..7f87726651dd0740844471fce0a1b44821626a84 100644 (file)
@@ -12,7 +12,7 @@
  * Copyright (c) 2007-2009, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/contrib/pageinspect/fsmfuncs.c,v 1.2 2009/01/01 17:23:32 momjian Exp $
+ *   $PostgreSQL: pgsql/contrib/pageinspect/fsmfuncs.c,v 1.3 2009/06/11 14:48:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -24,7 +24,7 @@
 #include "miscadmin.h"
 #include "funcapi.h"
 
-Datum fsm_page_contents(PG_FUNCTION_ARGS);
+Datum      fsm_page_contents(PG_FUNCTION_ARGS);
 
 /*
  * Dumps the contents of a FSM page.
@@ -50,7 +50,7 @@ fsm_page_contents(PG_FUNCTION_ARGS)
 
    initStringInfo(&sinfo);
 
-   for(i=0; i < NodesPerPage; i++)
+   for (i = 0; i < NodesPerPage; i++)
    {
        if (fsmpage->fp_nodes[i] != 0)
            appendStringInfo(&sinfo, "%d: %d\n", i, fsmpage->fp_nodes[i]);
index 2b8688d0fb171af3780f2e9386d155a99a5389d0..bdd742db5dfdc9d6ef0b8630778fe1122bf56e0c 100644 (file)
@@ -18,7 +18,7 @@
  * Copyright (c) 2007-2009, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/contrib/pageinspect/heapfuncs.c,v 1.6 2009/01/01 17:23:32 momjian Exp $
+ *   $PostgreSQL: pgsql/contrib/pageinspect/heapfuncs.c,v 1.7 2009/06/11 14:48:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -72,7 +72,7 @@ typedef struct heap_page_items_state
    TupleDesc   tupd;
    Page        page;
    uint16      offset;
-}  heap_page_items_state;
+} heap_page_items_state;
 
 Datum
 heap_page_items(PG_FUNCTION_ARGS)
@@ -189,7 +189,7 @@ heap_page_items(PG_FUNCTION_ARGS)
                        (((char *) tuphdr->t_bits) -((char *) tuphdr));
 
                    values[11] = CStringGetTextDatum(
-                       bits_to_text(tuphdr->t_bits, bits_len * 8));
+                                bits_to_text(tuphdr->t_bits, bits_len * 8));
                }
                else
                    nulls[11] = true;
index 00e2535eae691d0b0873bae1093b9165989a4f38..9430e855bf9172c0a9a77f3a88c20aa8cc3bb93f 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright (c) 2007-2009, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.12 2009/06/08 16:22:44 tgl Exp $
+ *   $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.13 2009/06/11 14:48:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -33,7 +33,7 @@ Datum     get_raw_page_fork(PG_FUNCTION_ARGS);
 Datum      page_header(PG_FUNCTION_ARGS);
 
 static bytea *get_raw_page_internal(text *relname, ForkNumber forknum,
-                                   BlockNumber blkno);
+                     BlockNumber blkno);
 
 
 /*
@@ -121,9 +121,9 @@ get_raw_page_internal(text *relname, ForkNumber forknum, BlockNumber blkno)
                        RelationGetRelationName(rel))));
 
    /*
-    * Reject attempts to read non-local temporary relations; we would
-    * be likely to get wrong data since we have no visibility into the
-    * owning session's local buffers.
+    * Reject attempts to read non-local temporary relations; we would be
+    * likely to get wrong data since we have no visibility into the owning
+    * session's local buffers.
     */
    if (RELATION_IS_OTHER_TEMP(rel))
        ereport(ERROR,
index ef18fa10485ee7eaf38cae5fb93d0ffb4f77f2c9..5939f52a044977671a9508af2259816fcad6f688 100644 (file)
@@ -3,7 +3,7 @@
  * pg_buffercache_pages.c
  *   display some contents of the buffer cache
  *
- *   $PostgreSQL: pgsql/contrib/pg_buffercache/pg_buffercache_pages.c,v 1.15 2008/08/14 12:56:41 heikki Exp $
+ *   $PostgreSQL: pgsql/contrib/pg_buffercache/pg_buffercache_pages.c,v 1.16 2009/06/11 14:48:51 momjian Exp $
  *-------------------------------------------------------------------------
  */
 #include "postgres.h"
@@ -37,7 +37,7 @@ typedef struct
    bool        isvalid;
    bool        isdirty;
    uint16      usagecount;
-}  BufferCachePagesRec;
+} BufferCachePagesRec;
 
 
 /*
@@ -47,7 +47,7 @@ typedef struct
 {
    TupleDesc   tupdesc;
    BufferCachePagesRec *record;
-}  BufferCachePagesContext;
+} BufferCachePagesContext;
 
 
 /*
index 9c16335671b204d5bb355a77807a308f06e6fe18..4b1dece12ae2689470d404a3f37531f19b384d82 100644 (file)
@@ -3,7 +3,7 @@
  * pg_freespacemap.c
  *   display contents of a free space map
  *
- *   $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.13 2009/04/07 17:57:50 tgl Exp $
+ *   $PostgreSQL: pgsql/contrib/pg_freespacemap/pg_freespacemap.c,v 1.14 2009/06/11 14:48:51 momjian Exp $
  *-------------------------------------------------------------------------
  */
 #include "postgres.h"
@@ -27,10 +27,10 @@ PG_FUNCTION_INFO_V1(pg_freespace);
 Datum
 pg_freespace(PG_FUNCTION_ARGS)
 {
-   Oid     relid = PG_GETARG_OID(0);
-   int64   blkno = PG_GETARG_INT64(1);
-   int16   freespace;
-   Relation rel;
+   Oid         relid = PG_GETARG_OID(0);
+   int64       blkno = PG_GETARG_INT64(1);
+   int16       freespace;
+   Relation    rel;
 
    rel = relation_open(relid, AccessShareLock);
 
index f2a7697178e150395542ddc23b723dc4f5d6db7f..01f1b1fa38a666d1568f37088f44682f2b30d857 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/pg_standby/pg_standby.c,v 1.22 2009/05/14 20:31:09 heikki Exp $ 
+ * $PostgreSQL: pgsql/contrib/pg_standby/pg_standby.c,v 1.23 2009/06/11 14:48:51 momjian Exp $
  *
  *
  * pg_standby.c
@@ -91,7 +91,7 @@ char      exclusiveCleanupFileName[MAXPGPATH];        /* the file we need to
 #define SmartFailover  1
 #define FastFailover   2
 
-static int Failover = NoFailover;
+static int Failover = NoFailover;
 
 #define RESTORE_COMMAND_COPY 0
 #define RESTORE_COMMAND_LINK 1
@@ -205,10 +205,10 @@ CustomizableNextWALFileReady()
 
            /*
             * Windows 'cp' sets the final file size before the copy is
-            * complete, and not yet ready to be opened by pg_standby.
-            * So we wait for sleeptime secs before attempting to restore.
-            * If that is not enough, we will rely on the retry/holdoff
-            * mechanism.  GNUWin32's cp does not have this problem.
+            * complete, and not yet ready to be opened by pg_standby. So we
+            * wait for sleeptime secs before attempting to restore. If that
+            * is not enough, we will rely on the retry/holdoff mechanism.
+            * GNUWin32's cp does not have this problem.
             */
            pg_usleep(sleeptime * 1000000L);
 #endif
@@ -327,10 +327,10 @@ SetWALFileNameForCleanup(void)
    if (restartWALFileName)
    {
        /*
-        * Don't do cleanup if the restartWALFileName provided
-        * is later than the xlog file requested. This is an error
-        * and we must not remove these files from archive.
-        * This shouldn't happen, but better safe than sorry.
+        * Don't do cleanup if the restartWALFileName provided is later than
+        * the xlog file requested. This is an error and we must not remove
+        * these files from archive. This shouldn't happen, but better safe
+        * than sorry.
         */
        if (strcmp(restartWALFileName, nextWALFileName) > 0)
            return false;
@@ -376,15 +376,15 @@ SetWALFileNameForCleanup(void)
  * CheckForExternalTrigger()
  *
  *   Is there a trigger file? Sets global 'Failover' variable to indicate
- *    what kind of a trigger file it was. A "fast" trigger file is turned
- *    into a "smart" file as a side-effect.
+ *   what kind of a trigger file it was. A "fast" trigger file is turned
+ *   into a "smart" file as a side-effect.
  */
 static void
 CheckForExternalTrigger(void)
 {
-   char    buf[32];
-   int     fd;
-   int     len;
+   char        buf[32];
+   int         fd;
+   int         len;
 
    /*
     * Look for a trigger file, if that option has been selected
@@ -397,10 +397,10 @@ CheckForExternalTrigger(void)
 
    /*
     * An empty trigger file performs smart failover. There's a little race
-    * condition here: if the writer of the trigger file has just created
-    * the file, but not yet written anything to it, we'll treat that as
-    * smart shutdown even if the other process was just about to write "fast"
-    * to it. But that's fine: we'll restore one more WAL file, and when we're
+    * condition here: if the writer of the trigger file has just created the
+    * file, but not yet written anything to it, we'll treat that as smart
+    * shutdown even if the other process was just about to write "fast" to
+    * it. But that's fine: we'll restore one more WAL file, and when we're
     * invoked next time, we'll see the word "fast" and fail over immediately.
     */
    if (stat_buf.st_size == 0)
@@ -418,7 +418,7 @@ CheckForExternalTrigger(void)
        fflush(stderr);
        return;
    }
-   
+
    if ((len = read(fd, buf, sizeof(buf))) < 0)
    {
        fprintf(stderr, "WARNING: could not read \"%s\": %s\n",
@@ -428,7 +428,7 @@ CheckForExternalTrigger(void)
        return;
    }
    buf[len] = '\0';
-   
+
    if (strncmp(buf, "smart", 5) == 0)
    {
        Failover = SmartFailover;
@@ -437,7 +437,7 @@ CheckForExternalTrigger(void)
        close(fd);
        return;
    }
-   
+
    if (strncmp(buf, "fast", 4) == 0)
    {
        Failover = FastFailover;
@@ -446,8 +446,8 @@ CheckForExternalTrigger(void)
        fflush(stderr);
 
        /*
-        * Turn it into a "smart" trigger by truncating the file. Otherwise
-        * if the server asks us again to restore a segment that was restored
+        * Turn it into a "smart" trigger by truncating the file. Otherwise if
+        * the server asks us again to restore a segment that was restored
         * restored already, we would return "not found" and upset the server.
         */
        if (ftruncate(fd, 0) < 0)
@@ -461,7 +461,7 @@ CheckForExternalTrigger(void)
        return;
    }
    close(fd);
-   
+
    fprintf(stderr, "WARNING: invalid content in \"%s\"\n", triggerPath);
    fflush(stderr);
    return;
@@ -514,7 +514,7 @@ usage(void)
    printf("Usage:\n");
    printf("  %s [OPTION]... ARCHIVELOCATION NEXTWALFILE XLOGFILEPATH [RESTARTWALFILE]\n", progname);
    printf("\n"
-          "with main intended use as a restore_command in the recovery.conf:\n"
+       "with main intended use as a restore_command in the recovery.conf:\n"
           "  restore_command = 'pg_standby [OPTION]... ARCHIVELOCATION %%f %%p %%r'\n"
           "e.g.\n"
           "  restore_command = 'pg_standby -l /mnt/server/archiverdir %%f %%p %%r'\n");
@@ -577,16 +577,16 @@ main(int argc, char **argv)
     * You can send SIGUSR1 to trigger failover.
     *
     * Postmaster uses SIGQUIT to request immediate shutdown. The default
-    * action is to core dump, but we don't want that, so trap it and
-    * commit suicide without core dump.
+    * action is to core dump, but we don't want that, so trap it and commit
+    * suicide without core dump.
     *
-    * We used to use SIGINT and SIGQUIT to trigger failover, but that
-    * turned out to be a bad idea because postmaster uses SIGQUIT to
-    * request immediate shutdown. We still trap SIGINT, but that may
-    * change in a future release.
+    * We used to use SIGINT and SIGQUIT to trigger failover, but that turned
+    * out to be a bad idea because postmaster uses SIGQUIT to request
+    * immediate shutdown. We still trap SIGINT, but that may change in a
+    * future release.
     */
    (void) signal(SIGUSR1, sighandler);
-   (void) signal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */
+   (void) signal(SIGINT, sighandler);  /* deprecated, use SIGUSR1 */
 #ifndef WIN32
    (void) signal(SIGQUIT, sigquit_handler);
 #endif
@@ -777,9 +777,9 @@ main(int argc, char **argv)
        {
            /*
             * Once we have restored this file successfully we can remove some
-            * prior WAL files. If this restore fails we musn't remove any file
-            * because some of them will be requested again immediately after
-            * the failed restore, or when we restart recovery.
+            * prior WAL files. If this restore fails we musn't remove any
+            * file because some of them will be requested again immediately
+            * after the failed restore, or when we restart recovery.
             */
            if (RestoreWALFileForRecovery())
            {
index 34cbb9d0b831b9f7c04f522d0684a416df8ea18b..5a818ba0428611696a1a311da2599a9103d910c6 100644 (file)
@@ -14,7 +14,7 @@
  * Copyright (c) 2008-2009, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/contrib/pg_stat_statements/pg_stat_statements.c,v 1.2 2009/01/05 13:35:38 tgl Exp $
+ *   $PostgreSQL: pgsql/contrib/pg_stat_statements/pg_stat_statements.c,v 1.3 2009/06/11 14:48:51 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -87,7 +87,7 @@ typedef struct Counters
  */
 typedef struct pgssEntry
 {
-   pgssHashKey key;            /* hash key of entry - MUST BE FIRST */
+   pgssHashKey key;            /* hash key of entry - MUST BE FIRST */
    Counters    counters;       /* the statistics for this query */
    slock_t     mutex;          /* protects the counters only */
    char        query[1];       /* VARIABLE LENGTH ARRAY - MUST BE LAST */
@@ -106,15 +106,17 @@ typedef struct pgssSharedState
 /*---- Local variables ----*/
 
 /* Current nesting depth of ExecutorRun calls */
-static int                     nested_level = 0;
+static int nested_level = 0;
+
 /* Saved hook values in case of unload */
-static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
-static ExecutorStart_hook_type prev_ExecutorStart = NULL;
-static ExecutorRun_hook_type   prev_ExecutorRun = NULL;
-static ExecutorEnd_hook_type   prev_ExecutorEnd = NULL;
+static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
+static ExecutorStart_hook_type prev_ExecutorStart = NULL;
+static ExecutorRun_hook_type prev_ExecutorRun = NULL;
+static ExecutorEnd_hook_type prev_ExecutorEnd = NULL;
+
 /* Links to shared memory state */
-static pgssSharedState        *pgss = NULL;
-static HTAB                       *pgss_hash = NULL;
+static pgssSharedState *pgss = NULL;
+static HTAB *pgss_hash = NULL;
 
 /*---- GUC variables ----*/
 
@@ -143,11 +145,11 @@ static bool pgss_save;            /* whether to save stats across shutdown */
 
 /*---- Function declarations ----*/
 
-void   _PG_init(void);
-void   _PG_fini(void);
+void       _PG_init(void);
+void       _PG_fini(void);
 
-Datum  pg_stat_statements_reset(PG_FUNCTION_ARGS);
-Datum  pg_stat_statements(PG_FUNCTION_ARGS);
+Datum      pg_stat_statements_reset(PG_FUNCTION_ARGS);
+Datum      pg_stat_statements(PG_FUNCTION_ARGS);
 
 PG_FUNCTION_INFO_V1(pg_stat_statements_reset);
 PG_FUNCTION_INFO_V1(pg_stat_statements);
@@ -156,14 +158,14 @@ static void pgss_shmem_startup(void);
 static void pgss_shmem_shutdown(int code, Datum arg);
 static void pgss_ExecutorStart(QueryDesc *queryDesc, int eflags);
 static void pgss_ExecutorRun(QueryDesc *queryDesc,
-                            ScanDirection direction,
-                            long count);
+                ScanDirection direction,
+                long count);
 static void pgss_ExecutorEnd(QueryDesc *queryDesc);
 static uint32 pgss_hash_fn(const void *key, Size keysize);
-static int pgss_match_fn(const void *key1, const void *key2, Size keysize);
+static int pgss_match_fn(const void *key1, const void *key2, Size keysize);
 static void pgss_store(const char *query,
-                      const Instrumentation *instr, uint32 rows);
-static Size    pgss_memsize(void);
+          const Instrumentation *instr, uint32 rows);
+static Size pgss_memsize(void);
 static pgssEntry *entry_alloc(pgssHashKey *key);
 static void entry_dealloc(void);
 static void entry_reset(void);
@@ -177,11 +179,11 @@ _PG_init(void)
 {
    /*
     * In order to create our shared memory area, we have to be loaded via
-    * shared_preload_libraries.  If not, fall out without hooking into
-    * any of the main system.  (We don't throw error here because it seems
-    * useful to allow the pg_stat_statements functions to be created even
-    * when the module isn't active.  The functions must protect themselves
-    * against being called then, however.)
+    * shared_preload_libraries.  If not, fall out without hooking into any of
+    * the main system.  (We don't throw error here because it seems useful to
+    * allow the pg_stat_statements functions to be created even when the
+    * module isn't active.  The functions must protect themselves against
+    * being called then, however.)
     */
    if (!process_shared_preload_libraries_in_progress)
        return;
@@ -190,7 +192,7 @@ _PG_init(void)
     * Define (or redefine) custom GUC variables.
     */
    DefineCustomIntVariable("pg_stat_statements.max",
-                           "Sets the maximum number of statements tracked by pg_stat_statements.",
+     "Sets the maximum number of statements tracked by pg_stat_statements.",
                            NULL,
                            &pgss_max,
                            1000,
@@ -202,7 +204,7 @@ _PG_init(void)
                            NULL);
 
    DefineCustomEnumVariable("pg_stat_statements.track",
-                            "Selects which statements are tracked by pg_stat_statements.",
+              "Selects which statements are tracked by pg_stat_statements.",
                             NULL,
                             &pgss_track,
                             PGSS_TRACK_TOP,
@@ -213,7 +215,7 @@ _PG_init(void)
                             NULL);
 
    DefineCustomBoolVariable("pg_stat_statements.save",
-                            "Save pg_stat_statements statistics across server shutdowns.",
+              "Save pg_stat_statements statistics across server shutdowns.",
                             NULL,
                             &pgss_save,
                             true,
@@ -265,7 +267,7 @@ _PG_fini(void)
 static void
 pgss_shmem_startup(void)
 {
-    bool       found;
+   bool        found;
    HASHCTL     info;
    FILE       *file;
    uint32      header;
@@ -294,7 +296,7 @@ pgss_shmem_startup(void)
        elog(ERROR, "out of shared memory");
 
    if (!found)
-    {
+   {
        /* First time through ... */
        pgss->lock = LWLockAssign();
        pgss->query_size = pgstat_track_activity_query_size;
@@ -305,7 +307,7 @@ pgss_shmem_startup(void)
 
    memset(&info, 0, sizeof(info));
    info.keysize = sizeof(pgssHashKey);
-   info.entrysize = offsetof(pgssEntry, query) + query_size;
+   info.entrysize = offsetof(pgssEntry, query) +query_size;
    info.hash = pgss_hash_fn;
    info.match = pgss_match_fn;
    pgss_hash = ShmemInitHash("pg_stat_statements hash",
@@ -318,8 +320,8 @@ pgss_shmem_startup(void)
    LWLockRelease(AddinShmemInitLock);
 
    /*
-    * If we're in the postmaster (or a standalone backend...), set up a
-    * shmem exit hook to dump the statistics to disk.
+    * If we're in the postmaster (or a standalone backend...), set up a shmem
+    * exit hook to dump the statistics to disk.
     */
    if (!IsUnderPostmaster)
        on_shmem_exit(pgss_shmem_shutdown, (Datum) 0);
@@ -327,8 +329,8 @@ pgss_shmem_startup(void)
    /*
     * Attempt to load old statistics from the dump file.
     *
-    * Note: we don't bother with locks here, because there should be no
-    * other processes running when this is called.
+    * Note: we don't bother with locks here, because there should be no other
+    * processes running when this is called.
     */
    if (!pgss_save)
        return;
@@ -352,7 +354,7 @@ pgss_shmem_startup(void)
    for (i = 0; i < num; i++)
    {
        pgssEntry   temp;
-       pgssEntry   *entry;
+       pgssEntry  *entry;
 
        if (fread(&temp, offsetof(pgssEntry, mutex), 1, file) != 1)
            goto error;
@@ -413,10 +415,10 @@ error:
 static void
 pgss_shmem_shutdown(int code, Datum arg)
 {
-   FILE               *file;
-   HASH_SEQ_STATUS     hash_seq;
-   int32               num_entries;
-   pgssEntry          *entry;
+   FILE       *file;
+   HASH_SEQ_STATUS hash_seq;
+   int32       num_entries;
+   pgssEntry  *entry;
 
    /* Don't try to dump during a crash. */
    if (code)
@@ -443,7 +445,7 @@ pgss_shmem_shutdown(int code, Datum arg)
    hash_seq_init(&hash_seq, pgss_hash);
    while ((entry = hash_seq_search(&hash_seq)) != NULL)
    {
-       int     len = entry->key.query_len;
+       int         len = entry->key.query_len;
 
        if (fwrite(entry, offsetof(pgssEntry, mutex), 1, file) != 1 ||
            fwrite(entry->query, 1, len, file) != len)
@@ -482,9 +484,9 @@ pgss_ExecutorStart(QueryDesc *queryDesc, int eflags)
    if (pgss_enabled())
    {
        /*
-        * Set up to track total elapsed time in ExecutorRun.  Make sure
-        * the space is allocated in the per-query context so it will go
-        * away at ExecutorEnd.
+        * Set up to track total elapsed time in ExecutorRun.  Make sure the
+        * space is allocated in the per-query context so it will go away at
+        * ExecutorEnd.
         */
        if (queryDesc->totaltime == NULL)
        {
@@ -529,8 +531,8 @@ pgss_ExecutorEnd(QueryDesc *queryDesc)
    if (queryDesc->totaltime && pgss_enabled())
    {
        /*
-        * Make sure stats accumulation is done.  (Note: it's okay if
-        * several levels of hook all do this.)
+        * Make sure stats accumulation is done.  (Note: it's okay if several
+        * levels of hook all do this.)
         */
        InstrEndLoop(queryDesc->totaltime);
 
@@ -585,9 +587,9 @@ pgss_match_fn(const void *key1, const void *key2, Size keysize)
 static void
 pgss_store(const char *query, const Instrumentation *instr, uint32 rows)
 {
-   pgssHashKey key;
+   pgssHashKey key;
    double      usage;
-   pgssEntry   *entry;
+   pgssEntry  *entry;
 
    Assert(query != NULL);
 
@@ -658,15 +660,15 @@ pg_stat_statements_reset(PG_FUNCTION_ARGS)
 Datum
 pg_stat_statements(PG_FUNCTION_ARGS)
 {
-   ReturnSetInfo      *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
-   TupleDesc           tupdesc;
-   Tuplestorestate    *tupstore;
-   MemoryContext       per_query_ctx;
-   MemoryContext       oldcontext;
-   Oid                 userid = GetUserId();
-   bool                is_superuser = superuser();
-   HASH_SEQ_STATUS     hash_seq;
-   pgssEntry          *entry;
+   ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
+   TupleDesc   tupdesc;
+   Tuplestorestate *tupstore;
+   MemoryContext per_query_ctx;
+   MemoryContext oldcontext;
+   Oid         userid = GetUserId();
+   bool        is_superuser = superuser();
+   HASH_SEQ_STATUS hash_seq;
+   pgssEntry  *entry;
 
    if (!pgss || !pgss_hash)
        ereport(ERROR,
@@ -727,7 +729,7 @@ pg_stat_statements(PG_FUNCTION_ARGS)
 
        if (is_superuser || entry->key.userid == userid)
        {
-           char   *qstr;
+           char       *qstr;
 
            qstr = (char *)
                pg_do_encoding_conversion((unsigned char *) entry->query,
@@ -777,11 +779,11 @@ pg_stat_statements(PG_FUNCTION_ARGS)
 static Size
 pgss_memsize(void)
 {
-   Size    size;
-   Size    entrysize;
+   Size        size;
+   Size        entrysize;
 
    size = MAXALIGN(sizeof(pgssSharedState));
-   entrysize = offsetof(pgssEntry, query) + pgstat_track_activity_query_size;
+   entrysize = offsetof(pgssEntry, query) +pgstat_track_activity_query_size;
    size = add_size(size, hash_estimate_size(pgss_max, entrysize));
 
    return size;
@@ -792,7 +794,7 @@ pgss_memsize(void)
  * caller must hold an exclusive lock on pgss->lock
  *
  * Note: despite needing exclusive lock, it's not an error for the target
- * entry to already exist.  This is because pgss_store releases and
+ * entry to already exist. This is because pgss_store releases and
  * reacquires lock after failing to find a match; so someone else could
  * have made the entry while we waited to get exclusive lock.
  */
@@ -800,7 +802,7 @@ static pgssEntry *
 entry_alloc(pgssHashKey *key)
 {
    pgssEntry  *entry;
-   bool    found;
+   bool        found;
 
    /* Caller must have clipped query properly */
    Assert(key->query_len < pgss->query_size);
@@ -837,8 +839,8 @@ entry_alloc(pgssHashKey *key)
 static int
 entry_cmp(const void *lhs, const void *rhs)
 {
-   double  l_usage = (*(const pgssEntry **)lhs)->counters.usage;
-   double  r_usage = (*(const pgssEntry **)rhs)->counters.usage;
+   double      l_usage = (*(const pgssEntry **) lhs)->counters.usage;
+   double      r_usage = (*(const pgssEntry **) rhs)->counters.usage;
 
    if (l_usage < r_usage)
        return -1;
@@ -855,11 +857,11 @@ entry_cmp(const void *lhs, const void *rhs)
 static void
 entry_dealloc(void)
 {
-   HASH_SEQ_STATUS     hash_seq;
-   pgssEntry         **entries;
-   pgssEntry          *entry;
-   int                 nvictims;
-   int                 i;
+   HASH_SEQ_STATUS hash_seq;
+   pgssEntry **entries;
+   pgssEntry  *entry;
+   int         nvictims;
+   int         i;
 
    /* Sort entries by usage and deallocate USAGE_DEALLOC_PERCENT of them. */
 
@@ -891,8 +893,8 @@ entry_dealloc(void)
 static void
 entry_reset(void)
 {
-   HASH_SEQ_STATUS     hash_seq;
-   pgssEntry          *entry;
+   HASH_SEQ_STATUS hash_seq;
+   pgssEntry  *entry;
 
    LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
 
index 18d675168772198d7bb6d5c0caff6650656303e2..4a89760d71560f0874a26286623db09d9c55f48a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/pg_trgm/trgm.h,v 1.10 2008/11/12 13:43:54 teodor Exp $ 
+ * $PostgreSQL: pgsql/contrib/pg_trgm/trgm.h,v 1.11 2009/06/11 14:48:51 momjian Exp $
  */
 #ifndef __TRGM_H__
 #define __TRGM_H__
@@ -31,7 +31,7 @@ typedef char trgm[3];
    *(((char*)(a))+2) = *(((char*)(b))+2);  \
 } while(0);
 
-uint32 trgm2int(trgm *ptr);
+uint32     trgm2int(trgm *ptr);
 
 #ifdef KEEPONLYALNUM
 #define ISPRINTABLECHAR(a) ( isascii( *(unsigned char*)(a) ) && (isalnum( *(unsigned char*)(a) ) || *(unsigned char*)(a)==' ') )
@@ -45,7 +45,7 @@ typedef struct
    int32       vl_len_;        /* varlena header (do not touch directly!) */
    uint8       flag;
    char        data[1];
-}  TRGM;
+} TRGM;
 
 #define TRGMHDRSIZE          (VARHDRSZ + sizeof(uint8))
 
@@ -87,6 +87,6 @@ typedef char *BITVECP;
 extern float4 trgm_limit;
 
 TRGM      *generate_trgm(char *str, int slen);
-float4     cnt_sml(TRGM * trg1, TRGM * trg2);
+float4     cnt_sml(TRGM *trg1, TRGM *trg2);
 
 #endif
index 1a53d1d3583c1adbee87670a67e27055cbbb2bfa..a150f8843e57f9e305c1d2f6c7f60bc013d608a3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/pg_trgm/trgm_gin.c,v 1.7 2009/03/25 22:19:01 tgl Exp $ 
+ * $PostgreSQL: pgsql/contrib/pg_trgm/trgm_gin.c,v 1.8 2009/06/11 14:48:51 momjian Exp $
  */
 #include "trgm.h"
 
@@ -52,11 +52,11 @@ gin_extract_trgm(PG_FUNCTION_ARGS)
            /*
             * Function called from query extracting
             */
-           Pointer      **extra_data = (Pointer **) PG_GETARG_POINTER(4);
+           Pointer   **extra_data = (Pointer **) PG_GETARG_POINTER(4);
 
-           *extra_data = (Pointer*) palloc0(sizeof(Pointer)*(*nentries));
+           *extra_data = (Pointer *) palloc0(sizeof(Pointer) * (*nentries));
 
-           *(int32*)(*extra_data) = trglen;
+           *(int32 *) (*extra_data) = trglen;
        }
    }
 
@@ -67,8 +67,9 @@ Datum
 gin_trgm_consistent(PG_FUNCTION_ARGS)
 {
    bool       *check = (bool *) PG_GETARG_POINTER(0);
+
    /* StrategyNumber strategy = PG_GETARG_UINT16(1); */
-   /* text    *query = PG_GETARG_TEXT_P(2); */
+   /* text    *query = PG_GETARG_TEXT_P(2); */
    /* int32    nkeys = PG_GETARG_INT32(3); */
    Pointer    *extra_data = (Pointer *) PG_GETARG_POINTER(4);
    bool       *recheck = (bool *) PG_GETARG_POINTER(5);
@@ -80,7 +81,7 @@ gin_trgm_consistent(PG_FUNCTION_ARGS)
    /* All cases served by this function are inexact */
    *recheck = true;
 
-   trglen = *(int32*)extra_data;
+   trglen = *(int32 *) extra_data;
 
    for (i = 0; i < trglen; i++)
        if (check[i])
index 2720d7fb707a7af989de04421f2673dda55b9002..7014394bb2d5044485c8dd75e3ecfee843814707 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/pg_trgm/trgm_gist.c,v 1.15 2008/07/11 11:56:48 teodor Exp $ 
+ * $PostgreSQL: pgsql/contrib/pg_trgm/trgm_gist.c,v 1.16 2009/06/11 14:48:51 momjian Exp $
  */
 #include "trgm.h"
 
@@ -75,7 +75,7 @@ gtrgm_out(PG_FUNCTION_ARGS)
 }
 
 static void
-makesign(BITVECP sign, TRGM * a)
+makesign(BITVECP sign, TRGM *a)
 {
    int4        k,
                len = ARRNELEM(a);
@@ -164,33 +164,34 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
 {
    GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
    text       *query = PG_GETARG_TEXT_P(1);
+
    /* StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); */
    /* Oid      subtype = PG_GETARG_OID(3); */
    bool       *recheck = (bool *) PG_GETARG_POINTER(4);
    TRGM       *key = (TRGM *) DatumGetPointer(entry->key);
    TRGM       *qtrg;
    bool        res = false;
-   char        *cache  = (char*) fcinfo->flinfo->fn_extra;
+   char       *cache = (char *) fcinfo->flinfo->fn_extra;
 
    /* All cases served by this function are exact */
    *recheck = false;
 
-   if ( cache == NULL || VARSIZE(cache) != VARSIZE(query) || memcmp( cache, query, VARSIZE(query) ) !=0  )
+   if (cache == NULL || VARSIZE(cache) != VARSIZE(query) || memcmp(cache, query, VARSIZE(query)) != 0)
    {
-       qtrg = generate_trgm(VARDATA(query), VARSIZE(query) - VARHDRSZ);    
+       qtrg = generate_trgm(VARDATA(query), VARSIZE(query) - VARHDRSZ);
 
        if (cache)
            pfree(cache);
 
        fcinfo->flinfo->fn_extra = MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
-                           MAXALIGN(VARSIZE(query)) + VARSIZE(qtrg) );
-       cache = (char*) fcinfo->flinfo->fn_extra;
+                                  MAXALIGN(VARSIZE(query)) + VARSIZE(qtrg));
+       cache = (char *) fcinfo->flinfo->fn_extra;
 
-       memcpy( cache, query, VARSIZE(query) );
-       memcpy( cache + MAXALIGN(VARSIZE(query)), qtrg, VARSIZE(qtrg) );
+       memcpy(cache, query, VARSIZE(query));
+       memcpy(cache + MAXALIGN(VARSIZE(query)), qtrg, VARSIZE(qtrg));
    }
 
-   qtrg = (TRGM*)( cache + MAXALIGN(VARSIZE(query)) );
+   qtrg = (TRGM *) (cache + MAXALIGN(VARSIZE(query)));
 
    if (GIST_LEAF(entry))
    {                           /* all leafs contains orig trgm */
@@ -228,7 +229,7 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
 }
 
 static int4
-unionkey(BITVECP sbase, TRGM * add)
+unionkey(BITVECP sbase, TRGM *add)
 {
    int4        i;
 
@@ -375,7 +376,7 @@ hemdistsign(BITVECP a, BITVECP b)
 }
 
 static int
-hemdist(TRGM * a, TRGM * b)
+hemdist(TRGM *a, TRGM *b)
 {
    if (ISALLTRUE(a))
    {
@@ -425,7 +426,7 @@ typedef struct
 } CACHESIGN;
 
 static void
-fillcache(CACHESIGN *item, TRGM * key)
+fillcache(CACHESIGN *item, TRGM *key)
 {
    item->allistrue = false;
    if (ISARRKEY(key))
index 3d2df22111eca26e02a947a00deb42d69dab7c9e..19b6747d68b7d0b7b5ea172df6ef26540caf9b5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/pg_trgm/trgm_op.c,v 1.11 2008/11/12 13:43:54 teodor Exp $ 
+ * $PostgreSQL: pgsql/contrib/pg_trgm/trgm_op.c,v 1.12 2009/06/11 14:48:51 momjian Exp $
  */
 #include "trgm.h"
 #include <ctype.h>
@@ -39,7 +39,7 @@ comp_trgm(const void *a, const void *b)
 }
 
 static int
-unique_array(trgm * a, int len)
+unique_array(trgm *a, int len)
 {
    trgm       *curend,
               *tmp;
@@ -59,7 +59,7 @@ unique_array(trgm * a, int len)
 }
 
 #ifdef KEEPONLYALNUM
-#define    iswordchr(c)    (t_isalpha(c) || t_isdigit(c))
+#define iswordchr(c)   (t_isalpha(c) || t_isdigit(c))
 #else
 #define iswordchr(c)   (!t_isspace(c))
 #endif
@@ -68,12 +68,12 @@ unique_array(trgm * a, int len)
  * Finds first word in string, returns pointer to the word,
  * endword points to the character after word
  */
-static char*
-find_word(char *str, int lenstr, char **endword, int *charlen) 
+static char *
+find_word(char *str, int lenstr, char **endword, int *charlen)
 {
-   char *beginword = str;
+   char       *beginword = str;
 
-   while( beginword - str < lenstr && !iswordchr(beginword) )
+   while (beginword - str < lenstr && !iswordchr(beginword))
        beginword += pg_mblen(beginword);
 
    if (beginword - str >= lenstr)
@@ -81,7 +81,7 @@ find_word(char *str, int lenstr, char **endword, int *charlen)
 
    *endword = beginword;
    *charlen = 0;
-   while( *endword - str < lenstr && iswordchr(*endword) ) 
+   while (*endword - str < lenstr && iswordchr(*endword))
    {
        *endword += pg_mblen(*endword);
        (*charlen)++;
@@ -92,11 +92,11 @@ find_word(char *str, int lenstr, char **endword, int *charlen)
 
 #ifdef USE_WIDE_UPPER_LOWER
 static void
-cnt_trigram(trgm *tptr, char *str, int bytelen) 
+cnt_trigram(trgm *tptr, char *str, int bytelen)
 {
-   if ( bytelen == 3 ) 
+   if (bytelen == 3)
    {
-       CPTRGM(tptr, str);      
+       CPTRGM(tptr, str);
    }
    else
    {
@@ -107,8 +107,7 @@ cnt_trigram(trgm *tptr, char *str, int bytelen)
        FIN_CRC32(crc);
 
        /*
-        * use only 3 upper bytes from crc, hope, it's
-        * good enough hashing
+        * use only 3 upper bytes from crc, hope, it's good enough hashing
         */
        CPTRGM(tptr, &crc);
    }
@@ -118,37 +117,37 @@ cnt_trigram(trgm *tptr, char *str, int bytelen)
 /*
  * Adds trigramm from words (already padded).
  */
-static trgm*
-make_trigrams( trgm *tptr, char *str, int bytelen, int charlen )
+static trgm *
+make_trigrams(trgm *tptr, char *str, int bytelen, int charlen)
 {
-   char    *ptr = str;
+   char       *ptr = str;
 
-   if ( charlen < 3 )
+   if (charlen < 3)
        return tptr;
 
 #ifdef USE_WIDE_UPPER_LOWER
    if (pg_database_encoding_max_length() > 1)
    {
-       int lenfirst    = pg_mblen(str),
-           lenmiddle   = pg_mblen(str + lenfirst),
-           lenlast     = pg_mblen(str + lenfirst + lenmiddle);
+       int         lenfirst = pg_mblen(str),
+                   lenmiddle = pg_mblen(str + lenfirst),
+                   lenlast = pg_mblen(str + lenfirst + lenmiddle);
 
-       while( (ptr - str) + lenfirst + lenmiddle + lenlast <= bytelen ) 
+       while ((ptr - str) + lenfirst + lenmiddle + lenlast <= bytelen)
        {
            cnt_trigram(tptr, ptr, lenfirst + lenmiddle + lenlast);
 
            ptr += lenfirst;
            tptr++;
 
-           lenfirst    = lenmiddle;
-           lenmiddle   = lenlast;
-           lenlast     = pg_mblen(ptr + lenfirst + lenmiddle);
+           lenfirst = lenmiddle;
+           lenmiddle = lenlast;
+           lenlast = pg_mblen(ptr + lenfirst + lenmiddle);
        }
    }
    else
 #endif
    {
-       Assert( bytelen == charlen );
+       Assert(bytelen == charlen);
 
        while (ptr - str < bytelen - 2 /* number of trigrams = strlen - 2 */ )
        {
@@ -157,7 +156,7 @@ make_trigrams( trgm *tptr, char *str, int bytelen, int charlen )
            tptr++;
        }
    }
-   
+
    return tptr;
 }
 
@@ -170,9 +169,10 @@ generate_trgm(char *str, int slen)
    int         len,
                charlen,
                bytelen;
-   char        *bword, *eword;
+   char       *bword,
+              *eword;
 
-   trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) * 3);
+   trg = (TRGM *) palloc(TRGMHDRSIZE + sizeof(trgm) * (slen / 2 + 1) *3);
    trg->flag = ARRKEY;
    SET_VARSIZE(trg, TRGMHDRSIZE);
 
@@ -191,7 +191,7 @@ generate_trgm(char *str, int slen)
    }
 
    eword = str;
-   while( (bword=find_word(eword, slen - (eword-str), &eword, &charlen)) != NULL ) 
+   while ((bword = find_word(eword, slen - (eword - str), &eword, &charlen)) != NULL)
    {
 #ifdef IGNORECASE
        bword = lowerstr_with_len(bword, eword - bword);
@@ -205,14 +205,14 @@ generate_trgm(char *str, int slen)
 #ifdef IGNORECASE
        pfree(bword);
 #endif
-       buf[LPADDING+bytelen] = ' ';
-       buf[LPADDING+bytelen+1] = ' ';
+       buf[LPADDING + bytelen] = ' ';
+       buf[LPADDING + bytelen + 1] = ' ';
 
        /*
         * count trigrams
         */
-       tptr = make_trigrams( tptr, buf, bytelen + LPADDING + RPADDING, 
-                                        charlen + LPADDING + RPADDING );
+       tptr = make_trigrams(tptr, buf, bytelen + LPADDING + RPADDING,
+                            charlen + LPADDING + RPADDING);
    }
 
    pfree(buf);
@@ -234,13 +234,13 @@ generate_trgm(char *str, int slen)
 uint32
 trgm2int(trgm *ptr)
 {
-   uint32  val = 0;
+   uint32      val = 0;
 
-   val |= *( ((unsigned char*)ptr) );
+   val |= *(((unsigned char *) ptr));
    val <<= 8;
-   val |= *( ((unsigned char*)ptr) + 1 );
+   val |= *(((unsigned char *) ptr) + 1);
    val <<= 8;
-   val |= *( ((unsigned char*)ptr) + 2 );
+   val |= *(((unsigned char *) ptr) + 2);
 
    return val;
 }
@@ -262,9 +262,9 @@ show_trgm(PG_FUNCTION_ARGS)
 
    for (i = 0, ptr = GETARR(trg); i < ARRNELEM(trg); i++, ptr++)
    {
-       text       *item = (text *) palloc(VARHDRSZ + Max(12, pg_database_encoding_max_length()*3) );
+       text       *item = (text *) palloc(VARHDRSZ + Max(12, pg_database_encoding_max_length() * 3));
 
-       if ( pg_database_encoding_max_length() > 1 && !ISPRINTABLETRGM(ptr) )
+       if (pg_database_encoding_max_length() > 1 && !ISPRINTABLETRGM(ptr))
        {
            snprintf(VARDATA(item), 12, "0x%06x", trgm2int(ptr));
            SET_VARSIZE(item, VARHDRSZ + strlen(VARDATA(item)));
@@ -297,7 +297,7 @@ show_trgm(PG_FUNCTION_ARGS)
 }
 
 float4
-cnt_sml(TRGM * trg1, TRGM * trg2)
+cnt_sml(TRGM *trg1, TRGM *trg2)
 {
    trgm       *ptr1,
               *ptr2;
index 6fd7509b0fc1879aef202db1ce23f73c48bed077..85b12b6eca4efcad4f4dc4be6ae3857a7ccff97d 100644 (file)
@@ -4,7 +4,7 @@
  * A simple benchmark program for PostgreSQL
  * Originally written by Tatsuo Ishii and enhanced by many contributors.
  *
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.86 2009/05/07 22:01:18 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.87 2009/06/11 14:48:51 momjian Exp $
  * Copyright (c) 2000-2009, PostgreSQL Global Development Group
  * ALL RIGHTS RESERVED;
  *
@@ -110,14 +110,14 @@ char     *pgtty = NULL;
 char      *login = NULL;
 char      *dbName;
 
-volatile bool timer_exceeded = false;      /* flag from signal handler */
+volatile bool timer_exceeded = false;  /* flag from signal handler */
 
 /* variable definitions */
 typedef struct
 {
    char       *name;           /* variable name */
    char       *value;          /* its value */
-}  Variable;
+} Variable;
 
 #define MAX_FILES      128     /* max number of SQL script files allowed */
 
@@ -141,7 +141,7 @@ typedef struct
    struct timeval txn_begin;   /* used for measuring latencies */
    int         use_file;       /* index in sql_files for this client */
    bool        prepared[MAX_FILES];
-}  CState;
+} CState;
 
 /*
  * queries read from files
@@ -152,21 +152,21 @@ typedef struct
 
 typedef enum QueryMode
 {
-   QUERY_SIMPLE,   /* simple query */
-   QUERY_EXTENDED, /* extended query */
-   QUERY_PREPARED, /* extended query with prepared statements */
+   QUERY_SIMPLE,               /* simple query */
+   QUERY_EXTENDED,             /* extended query */
+   QUERY_PREPARED,             /* extended query with prepared statements */
    NUM_QUERYMODE
 } QueryMode;
 
-static QueryMode   querymode = QUERY_SIMPLE;
-static const char *QUERYMODE[] = { "simple", "extended", "prepared" };
+static QueryMode querymode = QUERY_SIMPLE;
+static const char *QUERYMODE[] = {"simple", "extended", "prepared"};
 
 typedef struct
 {
    int         type;           /* command type (SQL_COMMAND or META_COMMAND) */
    int         argc;           /* number of commands */
    char       *argv[MAX_ARGS]; /* command list */
-}  Command;
+} Command;
 
 Command   **sql_files[MAX_FILES];      /* SQL script files */
 int            num_files;          /* number of script files */
@@ -221,10 +221,11 @@ static void setalarm(int seconds);
 
 /* Calculate total time */
 static void
-addTime(struct timeval *t1, struct timeval *t2, struct timeval *result)
+addTime(struct timeval * t1, struct timeval * t2, struct timeval * result)
 {
-   int sec = t1->tv_sec + t2->tv_sec;
-   int usec = t1->tv_usec + t2->tv_usec;
+   int         sec = t1->tv_sec + t2->tv_sec;
+   int         usec = t1->tv_usec + t2->tv_usec;
+
    if (usec >= 1000000)
    {
        usec -= 1000000;
@@ -236,10 +237,11 @@ addTime(struct timeval *t1, struct timeval *t2, struct timeval *result)
 
 /* Calculate time difference */
 static void
-diffTime(struct timeval *t1, struct timeval *t2, struct timeval *result)
+diffTime(struct timeval * t1, struct timeval * t2, struct timeval * result)
 {
-   int sec = t1->tv_sec - t2->tv_sec;
-   int usec = t1->tv_usec - t2->tv_usec;
+   int         sec = t1->tv_sec - t2->tv_sec;
+   int         usec = t1->tv_usec - t2->tv_usec;
+
    if (usec < 0)
    {
        usec += 1000000;
@@ -260,7 +262,7 @@ usage(const char *progname)
           "  -F NUM       fill factor\n"
           "  -s NUM       scaling factor\n"
           "\nBenchmarking options:\n"
-          "  -c NUM       number of concurrent database clients (default: 1)\n"
+       "  -c NUM       number of concurrent database clients (default: 1)\n"
           "  -C           establish new connection for each transaction\n"
           "  -D VARNAME=VALUE\n"
           "               define variable for use by custom script\n"
@@ -272,7 +274,7 @@ usage(const char *progname)
           "  -N           do not update tables \"pgbench_tellers\" and \"pgbench_branches\"\n"
           "  -s NUM       report this scale factor in output\n"
           "  -S           perform SELECT-only transactions\n"
-          "  -t NUM       number of transactions each client runs (default: 10)\n"
+    "  -t NUM       number of transactions each client runs (default: 10)\n"
           "  -T NUM       duration of benchmark test in seconds\n"
           "  -v           vacuum all four standard tables before tests\n"
           "\nCommon options:\n"
@@ -362,7 +364,7 @@ doConnect(void)
 
 /* throw away response from backend */
 static void
-discard_response(CState * state)
+discard_response(CState *state)
 {
    PGresult   *res;
 
@@ -376,7 +378,7 @@ discard_response(CState * state)
 
 /* check to see if the SQL result was good */
 static int
-check(CState * state, PGresult *res, int n)
+check(CState *state, PGresult *res, int n)
 {
    CState     *st = &state[n];
 
@@ -405,7 +407,7 @@ compareVariables(const void *v1, const void *v2)
 }
 
 static char *
-getVariable(CState * st, char *name)
+getVariable(CState *st, char *name)
 {
    Variable    key,
               *var;
@@ -427,7 +429,7 @@ getVariable(CState * st, char *name)
 }
 
 static int
-putVariable(CState * st, char *name, char *value)
+putVariable(CState *st, char *name, char *value)
 {
    Variable    key,
               *var;
@@ -493,8 +495,8 @@ putVariable(CState * st, char *name, char *value)
 static char *
 parseVariable(const char *sql, int *eaten)
 {
-   int     i = 0;
-   char   *name;
+   int         i = 0;
+   char       *name;
 
    do
    {
@@ -516,12 +518,12 @@ parseVariable(const char *sql, int *eaten)
 static char *
 replaceVariable(char **sql, char *param, int len, char *value)
 {
-   int valueln = strlen(value);
+   int         valueln = strlen(value);
 
    if (valueln > len)
    {
-       char   *tmp;
-       size_t  offset = param - *sql;
+       char       *tmp;
+       size_t      offset = param - *sql;
 
        tmp = realloc(*sql, strlen(*sql) - len + valueln + 1);
        if (tmp == NULL)
@@ -541,7 +543,7 @@ replaceVariable(char **sql, char *param, int len, char *value)
 }
 
 static char *
-assignVariables(CState * st, char *sql)
+assignVariables(CState *st, char *sql)
 {
    char       *p,
               *name,
@@ -550,12 +552,15 @@ assignVariables(CState * st, char *sql)
    p = sql;
    while ((p = strchr(p, ':')) != NULL)
    {
-       int     eaten;
+       int         eaten;
 
        name = parseVariable(p, &eaten);
        if (name == NULL)
        {
-           while (*p == ':') { p++; }
+           while (*p == ':')
+           {
+               p++;
+           }
            continue;
        }
 
@@ -577,10 +582,10 @@ assignVariables(CState * st, char *sql)
 static void
 getQueryParams(CState *st, const Command *command, const char **params)
 {
-   int     i;
+   int         i;
 
    for (i = 0; i < command->argc - 1; i++)
-       params[i] = getVariable(st, command->argv[i+1]);
+       params[i] = getVariable(st, command->argv[i + 1]);
 }
 
 #define MAX_PREPARE_NAME       32
@@ -591,7 +596,7 @@ preparedStatementName(char *buffer, int file, int state)
 }
 
 static void
-doCustom(CState * state, int n, int debug)
+doCustom(CState *state, int n, int debug)
 {
    PGresult   *res;
    CState     *st = &state[n];
@@ -694,7 +699,9 @@ top:
 
    if (st->con == NULL)
    {
-       struct timeval t1, t2, t3;
+       struct timeval t1,
+                   t2,
+                   t3;
 
        gettimeofday(&t1, NULL);
        if ((st->con = doConnect()) == NULL)
@@ -716,8 +723,8 @@ top:
 
    if (commands[st->state]->type == SQL_COMMAND)
    {
-       const Command  *command = commands[st->state];
-       int             r;
+       const Command *command = commands[st->state];
+       int         r;
 
        if (querymode == QUERY_SIMPLE)
        {
@@ -738,15 +745,15 @@ top:
        }
        else if (querymode == QUERY_EXTENDED)
        {
-           const char       *sql = command->argv[0];
-           const char       *params[MAX_ARGS];
+           const char *sql = command->argv[0];
+           const char *params[MAX_ARGS];
 
            getQueryParams(st, command, params);
 
            if (debug)
                fprintf(stderr, "client %d sending %s\n", n, sql);
            r = PQsendQueryParams(st->con, sql, command->argc - 1,
-               NULL, params, NULL, NULL, 0);
+                                 NULL, params, NULL, NULL, 0);
        }
        else if (querymode == QUERY_PREPARED)
        {
@@ -755,7 +762,7 @@ top:
 
            if (!st->prepared[st->use_file])
            {
-               int     j;
+               int         j;
 
                for (j = 0; commands[j] != NULL; j++)
                {
@@ -766,7 +773,7 @@ top:
                        continue;
                    preparedStatementName(name, st->use_file, j);
                    res = PQprepare(st->con, name,
-                       commands[j]->argv[0], commands[j]->argc - 1, NULL);
+                         commands[j]->argv[0], commands[j]->argc - 1, NULL);
                    if (PQresultStatus(res) != PGRES_COMMAND_OK)
                        fprintf(stderr, "%s", PQerrorMessage(st->con));
                    PQclear(res);
@@ -780,9 +787,9 @@ top:
            if (debug)
                fprintf(stderr, "client %d sending %s\n", n, name);
            r = PQsendQueryPrepared(st->con, name, command->argc - 1,
-               params, NULL, NULL, 0);
+                                   params, NULL, NULL, 0);
        }
-       else /* unknown sql mode */
+       else    /* unknown sql mode */
            r = 0;
 
        if (r == 0)
@@ -984,7 +991,7 @@ top:
 
 /* discard connections */
 static void
-disconnect_all(CState * state)
+disconnect_all(CState *state)
 {
    int         i;
 
@@ -1002,12 +1009,11 @@ init(void)
    /*
     * Note: TPC-B requires at least 100 bytes per row, and the "filler"
     * fields in these table declarations were intended to comply with that.
-    * But because they default to NULLs, they don't actually take any
-    * space.  We could fix that by giving them non-null default values.
-    * However, that would completely break comparability of pgbench
-    * results with prior versions.  Since pgbench has never pretended
-    * to be fully TPC-B compliant anyway, we stick with the historical
-    * behavior.
+    * But because they default to NULLs, they don't actually take any space.
+    * We could fix that by giving them non-null default values. However, that
+    * would completely break comparability of pgbench results with prior
+    * versions.  Since pgbench has never pretended to be fully TPC-B
+    * compliant anyway, we stick with the historical behavior.
     */
    static char *DDLs[] = {
        "drop table if exists pgbench_branches",
@@ -1146,14 +1152,17 @@ parseQuery(Command *cmd, const char *raw_sql)
    p = sql;
    while ((p = strchr(p, ':')) != NULL)
    {
-       char    var[12];
-       char   *name;
-       int     eaten;
+       char        var[12];
+       char       *name;
+       int         eaten;
 
        name = parseVariable(p, &eaten);
        if (name == NULL)
        {
-           while (*p == ':') { p++; }
+           while (*p == ':')
+           {
+               p++;
+           }
            continue;
        }
 
@@ -1442,7 +1451,7 @@ process_builtin(char *tb)
 /* print out results */
 static void
 printResults(
-            int ttype, CState * state,
+            int ttype, CState *state,
             struct timeval * start_time, struct timeval * end_time)
 {
    double      t1,
@@ -1506,8 +1515,8 @@ main(int argc, char **argv)
 
    CState     *state;          /* status of clients */
 
-   struct timeval start_time;          /* start up time */
-   struct timeval end_time;            /* end time */
+   struct timeval start_time;  /* start up time */
+   struct timeval end_time;    /* end time */
 
    int         i;
 
@@ -1787,10 +1796,10 @@ main(int argc, char **argv)
    {
        if (duration <= 0)
            printf("pghost: %s pgport: %s nclients: %d nxacts: %d dbName: %s\n",
-              pghost, pgport, nclients, nxacts, dbName);
+                  pghost, pgport, nclients, nxacts, dbName);
        else
            printf("pghost: %s pgport: %s nclients: %d duration: %d dbName: %s\n",
-              pghost, pgport, nclients, duration, dbName);
+                  pghost, pgport, nclients, duration, dbName);
    }
 
    /* opening connection... */
@@ -1828,7 +1837,7 @@ main(int argc, char **argv)
        /* warn if we override user-given -s switch */
        if (scale_given)
            fprintf(stderr,
-                   "Scale option ignored, using pgbench_branches table count = %d\n",
+           "Scale option ignored, using pgbench_branches table count = %d\n",
                    scale);
    }
 
@@ -1879,7 +1888,8 @@ main(int argc, char **argv)
 
    if (is_connect == 0)
    {
-       struct timeval t, now;
+       struct timeval t,
+                   now;
 
        /* make connections to the database */
        for (i = 0; i < nclients; i++)
@@ -1972,7 +1982,8 @@ main(int argc, char **argv)
                if (this_usec > 0 && (min_usec == 0 || this_usec < min_usec))
                    min_usec = this_usec;
 
-               FD_SET(sock, &input_mask);
+               FD_SET      (sock, &input_mask);
+
                if (maxsock < sock)
                    maxsock = sock;
            }
@@ -1985,7 +1996,8 @@ main(int argc, char **argv)
                    disconnect_all(state);
                    exit(1);
                }
-               FD_SET(sock, &input_mask);
+               FD_SET      (sock, &input_mask);
+
                if (maxsock < sock)
                    maxsock = sock;
            }
@@ -2069,8 +2081,7 @@ setalarm(int seconds)
    pqsignal(SIGALRM, handle_sig_alarm);
    alarm(seconds);
 }
-
-#else  /* WIN32 */
+#else                          /* WIN32 */
 
 static VOID CALLBACK
 win32_timer_callback(PVOID lpParameter, BOOLEAN TimerOrWaitFired)
@@ -2081,12 +2092,12 @@ win32_timer_callback(PVOID lpParameter, BOOLEAN TimerOrWaitFired)
 static void
 setalarm(int seconds)
 {
-   HANDLE  queue;
-   HANDLE  timer;
+   HANDLE      queue;
+   HANDLE      timer;
 
    /* This function will be called at most once, so we can cheat a bit. */
    queue = CreateTimerQueue();
-   if (seconds > ((DWORD)-1) / 1000 ||
+   if (seconds > ((DWORD) -1) / 1000 ||
        !CreateTimerQueueTimer(&timer, queue,
                               win32_timer_callback, NULL, seconds * 1000, 0,
                               WT_EXECUTEINTIMERTHREAD | WT_EXECUTEONLYONCE))
@@ -2096,4 +2107,4 @@ setalarm(int seconds)
    }
 }
 
-#endif  /* WIN32 */
+#endif   /* WIN32 */
index 7138ffa90332e8fc5f97902326886aae6cc24176..e03c542c0d44d051eb1d328990541c7bcb4a534b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Butchered version of sshblowf.c from putty-0.59.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/blf.c,v 1.9 2007/11/15 21:14:31 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/blf.c,v 1.10 2009/06/11 14:48:52 momjian Exp $
  */
 
 /*
@@ -251,7 +251,7 @@ static const uint32 sbox3[] = {
 
 static void
 blowfish_encrypt(uint32 xL, uint32 xR, uint32 *output,
-                BlowfishContext * ctx)
+                BlowfishContext *ctx)
 {
    uint32     *S0 = ctx->S0;
    uint32     *S1 = ctx->S1;
@@ -285,7 +285,7 @@ blowfish_encrypt(uint32 xL, uint32 xR, uint32 *output,
 
 static void
 blowfish_decrypt(uint32 xL, uint32 xR, uint32 *output,
-                BlowfishContext * ctx)
+                BlowfishContext *ctx)
 {
    uint32     *S0 = ctx->S0;
    uint32     *S1 = ctx->S1;
@@ -318,7 +318,7 @@ blowfish_decrypt(uint32 xL, uint32 xR, uint32 *output,
 }
 
 void
-blowfish_encrypt_cbc(uint8 *blk, int len, BlowfishContext * ctx)
+blowfish_encrypt_cbc(uint8 *blk, int len, BlowfishContext *ctx)
 {
    uint32      xL,
                xR,
@@ -351,7 +351,7 @@ blowfish_encrypt_cbc(uint8 *blk, int len, BlowfishContext * ctx)
 }
 
 void
-blowfish_decrypt_cbc(uint8 *blk, int len, BlowfishContext * ctx)
+blowfish_decrypt_cbc(uint8 *blk, int len, BlowfishContext *ctx)
 {
    uint32      xL,
                xR,
@@ -384,7 +384,7 @@ blowfish_decrypt_cbc(uint8 *blk, int len, BlowfishContext * ctx)
 }
 
 void
-blowfish_encrypt_ecb(uint8 *blk, int len, BlowfishContext * ctx)
+blowfish_encrypt_ecb(uint8 *blk, int len, BlowfishContext *ctx)
 {
    uint32      xL,
                xR,
@@ -405,7 +405,7 @@ blowfish_encrypt_ecb(uint8 *blk, int len, BlowfishContext * ctx)
 }
 
 void
-blowfish_decrypt_ecb(uint8 *blk, int len, BlowfishContext * ctx)
+blowfish_decrypt_ecb(uint8 *blk, int len, BlowfishContext *ctx)
 {
    uint32      xL,
                xR,
@@ -426,7 +426,7 @@ blowfish_decrypt_ecb(uint8 *blk, int len, BlowfishContext * ctx)
 }
 
 void
-blowfish_setkey(BlowfishContext * ctx,
+blowfish_setkey(BlowfishContext *ctx,
                const uint8 *key, short keybytes)
 {
    uint32     *S0 = ctx->S0;
@@ -492,7 +492,7 @@ blowfish_setkey(BlowfishContext * ctx,
 }
 
 void
-blowfish_setiv(BlowfishContext * ctx, const uint8 *iv)
+blowfish_setiv(BlowfishContext *ctx, const uint8 *iv)
 {
    ctx->iv0 = GET_32BIT_MSB_FIRST(iv);
    ctx->iv1 = GET_32BIT_MSB_FIRST(iv + 4);
index 6e280d8754fee3cc6dff9c99304092e2215decf2..507d7f90553e3c18ea97e4549921781eaf529be9 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/pgcrypto/blf.h,v 1.7 2007/11/15 21:14:31 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/pgcrypto/blf.h,v 1.8 2009/06/11 14:48:52 momjian Exp $ */
 /*
  * PuTTY is copyright 1997-2007 Simon Tatham.
  *
@@ -36,11 +36,11 @@ typedef struct
                P[18];
    uint32      iv0,
                iv1;            /* for CBC mode */
-}  BlowfishContext;
+} BlowfishContext;
 
-void       blowfish_setkey(BlowfishContext * ctx, const uint8 *key, short keybytes);
-void       blowfish_setiv(BlowfishContext * ctx, const uint8 *iv);
-void       blowfish_encrypt_cbc(uint8 *blk, int len, BlowfishContext * ctx);
-void       blowfish_decrypt_cbc(uint8 *blk, int len, BlowfishContext * ctx);
-void       blowfish_encrypt_ecb(uint8 *blk, int len, BlowfishContext * ctx);
-void       blowfish_decrypt_ecb(uint8 *blk, int len, BlowfishContext * ctx);
+void       blowfish_setkey(BlowfishContext *ctx, const uint8 *key, short keybytes);
+void       blowfish_setiv(BlowfishContext *ctx, const uint8 *iv);
+void       blowfish_encrypt_cbc(uint8 *blk, int len, BlowfishContext *ctx);
+void       blowfish_decrypt_cbc(uint8 *blk, int len, BlowfishContext *ctx);
+void       blowfish_encrypt_ecb(uint8 *blk, int len, BlowfishContext *ctx);
+void       blowfish_decrypt_ecb(uint8 *blk, int len, BlowfishContext *ctx);
index 84b4d758af16f5d65060de1ae72d84a551877dad..9c1d2d47062bd0940e2d200af739caf34dbf785f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-blowfish.c,v 1.13 2007/11/15 21:14:31 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-blowfish.c,v 1.14 2009/06/11 14:48:52 momjian Exp $
  *
  * This code comes from John the Ripper password cracker, with reentrant
  * and crypt(3) interfaces added, but optimizations specific to password
@@ -59,7 +59,7 @@ typedef struct
 {
    BF_word     S[4][0x100];
    BF_key      P;
-}  BF_ctx;
+} BF_ctx;
 
 /*
  * Magic IV for 64 Blowfish encryptions that we do at the end.
@@ -367,7 +367,7 @@ do { \
 } while (0)
 
 static int
-BF_decode(BF_word * dst, const char *src, int size)
+BF_decode(BF_word *dst, const char *src, int size)
 {
    unsigned char *dptr = (unsigned char *) dst;
    unsigned char *end = dptr + size;
@@ -399,7 +399,7 @@ BF_decode(BF_word * dst, const char *src, int size)
 }
 
 static void
-BF_encode(char *dst, const BF_word * src, int size)
+BF_encode(char *dst, const BF_word *src, int size)
 {
    unsigned char *sptr = (unsigned char *) src;
    unsigned char *end = sptr + size;
@@ -436,7 +436,7 @@ BF_encode(char *dst, const BF_word * src, int size)
 }
 
 static void
-BF_swap(BF_word * x, int count)
+BF_swap(BF_word *x, int count)
 {
    /* Swap on little-endian hardware, else do nothing */
 #ifndef WORDS_BIGENDIAN
@@ -518,7 +518,7 @@ BF_swap(BF_word * x, int count)
 
 #if BF_ASM
 
-extern void _BF_body_r(BF_ctx * ctx);
+extern void _BF_body_r(BF_ctx *ctx);
 
 #define BF_body() \
    _BF_body_r(&data.ctx);
index c3ec01b9002661d91a4a53a9bef30579da6b6911..b2ec3da8280e606de145393f23cffb794fe57233 100644 (file)
@@ -2,7 +2,7 @@
  * Written by Solar Designer and placed in the public domain.
  * See crypt_blowfish.c for more information.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-gensalt.c,v 1.10 2006/10/04 00:29:46 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/crypt-gensalt.c,v 1.11 2009/06/11 14:48:52 momjian Exp $
  *
  * This file contains salt generation functions for the traditional and
  * other common crypt(3) algorithms, except for bcrypt which is defined
@@ -122,7 +122,7 @@ static unsigned char BF_itoa64[64 + 1] =
 "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
 
 static void
-BF_encode(char *dst, const BF_word * src, int size)
+BF_encode(char *dst, const BF_word *src, int size)
 {
    unsigned char *sptr = (unsigned char *) src;
    unsigned char *end = sptr + size;
index 5a2596fe786cf25ef898da403f4709561cf02999..4e97946ab3c33b2e4b9a751f30bc9390e790c02a 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.c,v 1.8 2006/10/04 00:29:46 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.c,v 1.9 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -176,7 +176,7 @@ md_result(MD_CTX * ctx, uint8 *dst)
  * initialize state
  */
 static void
-init_state(FState * st)
+init_state(FState *st)
 {
    int         i;
 
@@ -190,7 +190,7 @@ init_state(FState * st)
  * It just needs to change without repeating.
  */
 static void
-inc_counter(FState * st)
+inc_counter(FState *st)
 {
    uint32     *val = (uint32 *) st->counter;
 
@@ -207,7 +207,7 @@ inc_counter(FState * st)
  * This is called 'cipher in counter mode'.
  */
 static void
-encrypt_counter(FState * st, uint8 *dst)
+encrypt_counter(FState *st, uint8 *dst)
 {
    ciph_encrypt(&st->ciph, st->counter, dst);
    inc_counter(st);
@@ -219,7 +219,7 @@ encrypt_counter(FState * st, uint8 *dst)
  * microseconds.
  */
 static int
-enough_time_passed(FState * st)
+enough_time_passed(FState *st)
 {
    int         ok;
    struct timeval tv;
@@ -252,7 +252,7 @@ enough_time_passed(FState * st)
  * generate new key from all the pools
  */
 static void
-reseed(FState * st)
+reseed(FState *st)
 {
    unsigned    k;
    unsigned    n;
@@ -298,7 +298,7 @@ reseed(FState * st)
  * Pick a random pool. This uses key bytes as random source.
  */
 static unsigned
-get_rand_pool(FState * st)
+get_rand_pool(FState *st)
 {
    unsigned    rnd;
 
@@ -318,7 +318,7 @@ get_rand_pool(FState * st)
  * update pools
  */
 static void
-add_entropy(FState * st, const uint8 *data, unsigned len)
+add_entropy(FState *st, const uint8 *data, unsigned len)
 {
    unsigned    pos;
    uint8       hash[BLOCK];
@@ -349,7 +349,7 @@ add_entropy(FState * st, const uint8 *data, unsigned len)
  * Just take 2 next blocks as new key
  */
 static void
-rekey(FState * st)
+rekey(FState *st)
 {
    encrypt_counter(st, st->key);
    encrypt_counter(st, st->key + CIPH_BLOCK);
@@ -363,7 +363,7 @@ rekey(FState * st)
  * entropy over all of the components.
  */
 static void
-startup_tricks(FState * st)
+startup_tricks(FState *st)
 {
    int         i;
    uint8       buf[BLOCK];
@@ -388,7 +388,7 @@ startup_tricks(FState * st)
 }
 
 static void
-extract_data(FState * st, unsigned count, uint8 *dst)
+extract_data(FState *st, unsigned count, uint8 *dst)
 {
    unsigned    n;
    unsigned    block_nr = 0;
index 63b294af24d17dc2d4c5c44831586b393dc8fcc6..35dc652d43c8769e9154c8a2c8f87cfc98d0d3be 100644 (file)
@@ -27,7 +27,7 @@
   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   SOFTWARE.
  */
-/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.c,v 1.7 2007/07/15 22:43:40 tgl Exp $ */
+/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.c,v 1.8 2009/06/11 14:48:52 momjian Exp $ */
 
 #include "postgres.h"
 #include "px.h"
@@ -195,7 +195,7 @@ static void s_clamp(mp_int z);
 static void s_fake(mp_int z, int value, mp_digit vbuf[]);
 
 /* Compare two runs of digits of given length, returns <0, 0, >0 */
-static int s_cdig(mp_digit * da, mp_digit * db, mp_size len);
+static int s_cdig(mp_digit *da, mp_digit *db, mp_size len);
 
 /* Pack the unsigned digits of v into array t */
 static int s_vpack(int v, mp_digit t[]);
@@ -208,26 +208,26 @@ static int    s_vcmp(mp_int a, int v);
 
 /* Unsigned magnitude addition; assumes dc is big enough.
    Carry out is returned (no memory allocated). */
-static mp_digit s_uadd(mp_digit * da, mp_digit * db, mp_digit * dc,
+static mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b);
 
 /* Unsigned magnitude subtraction. Assumes dc is big enough. */
-static void s_usub(mp_digit * da, mp_digit * db, mp_digit * dc,
+static void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b);
 
 /* Unsigned recursive multiplication.  Assumes dc is big enough. */
-static int s_kmul(mp_digit * da, mp_digit * db, mp_digit * dc,
+static int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b);
 
 /* Unsigned magnitude multiplication.  Assumes dc is big enough. */
-static void s_umul(mp_digit * da, mp_digit * db, mp_digit * dc,
+static void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b);
 
 /* Unsigned recursive squaring.  Assumes dc is big enough. */
-static int s_ksqr(mp_digit * da, mp_digit * dc, mp_size size_a);
+static int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a);
 
 /* Unsigned magnitude squaring.  Assumes dc is big enough. */
-static void s_usqr(mp_digit * da, mp_digit * dc, mp_size size_a);
+static void s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a);
 
 /* Single digit addition.  Assumes a is big enough. */
 static void s_dadd(mp_int a, mp_digit b);
@@ -236,7 +236,7 @@ static void s_dadd(mp_int a, mp_digit b);
 static void s_dmul(mp_int a, mp_digit b);
 
 /* Single digit multiplication on buffers; assumes dc is big enough. */
-static void s_dbmul(mp_digit * da, mp_digit b, mp_digit * dc,
+static void s_dbmul(mp_digit *da, mp_digit b, mp_digit *dc,
        mp_size size_a);
 
 /* Single digit division.  Replaces a with the quotient,
@@ -310,7 +310,7 @@ static mp_result s_tobin(mp_int z, unsigned char *buf, int *limpos, int pad);
 #if 0
 /* Dump a representation of the mp_int to standard output */
 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
 
 /* {{{ get_default_precision() */
@@ -2294,7 +2294,7 @@ s_alloc(mp_size num)
 /* {{{ s_realloc(old, num) */
 
 static mp_digit *
-s_realloc(mp_digit * old, mp_size num)
+s_realloc(mp_digit *old, mp_size num)
 {
    mp_digit   *new = px_realloc(old, num * sizeof(mp_digit));
 
@@ -2375,7 +2375,7 @@ s_fake(mp_int z, int value, mp_digit vbuf[])
 /* {{{ s_cdig(da, db, len) */
 
 static int
-s_cdig(mp_digit * da, mp_digit * db, mp_size len)
+s_cdig(mp_digit *da, mp_digit *db, mp_size len)
 {
    mp_digit   *dat = da + len - 1,
               *dbt = db + len - 1;
@@ -2460,7 +2460,7 @@ s_vcmp(mp_int a, int v)
 /* {{{ s_uadd(da, db, dc, size_a, size_b) */
 
 static mp_digit
-s_uadd(mp_digit * da, mp_digit * db, mp_digit * dc,
+s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b)
 {
    mp_size     pos;
@@ -2476,7 +2476,7 @@ s_uadd(mp_digit * da, mp_digit * db, mp_digit * dc,
    /* Add corresponding digits until the shorter number runs out */
    for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc)
    {
-       w = w + (mp_word) * da + (mp_word) * db;
+       w = w + (mp_word) *da + (mp_word) *db;
        *dc = LOWER_HALF(w);
        w = UPPER_HALF(w);
    }
@@ -2499,7 +2499,7 @@ s_uadd(mp_digit * da, mp_digit * db, mp_digit * dc,
 /* {{{ s_usub(da, db, dc, size_a, size_b) */
 
 static void
-s_usub(mp_digit * da, mp_digit * db, mp_digit * dc,
+s_usub(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b)
 {
    mp_size     pos;
@@ -2512,7 +2512,7 @@ s_usub(mp_digit * da, mp_digit * db, mp_digit * dc,
    for (pos = 0; pos < size_b; ++pos, ++da, ++db, ++dc)
    {
        w = ((mp_word) MP_DIGIT_MAX + 1 +       /* MP_RADIX */
-            (mp_word) * da) - w - (mp_word) * db;
+            (mp_word) *da) - w - (mp_word) *db;
 
        *dc = LOWER_HALF(w);
        w = (UPPER_HALF(w) == 0);
@@ -2522,7 +2522,7 @@ s_usub(mp_digit * da, mp_digit * db, mp_digit * dc,
    for ( /* */ ; pos < size_a; ++pos, ++da, ++dc)
    {
        w = ((mp_word) MP_DIGIT_MAX + 1 +       /* MP_RADIX */
-            (mp_word) * da) - w;
+            (mp_word) *da) - w;
 
        *dc = LOWER_HALF(w);
        w = (UPPER_HALF(w) == 0);
@@ -2537,7 +2537,7 @@ s_usub(mp_digit * da, mp_digit * db, mp_digit * dc,
 /* {{{ s_kmul(da, db, dc, size_a, size_b) */
 
 static int
-s_kmul(mp_digit * da, mp_digit * db, mp_digit * dc,
+s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b)
 {
    mp_size     bot_size;
@@ -2638,7 +2638,7 @@ s_kmul(mp_digit * da, mp_digit * db, mp_digit * dc,
 /* {{{ s_umul(da, db, dc, size_a, size_b) */
 
 static void
-s_umul(mp_digit * da, mp_digit * db, mp_digit * dc,
+s_umul(mp_digit *da, mp_digit *db, mp_digit *dc,
       mp_size size_a, mp_size size_b)
 {
    mp_size     a,
@@ -2656,7 +2656,7 @@ s_umul(mp_digit * da, mp_digit * db, mp_digit * dc,
        w = 0;
        for (b = 0; b < size_b; ++b, ++dbt, ++dct)
        {
-           w = (mp_word) * da * (mp_word) * dbt + w + (mp_word) * dct;
+           w = (mp_word) *da * (mp_word) *dbt + w + (mp_word) *dct;
 
            *dct = LOWER_HALF(w);
            w = UPPER_HALF(w);
@@ -2671,7 +2671,7 @@ s_umul(mp_digit * da, mp_digit * db, mp_digit * dc,
 /* {{{ s_ksqr(da, dc, size_a) */
 
 static int
-s_ksqr(mp_digit * da, mp_digit * dc, mp_size size_a)
+s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a)
 {
    if (multiply_threshold && size_a > multiply_threshold)
    {
@@ -2736,7 +2736,7 @@ s_ksqr(mp_digit * da, mp_digit * dc, mp_size size_a)
 /* {{{ s_usqr(da, dc, size_a) */
 
 static void
-s_usqr(mp_digit * da, mp_digit * dc, mp_size size_a)
+s_usqr(mp_digit *da, mp_digit *dc, mp_size size_a)
 {
    mp_size     i,
                j;
@@ -2751,7 +2751,7 @@ s_usqr(mp_digit * da, mp_digit * dc, mp_size size_a)
            continue;
 
        /* Take care of the first digit, no rollover */
-       w = (mp_word) * dat * (mp_word) * dat + (mp_word) * dct;
+       w = (mp_word) *dat * (mp_word) *dat + (mp_word) *dct;
        *dct = LOWER_HALF(w);
        w = UPPER_HALF(w);
        ++dat;
@@ -2759,8 +2759,8 @@ s_usqr(mp_digit * da, mp_digit * dc, mp_size size_a)
 
        for (j = i + 1; j < size_a; ++j, ++dat, ++dct)
        {
-           mp_word     t = (mp_word) * da * (mp_word) * dat;
-           mp_word     u = w + (mp_word) * dct,
+           mp_word     t = (mp_word) *da * (mp_word) *dat;
+           mp_word     u = w + (mp_word) *dct,
                        ov = 0;
 
            /* Check if doubling t will overflow a word */
@@ -2808,13 +2808,13 @@ s_dadd(mp_int a, mp_digit b)
    mp_digit   *da = MP_DIGITS(a);
    mp_size     ua = MP_USED(a);
 
-   w = (mp_word) * da + b;
+   w = (mp_word) *da + b;
    *da++ = LOWER_HALF(w);
    w = UPPER_HALF(w);
 
    for (ua -= 1; ua > 0; --ua, ++da)
    {
-       w = (mp_word) * da + w;
+       w = (mp_word) *da + w;
 
        *da = LOWER_HALF(w);
        w = UPPER_HALF(w);
@@ -2840,7 +2840,7 @@ s_dmul(mp_int a, mp_digit b)
 
    while (ua > 0)
    {
-       w = (mp_word) * da * b + w;
+       w = (mp_word) *da * b + w;
        *da++ = LOWER_HALF(w);
        w = UPPER_HALF(w);
        --ua;
@@ -2858,13 +2858,13 @@ s_dmul(mp_int a, mp_digit b)
 /* {{{ s_dbmul(da, b, dc, size_a) */
 
 static void
-s_dbmul(mp_digit * da, mp_digit b, mp_digit * dc, mp_size size_a)
+s_dbmul(mp_digit *da, mp_digit b, mp_digit *dc, mp_size size_a)
 {
    mp_word     w = 0;
 
    while (size_a > 0)
    {
-       w = (mp_word) * da++ * (mp_word) b + w;
+       w = (mp_word) *da++ * (mp_word) b + w;
 
        *dc++ = LOWER_HALF(w);
        w = UPPER_HALF(w);
@@ -3085,13 +3085,13 @@ s_qsub(mp_int z, mp_size p2)
 
    for (pos = 0, zp = MP_DIGITS(z); pos < tdig; ++pos, ++zp)
    {
-       w = ((mp_word) MP_DIGIT_MAX + 1) - w - (mp_word) * zp;
+       w = ((mp_word) MP_DIGIT_MAX + 1) - w - (mp_word) *zp;
 
        *zp = LOWER_HALF(w);
        w = UPPER_HALF(w) ? 0 : 1;
    }
 
-   w = ((mp_word) MP_DIGIT_MAX + 1 + hi) - w - (mp_word) * zp;
+   w = ((mp_word) MP_DIGIT_MAX + 1 + hi) - w - (mp_word) *zp;
    *zp = LOWER_HALF(w);
 
    assert(UPPER_HALF(w) != 0); /* no borrow out should be possible */
@@ -3663,7 +3663,7 @@ s_print(char *tag, mp_int z)
 }
 
 void
-s_print_buf(char *tag, mp_digit * buf, mp_size num)
+s_print_buf(char *tag, mp_digit *buf, mp_size num)
 {
    int         i;
 
index 5bc335e582021e3b38912aa4b32a027ba7640e99..09d0e3e818b03659b522b41e5f9d2469beac31ec 100644 (file)
@@ -26,7 +26,7 @@
   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   SOFTWARE.
  */
-/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.h,v 1.6 2007/11/15 21:14:31 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/pgcrypto/imath.h,v 1.7 2009/06/11 14:48:52 momjian Exp $ */
 
 #ifndef IMATH_H_
 #define IMATH_H_
@@ -60,7 +60,8 @@ typedef struct mpz
    mp_size     alloc;
    mp_size     used;
    mp_sign     sign;
-}  mpz_t, *mp_int;
+} mpz_t    ,
+          *mp_int;
 
 #define MP_DIGITS(Z) ((Z)->digits)
 #define MP_ALLOC(Z)  ((Z)->alloc)
@@ -117,10 +118,10 @@ mp_result mp_int_mul_pow2(mp_int a, int p2, mp_int c);
 mp_result  mp_int_sqr(mp_int a, mp_int c);     /* c = a * a */
 
 mp_result
-mp_int_div(mp_int a, mp_int b,         /* q = a / b */
+mp_int_div(mp_int a, mp_int b, /* q = a / b */
           mp_int q, mp_int r); /* r = a % b */
 mp_result
-mp_int_div_value(mp_int a, int value,          /* q = a / value */
+mp_int_div_value(mp_int a, int value,  /* q = a / value */
                 mp_int q, int *r);     /* r = a % value */
 mp_result
 mp_int_div_pow2(mp_int a, int p2,      /* q = a / 2^p2  */
@@ -210,7 +211,7 @@ const char *mp_error_string(mp_result res);
 
 #if 0
 void       s_print(char *tag, mp_int z);
-void       s_print_buf(char *tag, mp_digit * buf, mp_size num);
+void       s_print_buf(char *tag, mp_digit *buf, mp_size num);
 #endif
 
 #endif   /* end IMATH_H_ */
index d5530c39ed99e4f97961ef291308e3f3e62db1a9..1e36a369e010c4c824f8d2cc15d962d9ef30f717 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/internal-sha2.c,v 1.2 2006/10/04 00:29:46 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/internal-sha2.c,v 1.3 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
 #include "px.h"
 #include "sha2.h"
 
-void       init_sha224(PX_MD * h);
-void       init_sha256(PX_MD * h);
-void       init_sha384(PX_MD * h);
-void       init_sha512(PX_MD * h);
+void       init_sha224(PX_MD *h);
+void       init_sha256(PX_MD *h);
+void       init_sha384(PX_MD *h);
+void       init_sha512(PX_MD *h);
 
 /* SHA224 */
 
 static unsigned
-int_sha224_len(PX_MD * h)
+int_sha224_len(PX_MD *h)
 {
    return SHA224_DIGEST_LENGTH;
 }
 
 static unsigned
-int_sha224_block_len(PX_MD * h)
+int_sha224_block_len(PX_MD *h)
 {
    return SHA224_BLOCK_LENGTH;
 }
 
 static void
-int_sha224_update(PX_MD * h, const uint8 *data, unsigned dlen)
+int_sha224_update(PX_MD *h, const uint8 *data, unsigned dlen)
 {
    SHA224_CTX *ctx = (SHA224_CTX *) h->p.ptr;
 
@@ -64,7 +64,7 @@ int_sha224_update(PX_MD * h, const uint8 *data, unsigned dlen)
 }
 
 static void
-int_sha224_reset(PX_MD * h)
+int_sha224_reset(PX_MD *h)
 {
    SHA224_CTX *ctx = (SHA224_CTX *) h->p.ptr;
 
@@ -72,7 +72,7 @@ int_sha224_reset(PX_MD * h)
 }
 
 static void
-int_sha224_finish(PX_MD * h, uint8 *dst)
+int_sha224_finish(PX_MD *h, uint8 *dst)
 {
    SHA224_CTX *ctx = (SHA224_CTX *) h->p.ptr;
 
@@ -80,7 +80,7 @@ int_sha224_finish(PX_MD * h, uint8 *dst)
 }
 
 static void
-int_sha224_free(PX_MD * h)
+int_sha224_free(PX_MD *h)
 {
    SHA224_CTX *ctx = (SHA224_CTX *) h->p.ptr;
 
@@ -92,19 +92,19 @@ int_sha224_free(PX_MD * h)
 /* SHA256 */
 
 static unsigned
-int_sha256_len(PX_MD * h)
+int_sha256_len(PX_MD *h)
 {
    return SHA256_DIGEST_LENGTH;
 }
 
 static unsigned
-int_sha256_block_len(PX_MD * h)
+int_sha256_block_len(PX_MD *h)
 {
    return SHA256_BLOCK_LENGTH;
 }
 
 static void
-int_sha256_update(PX_MD * h, const uint8 *data, unsigned dlen)
+int_sha256_update(PX_MD *h, const uint8 *data, unsigned dlen)
 {
    SHA256_CTX *ctx = (SHA256_CTX *) h->p.ptr;
 
@@ -112,7 +112,7 @@ int_sha256_update(PX_MD * h, const uint8 *data, unsigned dlen)
 }
 
 static void
-int_sha256_reset(PX_MD * h)
+int_sha256_reset(PX_MD *h)
 {
    SHA256_CTX *ctx = (SHA256_CTX *) h->p.ptr;
 
@@ -120,7 +120,7 @@ int_sha256_reset(PX_MD * h)
 }
 
 static void
-int_sha256_finish(PX_MD * h, uint8 *dst)
+int_sha256_finish(PX_MD *h, uint8 *dst)
 {
    SHA256_CTX *ctx = (SHA256_CTX *) h->p.ptr;
 
@@ -128,7 +128,7 @@ int_sha256_finish(PX_MD * h, uint8 *dst)
 }
 
 static void
-int_sha256_free(PX_MD * h)
+int_sha256_free(PX_MD *h)
 {
    SHA256_CTX *ctx = (SHA256_CTX *) h->p.ptr;
 
@@ -140,19 +140,19 @@ int_sha256_free(PX_MD * h)
 /* SHA384 */
 
 static unsigned
-int_sha384_len(PX_MD * h)
+int_sha384_len(PX_MD *h)
 {
    return SHA384_DIGEST_LENGTH;
 }
 
 static unsigned
-int_sha384_block_len(PX_MD * h)
+int_sha384_block_len(PX_MD *h)
 {
    return SHA384_BLOCK_LENGTH;
 }
 
 static void
-int_sha384_update(PX_MD * h, const uint8 *data, unsigned dlen)
+int_sha384_update(PX_MD *h, const uint8 *data, unsigned dlen)
 {
    SHA384_CTX *ctx = (SHA384_CTX *) h->p.ptr;
 
@@ -160,7 +160,7 @@ int_sha384_update(PX_MD * h, const uint8 *data, unsigned dlen)
 }
 
 static void
-int_sha384_reset(PX_MD * h)
+int_sha384_reset(PX_MD *h)
 {
    SHA384_CTX *ctx = (SHA384_CTX *) h->p.ptr;
 
@@ -168,7 +168,7 @@ int_sha384_reset(PX_MD * h)
 }
 
 static void
-int_sha384_finish(PX_MD * h, uint8 *dst)
+int_sha384_finish(PX_MD *h, uint8 *dst)
 {
    SHA384_CTX *ctx = (SHA384_CTX *) h->p.ptr;
 
@@ -176,7 +176,7 @@ int_sha384_finish(PX_MD * h, uint8 *dst)
 }
 
 static void
-int_sha384_free(PX_MD * h)
+int_sha384_free(PX_MD *h)
 {
    SHA384_CTX *ctx = (SHA384_CTX *) h->p.ptr;
 
@@ -188,19 +188,19 @@ int_sha384_free(PX_MD * h)
 /* SHA512 */
 
 static unsigned
-int_sha512_len(PX_MD * h)
+int_sha512_len(PX_MD *h)
 {
    return SHA512_DIGEST_LENGTH;
 }
 
 static unsigned
-int_sha512_block_len(PX_MD * h)
+int_sha512_block_len(PX_MD *h)
 {
    return SHA512_BLOCK_LENGTH;
 }
 
 static void
-int_sha512_update(PX_MD * h, const uint8 *data, unsigned dlen)
+int_sha512_update(PX_MD *h, const uint8 *data, unsigned dlen)
 {
    SHA512_CTX *ctx = (SHA512_CTX *) h->p.ptr;
 
@@ -208,7 +208,7 @@ int_sha512_update(PX_MD * h, const uint8 *data, unsigned dlen)
 }
 
 static void
-int_sha512_reset(PX_MD * h)
+int_sha512_reset(PX_MD *h)
 {
    SHA512_CTX *ctx = (SHA512_CTX *) h->p.ptr;
 
@@ -216,7 +216,7 @@ int_sha512_reset(PX_MD * h)
 }
 
 static void
-int_sha512_finish(PX_MD * h, uint8 *dst)
+int_sha512_finish(PX_MD *h, uint8 *dst)
 {
    SHA512_CTX *ctx = (SHA512_CTX *) h->p.ptr;
 
@@ -224,7 +224,7 @@ int_sha512_finish(PX_MD * h, uint8 *dst)
 }
 
 static void
-int_sha512_free(PX_MD * h)
+int_sha512_free(PX_MD *h)
 {
    SHA512_CTX *ctx = (SHA512_CTX *) h->p.ptr;
 
@@ -236,7 +236,7 @@ int_sha512_free(PX_MD * h)
 /* init functions */
 
 void
-init_sha224(PX_MD * md)
+init_sha224(PX_MD *md)
 {
    SHA224_CTX *ctx;
 
@@ -256,7 +256,7 @@ init_sha224(PX_MD * md)
 }
 
 void
-init_sha256(PX_MD * md)
+init_sha256(PX_MD *md)
 {
    SHA256_CTX *ctx;
 
@@ -276,7 +276,7 @@ init_sha256(PX_MD * md)
 }
 
 void
-init_sha384(PX_MD * md)
+init_sha384(PX_MD *md)
 {
    SHA384_CTX *ctx;
 
@@ -296,7 +296,7 @@ init_sha384(PX_MD * md)
 }
 
 void
-init_sha512(PX_MD * md)
+init_sha512(PX_MD *md)
 {
    SHA512_CTX *ctx;
 
index 56634aa32a2423f7f5885b2e8f5e00174f8a102c..84bda624a433afcd90622232e1a6b43214e41e4e 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.28 2008/02/17 02:09:26 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.29 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
 #define SHA1_BLOCK_SIZE 64
 #define MD5_BLOCK_SIZE 64
 
-static void init_md5(PX_MD * h);
-static void init_sha1(PX_MD * h);
+static void init_md5(PX_MD *h);
+static void init_sha1(PX_MD *h);
 
-void       init_sha224(PX_MD * h);
-void       init_sha256(PX_MD * h);
-void       init_sha384(PX_MD * h);
-void       init_sha512(PX_MD * h);
+void       init_sha224(PX_MD *h);
+void       init_sha256(PX_MD *h);
+void       init_sha384(PX_MD *h);
+void       init_sha512(PX_MD *h);
 
 struct int_digest
 {
    char       *name;
-   void        (*init) (PX_MD * h);
+   void        (*init) (PX_MD *h);
 };
 
 static const struct int_digest
@@ -103,19 +103,19 @@ static const struct int_digest
 /* MD5 */
 
 static unsigned
-int_md5_len(PX_MD * h)
+int_md5_len(PX_MD *h)
 {
    return MD5_DIGEST_LENGTH;
 }
 
 static unsigned
-int_md5_block_len(PX_MD * h)
+int_md5_block_len(PX_MD *h)
 {
    return MD5_BLOCK_SIZE;
 }
 
 static void
-int_md5_update(PX_MD * h, const uint8 *data, unsigned dlen)
+int_md5_update(PX_MD *h, const uint8 *data, unsigned dlen)
 {
    MD5_CTX    *ctx = (MD5_CTX *) h->p.ptr;
 
@@ -123,7 +123,7 @@ int_md5_update(PX_MD * h, const uint8 *data, unsigned dlen)
 }
 
 static void
-int_md5_reset(PX_MD * h)
+int_md5_reset(PX_MD *h)
 {
    MD5_CTX    *ctx = (MD5_CTX *) h->p.ptr;
 
@@ -131,7 +131,7 @@ int_md5_reset(PX_MD * h)
 }
 
 static void
-int_md5_finish(PX_MD * h, uint8 *dst)
+int_md5_finish(PX_MD *h, uint8 *dst)
 {
    MD5_CTX    *ctx = (MD5_CTX *) h->p.ptr;
 
@@ -139,7 +139,7 @@ int_md5_finish(PX_MD * h, uint8 *dst)
 }
 
 static void
-int_md5_free(PX_MD * h)
+int_md5_free(PX_MD *h)
 {
    MD5_CTX    *ctx = (MD5_CTX *) h->p.ptr;
 
@@ -151,19 +151,19 @@ int_md5_free(PX_MD * h)
 /* SHA1 */
 
 static unsigned
-int_sha1_len(PX_MD * h)
+int_sha1_len(PX_MD *h)
 {
    return SHA1_DIGEST_LENGTH;
 }
 
 static unsigned
-int_sha1_block_len(PX_MD * h)
+int_sha1_block_len(PX_MD *h)
 {
    return SHA1_BLOCK_SIZE;
 }
 
 static void
-int_sha1_update(PX_MD * h, const uint8 *data, unsigned dlen)
+int_sha1_update(PX_MD *h, const uint8 *data, unsigned dlen)
 {
    SHA1_CTX   *ctx = (SHA1_CTX *) h->p.ptr;
 
@@ -171,7 +171,7 @@ int_sha1_update(PX_MD * h, const uint8 *data, unsigned dlen)
 }
 
 static void
-int_sha1_reset(PX_MD * h)
+int_sha1_reset(PX_MD *h)
 {
    SHA1_CTX   *ctx = (SHA1_CTX *) h->p.ptr;
 
@@ -179,7 +179,7 @@ int_sha1_reset(PX_MD * h)
 }
 
 static void
-int_sha1_finish(PX_MD * h, uint8 *dst)
+int_sha1_finish(PX_MD *h, uint8 *dst)
 {
    SHA1_CTX   *ctx = (SHA1_CTX *) h->p.ptr;
 
@@ -187,7 +187,7 @@ int_sha1_finish(PX_MD * h, uint8 *dst)
 }
 
 static void
-int_sha1_free(PX_MD * h)
+int_sha1_free(PX_MD *h)
 {
    SHA1_CTX   *ctx = (SHA1_CTX *) h->p.ptr;
 
@@ -199,7 +199,7 @@ int_sha1_free(PX_MD * h)
 /* init functions */
 
 static void
-init_md5(PX_MD * md)
+init_md5(PX_MD *md)
 {
    MD5_CTX    *ctx;
 
@@ -219,7 +219,7 @@ init_md5(PX_MD * md)
 }
 
 static void
-init_sha1(PX_MD * md)
+init_sha1(PX_MD *md)
 {
    SHA1_CTX   *ctx;
 
@@ -260,7 +260,7 @@ struct int_ctx
 };
 
 static void
-intctx_free(PX_Cipher * c)
+intctx_free(PX_Cipher *c)
 {
    struct int_ctx *cx = (struct int_ctx *) c->ptr;
 
@@ -280,25 +280,25 @@ intctx_free(PX_Cipher * c)
 #define MODE_CBC 1
 
 static unsigned
-rj_block_size(PX_Cipher * c)
+rj_block_size(PX_Cipher *c)
 {
    return 128 / 8;
 }
 
 static unsigned
-rj_key_size(PX_Cipher * c)
+rj_key_size(PX_Cipher *c)
 {
    return 256 / 8;
 }
 
 static unsigned
-rj_iv_size(PX_Cipher * c)
+rj_iv_size(PX_Cipher *c)
 {
    return 128 / 8;
 }
 
 static int
-rj_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
+rj_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
 {
    struct int_ctx *cx = (struct int_ctx *) c->ptr;
 
@@ -327,7 +327,7 @@ rj_real_init(struct int_ctx * cx, int dir)
 }
 
 static int
-rj_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+rj_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    struct int_ctx *cx = (struct int_ctx *) c->ptr;
 
@@ -357,7 +357,7 @@ rj_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 }
 
 static int
-rj_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+rj_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    struct int_ctx *cx = (struct int_ctx *) c->ptr;
 
@@ -418,25 +418,25 @@ rj_load(int mode)
  */
 
 static unsigned
-bf_block_size(PX_Cipher * c)
+bf_block_size(PX_Cipher *c)
 {
    return 8;
 }
 
 static unsigned
-bf_key_size(PX_Cipher * c)
+bf_key_size(PX_Cipher *c)
 {
    return 448 / 8;
 }
 
 static unsigned
-bf_iv_size(PX_Cipher * c)
+bf_iv_size(PX_Cipher *c)
 {
    return 8;
 }
 
 static int
-bf_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
+bf_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
 {
    struct int_ctx *cx = (struct int_ctx *) c->ptr;
 
@@ -448,7 +448,7 @@ bf_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
 }
 
 static int
-bf_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    struct int_ctx *cx = (struct int_ctx *) c->ptr;
    BlowfishContext *bfctx = &cx->ctx.bf;
@@ -473,7 +473,7 @@ bf_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 }
 
 static int
-bf_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    struct int_ctx *cx = (struct int_ctx *) c->ptr;
    BlowfishContext *bfctx = &cx->ctx.bf;
@@ -577,7 +577,7 @@ static const PX_Alias int_aliases[] = {
 /* PUBLIC FUNCTIONS */
 
 int
-px_find_digest(const char *name, PX_MD ** res)
+px_find_digest(const char *name, PX_MD **res)
 {
    const struct int_digest *p;
    PX_MD      *h;
@@ -596,7 +596,7 @@ px_find_digest(const char *name, PX_MD ** res)
 }
 
 int
-px_find_cipher(const char *name, PX_Cipher ** res)
+px_find_cipher(const char *name, PX_Cipher **res)
 {
    int         i;
    PX_Cipher  *c = NULL;
index 920e10f6ca666aaea7fb0b15c8ac94e36633e296..d3eee2ee4f8b808f6955935da8e58fcd56975b16 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.4 2007/07/15 23:57:13 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.5 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -47,25 +47,25 @@ struct MBuf
 };
 
 int
-mbuf_avail(MBuf * mbuf)
+mbuf_avail(MBuf *mbuf)
 {
    return mbuf->data_end - mbuf->read_pos;
 }
 
 int
-mbuf_size(MBuf * mbuf)
+mbuf_size(MBuf *mbuf)
 {
    return mbuf->data_end - mbuf->data;
 }
 
 int
-mbuf_tell(MBuf * mbuf)
+mbuf_tell(MBuf *mbuf)
 {
    return mbuf->read_pos - mbuf->data;
 }
 
 int
-mbuf_free(MBuf * mbuf)
+mbuf_free(MBuf *mbuf)
 {
    if (mbuf->own_data)
    {
@@ -77,7 +77,7 @@ mbuf_free(MBuf * mbuf)
 }
 
 static void
-prepare_room(MBuf * mbuf, int block_len)
+prepare_room(MBuf *mbuf, int block_len)
 {
    uint8      *newbuf;
    unsigned    newlen;
@@ -99,7 +99,7 @@ prepare_room(MBuf * mbuf, int block_len)
 }
 
 int
-mbuf_append(MBuf * dst, const uint8 *buf, int len)
+mbuf_append(MBuf *dst, const uint8 *buf, int len)
 {
    if (dst->no_write)
    {
@@ -154,7 +154,7 @@ mbuf_create_from_data(const uint8 *data, int len)
 
 
 int
-mbuf_grab(MBuf * mbuf, int len, uint8 **data_p)
+mbuf_grab(MBuf *mbuf, int len, uint8 **data_p)
 {
    if (len > mbuf_avail(mbuf))
        len = mbuf_avail(mbuf);
@@ -167,14 +167,14 @@ mbuf_grab(MBuf * mbuf, int len, uint8 **data_p)
 }
 
 int
-mbuf_rewind(MBuf * mbuf)
+mbuf_rewind(MBuf *mbuf)
 {
    mbuf->read_pos = mbuf->data;
    return 0;
 }
 
 int
-mbuf_steal_data(MBuf * mbuf, uint8 **data_p)
+mbuf_steal_data(MBuf *mbuf, uint8 **data_p)
 {
    int         len = mbuf_size(mbuf);
 
@@ -203,7 +203,7 @@ struct PullFilter
 };
 
 int
-pullf_create(PullFilter ** pf_p, const PullFilterOps * op, void *init_arg, PullFilter * src)
+pullf_create(PullFilter **pf_p, const PullFilterOps *op, void *init_arg, PullFilter *src)
 {
    PullFilter *pf;
    void       *priv;
@@ -242,7 +242,7 @@ pullf_create(PullFilter ** pf_p, const PullFilterOps * op, void *init_arg, PullF
 }
 
 void
-pullf_free(PullFilter * pf)
+pullf_free(PullFilter *pf)
 {
    if (pf->op->free)
        pf->op->free(pf->priv);
@@ -259,7 +259,7 @@ pullf_free(PullFilter * pf)
 
 /* may return less data than asked, 0 means eof */
 int
-pullf_read(PullFilter * pf, int len, uint8 **data_p)
+pullf_read(PullFilter *pf, int len, uint8 **data_p)
 {
    int         res;
 
@@ -276,7 +276,7 @@ pullf_read(PullFilter * pf, int len, uint8 **data_p)
 }
 
 int
-pullf_read_max(PullFilter * pf, int len, uint8 **data_p, uint8 *tmpbuf)
+pullf_read_max(PullFilter *pf, int len, uint8 **data_p, uint8 *tmpbuf)
 {
    int         res,
                total;
@@ -313,7 +313,7 @@ pullf_read_max(PullFilter * pf, int len, uint8 **data_p, uint8 *tmpbuf)
  * caller wants exatly len bytes and dont bother with references
  */
 int
-pullf_read_fixed(PullFilter * src, int len, uint8 *dst)
+pullf_read_fixed(PullFilter *src, int len, uint8 *dst)
 {
    int         res;
    uint8      *p;
@@ -335,7 +335,7 @@ pullf_read_fixed(PullFilter * src, int len, uint8 *dst)
  * read from MBuf
  */
 static int
-pull_from_mbuf(void *arg, PullFilter * src, int len,
+pull_from_mbuf(void *arg, PullFilter *src, int len,
               uint8 **data_p, uint8 *buf, int buflen)
 {
    MBuf       *mbuf = arg;
@@ -348,7 +348,7 @@ static const struct PullFilterOps mbuf_reader = {
 };
 
 int
-pullf_create_mbuf_reader(PullFilter ** mp_p, MBuf * src)
+pullf_create_mbuf_reader(PullFilter **mp_p, MBuf *src)
 {
    return pullf_create(mp_p, &mbuf_reader, src, NULL);
 }
@@ -369,7 +369,7 @@ struct PushFilter
 };
 
 int
-pushf_create(PushFilter ** mp_p, const PushFilterOps * op, void *init_arg, PushFilter * next)
+pushf_create(PushFilter **mp_p, const PushFilterOps *op, void *init_arg, PushFilter *next)
 {
    PushFilter *mp;
    void       *priv;
@@ -408,7 +408,7 @@ pushf_create(PushFilter ** mp_p, const PushFilterOps * op, void *init_arg, PushF
 }
 
 void
-pushf_free(PushFilter * mp)
+pushf_free(PushFilter *mp)
 {
    if (mp->op->free)
        mp->op->free(mp->priv);
@@ -424,7 +424,7 @@ pushf_free(PushFilter * mp)
 }
 
 void
-pushf_free_all(PushFilter * mp)
+pushf_free_all(PushFilter *mp)
 {
    PushFilter *tmp;
 
@@ -437,7 +437,7 @@ pushf_free_all(PushFilter * mp)
 }
 
 static int
-wrap_process(PushFilter * mp, const uint8 *data, int len)
+wrap_process(PushFilter *mp, const uint8 *data, int len)
 {
    int         res;
 
@@ -452,7 +452,7 @@ wrap_process(PushFilter * mp, const uint8 *data, int len)
 
 /* consumes all data, returns len on success */
 int
-pushf_write(PushFilter * mp, const uint8 *data, int len)
+pushf_write(PushFilter *mp, const uint8 *data, int len)
 {
    int         need,
                res;
@@ -512,7 +512,7 @@ pushf_write(PushFilter * mp, const uint8 *data, int len)
 }
 
 int
-pushf_flush(PushFilter * mp)
+pushf_flush(PushFilter *mp)
 {
    int         res;
 
@@ -542,7 +542,7 @@ pushf_flush(PushFilter * mp)
  * write to MBuf
  */
 static int
-push_into_mbuf(PushFilter * next, void *arg, const uint8 *data, int len)
+push_into_mbuf(PushFilter *next, void *arg, const uint8 *data, int len)
 {
    int         res = 0;
    MBuf       *mbuf = arg;
@@ -557,7 +557,7 @@ static const struct PushFilterOps mbuf_filter = {
 };
 
 int
-pushf_create_mbuf_writer(PushFilter ** res, MBuf * dst)
+pushf_create_mbuf_writer(PushFilter **res, MBuf *dst)
 {
    return pushf_create(res, &mbuf_filter, dst, NULL);
 }
index 91ef821ed4a77b79bc3515d99472b8a13e0a324a..aa2b5596eebbf1e37f1c60022c39f91da0ef88b2 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.h,v 1.2 2005/10/15 02:49:06 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.h,v 1.3 2009/06/11 14:48:52 momjian Exp $
  */
 
 #ifndef __PX_MBUF_H
@@ -44,15 +44,15 @@ struct PushFilterOps
     * should return needed buffer size, 0- no buffering, <0 on error if NULL,
     * no buffering, and priv=init_arg
     */
-   int         (*init) (PushFilter * next, void *init_arg, void **priv_p);
+   int         (*init) (PushFilter *next, void *init_arg, void **priv_p);
 
    /*
     * send data to next.  should consume all? if null, it will be simply
     * copied (in-place) returns 0 on error
     */
-   int         (*push) (PushFilter * next, void *priv,
+   int         (*push) (PushFilter *next, void *priv,
                                     const uint8 *src, int len);
-   int         (*flush) (PushFilter * next, void *priv);
+   int         (*flush) (PushFilter *next, void *priv);
    void        (*free) (void *priv);
 };
 
@@ -62,13 +62,13 @@ struct PullFilterOps
     * should return needed buffer size, 0- no buffering, <0 on error if NULL,
     * no buffering, and priv=init_arg
     */
-   int         (*init) (void **priv_p, void *init_arg, PullFilter * src);
+   int         (*init) (void **priv_p, void *init_arg, PullFilter *src);
 
    /*
     * request data from src, put result ptr to data_p can use ptr from src or
     * use buf as work area if NULL in-place copy
     */
-   int         (*pull) (void *priv, PullFilter * src, int len,
+   int         (*pull) (void *priv, PullFilter *src, int len,
                                     uint8 **data_p, uint8 *buf, int buflen);
    void        (*free) (void *priv);
 };
@@ -78,39 +78,39 @@ struct PullFilterOps
  */
 MBuf      *mbuf_create(int len);
 MBuf      *mbuf_create_from_data(const uint8 *data, int len);
-int            mbuf_tell(MBuf * mbuf);
-int            mbuf_avail(MBuf * mbuf);
-int            mbuf_size(MBuf * mbuf);
-int            mbuf_grab(MBuf * mbuf, int len, uint8 **data_p);
-int            mbuf_steal_data(MBuf * mbuf, uint8 **data_p);
-int            mbuf_append(MBuf * dst, const uint8 *buf, int cnt);
-int            mbuf_rewind(MBuf * mbuf);
-int            mbuf_free(MBuf * mbuf);
+int            mbuf_tell(MBuf *mbuf);
+int            mbuf_avail(MBuf *mbuf);
+int            mbuf_size(MBuf *mbuf);
+int            mbuf_grab(MBuf *mbuf, int len, uint8 **data_p);
+int            mbuf_steal_data(MBuf *mbuf, uint8 **data_p);
+int            mbuf_append(MBuf *dst, const uint8 *buf, int cnt);
+int            mbuf_rewind(MBuf *mbuf);
+int            mbuf_free(MBuf *mbuf);
 
 /*
  * Push filter
  */
-int pushf_create(PushFilter ** res, const PushFilterOps * ops, void *init_arg,
-            PushFilter * next);
-int            pushf_write(PushFilter * mp, const uint8 *data, int len);
-void       pushf_free_all(PushFilter * mp);
-void       pushf_free(PushFilter * mp);
-int            pushf_flush(PushFilter * mp);
+int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
+            PushFilter *next);
+int            pushf_write(PushFilter *mp, const uint8 *data, int len);
+void       pushf_free_all(PushFilter *mp);
+void       pushf_free(PushFilter *mp);
+int            pushf_flush(PushFilter *mp);
 
-int            pushf_create_mbuf_writer(PushFilter ** mp_p, MBuf * mbuf);
+int            pushf_create_mbuf_writer(PushFilter **mp_p, MBuf *mbuf);
 
 /*
  * Pull filter
  */
-int pullf_create(PullFilter ** res, const PullFilterOps * ops,
-            void *init_arg, PullFilter * src);
-int            pullf_read(PullFilter * mp, int len, uint8 **data_p);
-int pullf_read_max(PullFilter * mp, int len,
+int pullf_create(PullFilter **res, const PullFilterOps *ops,
+            void *init_arg, PullFilter *src);
+int            pullf_read(PullFilter *mp, int len, uint8 **data_p);
+int pullf_read_max(PullFilter *mp, int len,
               uint8 **data_p, uint8 *tmpbuf);
-void       pullf_free(PullFilter * mp);
-int            pullf_read_fixed(PullFilter * src, int len, uint8 *dst);
+void       pullf_free(PullFilter *mp);
+int            pullf_read_fixed(PullFilter *src, int len, uint8 *dst);
 
-int            pullf_create_mbuf_reader(PullFilter ** pf_p, MBuf * mbuf);
+int            pullf_create_mbuf_reader(PullFilter **pf_p, MBuf *mbuf);
 
 #define GETBYTE(pf, dst) \
    do { \
index 851c5c888b213319c349732c21a07348faa6d917..8083d1f28063ed9a357100b8c88ff0e4d82909e8 100644 (file)
@@ -28,7 +28,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/md5.c,v 1.14 2007/04/06 05:36:50 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/md5.c,v 1.15 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -136,7 +136,7 @@ static const uint8 md5_paddat[MD5_BUFLEN] = {
 static void md5_calc(uint8 *, md5_ctxt *);
 
 void
-md5_init(md5_ctxt * ctxt)
+md5_init(md5_ctxt *ctxt)
 {
    ctxt->md5_n = 0;
    ctxt->md5_i = 0;
@@ -148,7 +148,7 @@ md5_init(md5_ctxt * ctxt)
 }
 
 void
-md5_loop(md5_ctxt * ctxt, const uint8 *input, unsigned len)
+md5_loop(md5_ctxt *ctxt, const uint8 *input, unsigned len)
 {
    unsigned int gap,
                i;
@@ -175,7 +175,7 @@ md5_loop(md5_ctxt * ctxt, const uint8 *input, unsigned len)
 }
 
 void
-md5_pad(md5_ctxt * ctxt)
+md5_pad(md5_ctxt *ctxt)
 {
    unsigned int gap;
 
@@ -213,7 +213,7 @@ md5_pad(md5_ctxt * ctxt)
 }
 
 void
-md5_result(uint8 *digest, md5_ctxt * ctxt)
+md5_result(uint8 *digest, md5_ctxt *ctxt)
 {
    /* 4 byte words */
 #ifndef WORDS_BIGENDIAN
@@ -243,7 +243,7 @@ static uint32 X[16];
 #endif
 
 static void
-md5_calc(uint8 *b64, md5_ctxt * ctxt)
+md5_calc(uint8 *b64, md5_ctxt *ctxt)
 {
    uint32      A = ctxt->md5_sta;
    uint32      B = ctxt->md5_stb;
index 933dcaa9b9780a51ae42700dd0d4ff92994c97ec..eb7c620b48ecbf8ac3b3823d7556b747a1bc4662 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/pgcrypto/md5.h,v 1.9 2005/10/15 02:49:06 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/pgcrypto/md5.h,v 1.10 2009/06/11 14:48:52 momjian Exp $ */
 /*    $KAME: md5.h,v 1.3 2000/02/22 14:01:18 itojun Exp $     */
 
 /*
@@ -59,7 +59,7 @@ typedef struct
 
    unsigned int md5_i;
    uint8       md5_buf[MD5_BUFLEN];
-}  md5_ctxt;
+} md5_ctxt;
 
 extern void md5_init(md5_ctxt *);
 extern void md5_loop(md5_ctxt *, const uint8 *, unsigned int);
index 0f46580005d8476100dfe94bb9c9165afa74c0f5..bb0b4eefd327e5d23a6b0054d96c70cd17002ac9 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.32 2007/11/15 21:14:31 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.33 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -169,10 +169,10 @@ EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *res, unsigned int *len)
 #include "sha2.c"
 #include "internal-sha2.c"
 
-typedef void (*init_f) (PX_MD * md);
+typedef void (*init_f) (PX_MD *md);
 
 static int
-compat_find_digest(const char *name, PX_MD ** res)
+compat_find_digest(const char *name, PX_MD **res)
 {
    init_f      init = NULL;
 
@@ -203,10 +203,10 @@ typedef struct OSSLDigest
 {
    const EVP_MD *algo;
    EVP_MD_CTX  ctx;
-}  OSSLDigest;
+} OSSLDigest;
 
 static unsigned
-digest_result_size(PX_MD * h)
+digest_result_size(PX_MD *h)
 {
    OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
 
@@ -214,7 +214,7 @@ digest_result_size(PX_MD * h)
 }
 
 static unsigned
-digest_block_size(PX_MD * h)
+digest_block_size(PX_MD *h)
 {
    OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
 
@@ -222,7 +222,7 @@ digest_block_size(PX_MD * h)
 }
 
 static void
-digest_reset(PX_MD * h)
+digest_reset(PX_MD *h)
 {
    OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
 
@@ -230,7 +230,7 @@ digest_reset(PX_MD * h)
 }
 
 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;
 
@@ -238,7 +238,7 @@ digest_update(PX_MD * h, const uint8 *data, unsigned dlen)
 }
 
 static void
-digest_finish(PX_MD * h, uint8 *dst)
+digest_finish(PX_MD *h, uint8 *dst)
 {
    OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
 
@@ -246,7 +246,7 @@ digest_finish(PX_MD * h, uint8 *dst)
 }
 
 static void
-digest_free(PX_MD * h)
+digest_free(PX_MD *h)
 {
    OSSLDigest *digest = (OSSLDigest *) h->p.ptr;
 
@@ -261,7 +261,7 @@ static int  px_openssl_initialized = 0;
 /* PUBLIC functions */
 
 int
-px_find_digest(const char *name, PX_MD ** res)
+px_find_digest(const char *name, PX_MD **res)
 {
    const EVP_MD *md;
    PX_MD      *h;
@@ -310,9 +310,9 @@ px_find_digest(const char *name, PX_MD ** res)
 
 struct ossl_cipher
 {
-   int         (*init) (PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv);
-   int         (*encrypt) (PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res);
-   int         (*decrypt) (PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res);
+   int         (*init) (PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv);
+   int         (*encrypt) (PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res);
+   int         (*decrypt) (PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res);
 
    int         block_size;
    int         max_key_size;
@@ -346,12 +346,12 @@ typedef struct
    unsigned    klen;
    unsigned    init;
    const struct ossl_cipher *ciph;
-}  ossldata;
+} ossldata;
 
 /* generic */
 
 static unsigned
-gen_ossl_block_size(PX_Cipher * c)
+gen_ossl_block_size(PX_Cipher *c)
 {
    ossldata   *od = (ossldata *) c->ptr;
 
@@ -359,7 +359,7 @@ gen_ossl_block_size(PX_Cipher * c)
 }
 
 static unsigned
-gen_ossl_key_size(PX_Cipher * c)
+gen_ossl_key_size(PX_Cipher *c)
 {
    ossldata   *od = (ossldata *) c->ptr;
 
@@ -367,7 +367,7 @@ gen_ossl_key_size(PX_Cipher * c)
 }
 
 static unsigned
-gen_ossl_iv_size(PX_Cipher * c)
+gen_ossl_iv_size(PX_Cipher *c)
 {
    unsigned    ivlen;
    ossldata   *od = (ossldata *) c->ptr;
@@ -377,7 +377,7 @@ gen_ossl_iv_size(PX_Cipher * c)
 }
 
 static void
-gen_ossl_free(PX_Cipher * c)
+gen_ossl_free(PX_Cipher *c)
 {
    ossldata   *od = (ossldata *) c->ptr;
 
@@ -422,7 +422,7 @@ bf_check_supported_key_len(void)
 }
 
 static int
-bf_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
+bf_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
 {
    ossldata   *od = c->ptr;
    static int  bf_is_strong = -1;
@@ -450,7 +450,7 @@ bf_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
 }
 
 static int
-bf_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_ecb_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
    unsigned    i;
@@ -462,7 +462,7 @@ bf_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 }
 
 static int
-bf_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_ecb_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c),
                i;
@@ -474,7 +474,7 @@ bf_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 }
 
 static int
-bf_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_cbc_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    ossldata   *od = c->ptr;
 
@@ -483,7 +483,7 @@ bf_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 }
 
 static int
-bf_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_cbc_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    ossldata   *od = c->ptr;
 
@@ -492,7 +492,7 @@ bf_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 }
 
 static int
-bf_cfb64_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_cfb64_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    ossldata   *od = c->ptr;
 
@@ -502,7 +502,7 @@ bf_cfb64_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 }
 
 static int
-bf_cfb64_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+bf_cfb64_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    ossldata   *od = c->ptr;
 
@@ -514,7 +514,7 @@ bf_cfb64_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
 /* DES */
 
 static int
-ossl_des_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
+ossl_des_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
 {
    ossldata   *od = c->ptr;
    DES_cblock  xkey;
@@ -532,7 +532,7 @@ ossl_des_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
 }
 
 static int
-ossl_des_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des_ecb_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
@@ -547,7 +547,7 @@ ossl_des_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_des_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des_ecb_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
@@ -562,7 +562,7 @@ ossl_des_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_des_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des_cbc_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    ossldata   *od = c->ptr;
@@ -573,7 +573,7 @@ ossl_des_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_des_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des_cbc_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    ossldata   *od = c->ptr;
@@ -586,7 +586,7 @@ ossl_des_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 /* DES3 */
 
 static int
-ossl_des3_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
+ossl_des3_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
 {
    ossldata   *od = c->ptr;
    DES_cblock  xkey1,
@@ -617,7 +617,7 @@ ossl_des3_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
 }
 
 static int
-ossl_des3_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des3_ecb_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                      uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
@@ -631,7 +631,7 @@ ossl_des3_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_des3_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des3_ecb_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                      uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
@@ -645,7 +645,7 @@ ossl_des3_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_des3_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des3_cbc_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                      uint8 *res)
 {
    ossldata   *od = c->ptr;
@@ -657,7 +657,7 @@ ossl_des3_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_des3_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_des3_cbc_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                      uint8 *res)
 {
    ossldata   *od = c->ptr;
@@ -671,7 +671,7 @@ ossl_des3_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 /* CAST5 */
 
 static int
-ossl_cast_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
+ossl_cast_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
 {
    ossldata   *od = c->ptr;
    unsigned    bs = gen_ossl_block_size(c);
@@ -685,7 +685,7 @@ ossl_cast_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
 }
 
 static int
-ossl_cast_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+ossl_cast_ecb_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
    ossldata   *od = c->ptr;
@@ -697,7 +697,7 @@ ossl_cast_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re
 }
 
 static int
-ossl_cast_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+ossl_cast_ecb_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
    ossldata   *od = c->ptr;
@@ -709,7 +709,7 @@ ossl_cast_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re
 }
 
 static int
-ossl_cast_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+ossl_cast_cbc_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    ossldata   *od = c->ptr;
 
@@ -718,7 +718,7 @@ ossl_cast_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re
 }
 
 static int
-ossl_cast_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
+ossl_cast_cbc_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen, uint8 *res)
 {
    ossldata   *od = c->ptr;
 
@@ -729,7 +729,7 @@ ossl_cast_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re
 /* AES */
 
 static int
-ossl_aes_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
+ossl_aes_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
 {
    ossldata   *od = c->ptr;
    unsigned    bs = gen_ossl_block_size(c);
@@ -753,7 +753,7 @@ ossl_aes_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
 }
 
 static int
-ossl_aes_key_init(ossldata * od, int type)
+ossl_aes_key_init(ossldata *od, int type)
 {
    int         err;
 
@@ -776,7 +776,7 @@ ossl_aes_key_init(ossldata * od, int type)
 }
 
 static int
-ossl_aes_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_aes_ecb_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
@@ -794,7 +794,7 @@ ossl_aes_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_aes_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_aes_ecb_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    unsigned    bs = gen_ossl_block_size(c);
@@ -812,7 +812,7 @@ ossl_aes_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_aes_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_aes_cbc_encrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    ossldata   *od = c->ptr;
@@ -827,7 +827,7 @@ ossl_aes_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
 }
 
 static int
-ossl_aes_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
+ossl_aes_cbc_decrypt(PX_Cipher *c, const uint8 *data, unsigned dlen,
                     uint8 *res)
 {
    ossldata   *od = c->ptr;
@@ -945,7 +945,7 @@ static const struct ossl_cipher_lookup ossl_cipher_types[] = {
 /* PUBLIC functions */
 
 int
-px_find_cipher(const char *name, PX_Cipher ** res)
+px_find_cipher(const char *name, PX_Cipher **res)
 {
    const struct ossl_cipher_lookup *i;
    PX_Cipher  *c = NULL;
index 811bb7c2c33fd2f7cf2c269369fe74bb661d9d5c..bd05ccc94e481397b775e8b252985d10450ddff2 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-cfb.c,v 1.3 2005/10/15 02:49:06 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-cfb.c,v 1.4 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -35,7 +35,7 @@
 #include "px.h"
 #include "pgp.h"
 
-typedef int (*mix_data_t) (PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst);
+typedef int (*mix_data_t) (PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst);
 
 struct PGP_CFB
 {
@@ -50,7 +50,7 @@ struct PGP_CFB
 };
 
 int
-pgp_cfb_create(PGP_CFB ** ctx_p, int algo, const uint8 *key, int key_len,
+pgp_cfb_create(PGP_CFB **ctx_p, int algo, const uint8 *key, int key_len,
               int resync, uint8 *iv)
 {
    int         res;
@@ -82,7 +82,7 @@ pgp_cfb_create(PGP_CFB ** ctx_p, int algo, const uint8 *key, int key_len,
 }
 
 void
-pgp_cfb_free(PGP_CFB * ctx)
+pgp_cfb_free(PGP_CFB *ctx)
 {
    px_cipher_free(ctx->ciph);
    memset(ctx, 0, sizeof(*ctx));
@@ -93,7 +93,7 @@ pgp_cfb_free(PGP_CFB * ctx)
  * Data processing for normal CFB. (PGP_PKT_SYMENCRYPTED_DATA_MDC)
  */
 static int
-mix_encrypt_normal(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
+mix_encrypt_normal(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)
 {
    int         i;
 
@@ -104,7 +104,7 @@ mix_encrypt_normal(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
 }
 
 static int
-mix_decrypt_normal(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
+mix_decrypt_normal(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)
 {
    int         i;
 
@@ -124,7 +124,7 @@ mix_decrypt_normal(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
  * thus its all concentrated here.
  */
 static int
-mix_encrypt_resync(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
+mix_encrypt_resync(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)
 {
    int         i,
                n;
@@ -156,7 +156,7 @@ mix_encrypt_resync(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
 }
 
 static int
-mix_decrypt_resync(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
+mix_decrypt_resync(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)
 {
    int         i,
                n;
@@ -196,7 +196,7 @@ mix_decrypt_resync(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
  * common code for both encrypt and decrypt.
  */
 static int
-cfb_process(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst,
+cfb_process(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst,
            mix_data_t mix_data)
 {
    int         n;
@@ -249,7 +249,7 @@ cfb_process(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst,
  */
 
 int
-pgp_cfb_encrypt(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
+pgp_cfb_encrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)
 {
    mix_data_t  mix = ctx->resync ? mix_encrypt_resync : mix_encrypt_normal;
 
@@ -257,7 +257,7 @@ pgp_cfb_encrypt(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
 }
 
 int
-pgp_cfb_decrypt(PGP_CFB * ctx, const uint8 *data, int len, uint8 *dst)
+pgp_cfb_decrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst)
 {
    mix_data_t  mix = ctx->resync ? mix_decrypt_resync : mix_decrypt_normal;
 
index 9d2f61ed8ed3163304cc6e584541a61d13e420bb..41f585524767905928d443e5b31bbb194880f7c3 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-compress.c,v 1.7 2007/11/15 21:14:31 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-compress.c,v 1.8 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -69,7 +69,7 @@ z_free(void *priv, void *addr)
 }
 
 static int
-compress_init(PushFilter * next, void *init_arg, void **priv_p)
+compress_init(PushFilter *next, void *init_arg, void **priv_p)
 {
    int         res;
    struct ZipStat *st;
@@ -107,7 +107,7 @@ compress_init(PushFilter * next, void *init_arg, void **priv_p)
 
 /* cant handle zero-len incoming data, but shouldnt */
 static int
-compress_process(PushFilter * next, void *priv, const uint8 *data, int len)
+compress_process(PushFilter *next, void *priv, const uint8 *data, int len)
 {
    int         res,
                n_out;
@@ -140,7 +140,7 @@ compress_process(PushFilter * next, void *priv, const uint8 *data, int len)
 }
 
 static int
-compress_flush(PushFilter * next, void *priv)
+compress_flush(PushFilter *next, void *priv)
 {
    int         res,
                zres,
@@ -185,7 +185,7 @@ static const PushFilterOps
 };
 
 int
-pgp_compress_filter(PushFilter ** res, PGP_Context * ctx, PushFilter * dst)
+pgp_compress_filter(PushFilter **res, PGP_Context *ctx, PushFilter *dst)
 {
    return pushf_create(res, &compress_filter, ctx, dst);
 }
@@ -204,7 +204,7 @@ struct DecomprData
 };
 
 static int
-decompress_init(void **priv_p, void *arg, PullFilter * src)
+decompress_init(void **priv_p, void *arg, PullFilter *src)
 {
    PGP_Context *ctx = arg;
    struct DecomprData *dec;
@@ -237,7 +237,7 @@ decompress_init(void **priv_p, void *arg, PullFilter * src)
 }
 
 static int
-decompress_read(void *priv, PullFilter * src, int len,
+decompress_read(void *priv, PullFilter *src, int len,
                uint8 **data_p, uint8 *buf, int buflen)
 {
    int         res;
@@ -308,20 +308,20 @@ static const PullFilterOps
 };
 
 int
-pgp_decompress_filter(PullFilter ** res, PGP_Context * ctx, PullFilter * src)
+pgp_decompress_filter(PullFilter **res, PGP_Context *ctx, PullFilter *src)
 {
    return pullf_create(res, &decompress_filter, ctx, src);
 }
 #else                          /* !HAVE_ZLIB */
 
 int
-pgp_compress_filter(PushFilter ** res, PGP_Context * ctx, PushFilter * dst)
+pgp_compress_filter(PushFilter **res, PGP_Context *ctx, PushFilter *dst)
 {
    return PXE_PGP_UNSUPPORTED_COMPR;
 }
 
 int
-pgp_decompress_filter(PullFilter ** res, PGP_Context * ctx, PullFilter * src)
+pgp_decompress_filter(PullFilter **res, PGP_Context *ctx, PullFilter *src)
 {
    return PXE_PGP_UNSUPPORTED_COMPR;
 }
index 77973a5c314e42028f8e49fe5aa62be5d8dae027..9df5c717f2b03ed0dac84c4b007691183e87370a 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.7 2005/11/22 18:17:04 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.8 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -49,7 +49,7 @@
 #define MAX_CHUNK (16*1024*1024)
 
 static int
-parse_new_len(PullFilter * src, int *len_p)
+parse_new_len(PullFilter *src, int *len_p)
 {
    uint8       b;
    int         len;
@@ -92,7 +92,7 @@ parse_new_len(PullFilter * src, int *len_p)
 }
 
 static int
-parse_old_len(PullFilter * src, int *len_p, int lentype)
+parse_old_len(PullFilter *src, int *len_p, int lentype)
 {
    uint8       b;
    int         len;
@@ -126,7 +126,7 @@ parse_old_len(PullFilter * src, int *len_p, int lentype)
 
 /* returns pkttype or 0 on eof */
 int
-pgp_parse_pkt_hdr(PullFilter * src, uint8 *tag, int *len_p, int allow_ctx)
+pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p, int allow_ctx)
 {
    int         lentype;
    int         res;
@@ -172,7 +172,7 @@ struct PktData
 };
 
 static int
-pktreader_pull(void *priv, PullFilter * src, int len,
+pktreader_pull(void *priv, PullFilter *src, int len,
               uint8 **data_p, uint8 *buf, int buflen)
 {
    int         res;
@@ -220,8 +220,8 @@ static struct PullFilterOps pktreader_filter = {
 
 /* needs helper function to pass several parameters */
 int
-pgp_create_pkt_reader(PullFilter ** pf_p, PullFilter * src, int len,
-                     int pkttype, PGP_Context * ctx)
+pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len,
+                     int pkttype, PGP_Context *ctx)
 {
    int         res;
    struct PktData *pkt = px_alloc(sizeof(*pkt));
@@ -239,7 +239,7 @@ pgp_create_pkt_reader(PullFilter ** pf_p, PullFilter * src, int len,
  */
 
 static int
-prefix_init(void **priv_p, void *arg, PullFilter * src)
+prefix_init(void **priv_p, void *arg, PullFilter *src)
 {
    PGP_Context *ctx = arg;
    int         len;
@@ -294,7 +294,7 @@ static struct PullFilterOps prefix_filter = {
  */
 
 static int
-decrypt_init(void **priv_p, void *arg, PullFilter * src)
+decrypt_init(void **priv_p, void *arg, PullFilter *src)
 {
    PGP_CFB    *cfb = arg;
 
@@ -305,7 +305,7 @@ decrypt_init(void **priv_p, void *arg, PullFilter * src)
 }
 
 static int
-decrypt_read(void *priv, PullFilter * src, int len,
+decrypt_read(void *priv, PullFilter *src, int len,
             uint8 **data_p, uint8 *buf, int buflen)
 {
    PGP_CFB    *cfb = priv;
@@ -331,7 +331,7 @@ struct PullFilterOps pgp_decrypt_filter = {
  */
 
 static int
-mdc_init(void **priv_p, void *arg, PullFilter * src)
+mdc_init(void **priv_p, void *arg, PullFilter *src)
 {
    PGP_Context *ctx = arg;
 
@@ -351,7 +351,7 @@ mdc_free(void *priv)
 }
 
 static int
-mdc_finish(PGP_Context * ctx, PullFilter * src,
+mdc_finish(PGP_Context *ctx, PullFilter *src,
           int len, uint8 **data_p)
 {
    int         res;
@@ -407,7 +407,7 @@ mdc_finish(PGP_Context * ctx, PullFilter * src,
 }
 
 static int
-mdc_read(void *priv, PullFilter * src, int len,
+mdc_read(void *priv, PullFilter *src, int len,
         uint8 **data_p, uint8 *buf, int buflen)
 {
    int         res;
@@ -460,7 +460,7 @@ struct MDCBufData
 };
 
 static int
-mdcbuf_init(void **priv_p, void *arg, PullFilter * src)
+mdcbuf_init(void **priv_p, void *arg, PullFilter *src)
 {
    PGP_Context *ctx = arg;
    struct MDCBufData *st;
@@ -520,7 +520,7 @@ mdcbuf_load_mdc(struct MDCBufData * st, uint8 *src, int len)
 }
 
 static int
-mdcbuf_refill(struct MDCBufData * st, PullFilter * src)
+mdcbuf_refill(struct MDCBufData * st, PullFilter *src)
 {
    uint8      *data;
    int         res;
@@ -564,7 +564,7 @@ mdcbuf_refill(struct MDCBufData * st, PullFilter * src)
 }
 
 static int
-mdcbuf_read(void *priv, PullFilter * src, int len,
+mdcbuf_read(void *priv, PullFilter *src, int len,
            uint8 **data_p, uint8 *buf, int buflen)
 {
    struct MDCBufData *st = priv;
@@ -606,7 +606,7 @@ static struct PullFilterOps mdcbuf_filter = {
  * Decrypt separate session key
  */
 static int
-decrypt_key(PGP_Context * ctx, const uint8 *src, int len)
+decrypt_key(PGP_Context *ctx, const uint8 *src, int len)
 {
    int         res;
    uint8       algo;
@@ -639,7 +639,7 @@ decrypt_key(PGP_Context * ctx, const uint8 *src, int len)
  * Handle key packet
  */
 static int
-parse_symenc_sesskey(PGP_Context * ctx, PullFilter * src)
+parse_symenc_sesskey(PGP_Context *ctx, PullFilter *src)
 {
    uint8      *p;
    int         res;
@@ -708,7 +708,7 @@ parse_symenc_sesskey(PGP_Context * ctx, PullFilter * src)
 }
 
 static int
-copy_crlf(MBuf * dst, uint8 *data, int len, int *got_cr)
+copy_crlf(MBuf *dst, uint8 *data, int len, int *got_cr)
 {
    uint8      *data_end = data + len;
    uint8       tmpbuf[1024];
@@ -757,7 +757,7 @@ copy_crlf(MBuf * dst, uint8 *data, int len, int *got_cr)
 }
 
 static int
-parse_literal_data(PGP_Context * ctx, MBuf * dst, PullFilter * pkt)
+parse_literal_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt)
 {
    int         type;
    int         name_len;
@@ -824,11 +824,11 @@ parse_literal_data(PGP_Context * ctx, MBuf * dst, PullFilter * pkt)
 }
 
 /* process_data_packets and parse_compressed_data call each other */
-static int process_data_packets(PGP_Context * ctx, MBuf * dst,
-                    PullFilter * src, int allow_compr, int need_mdc);
+static int process_data_packets(PGP_Context *ctx, MBuf *dst,
+                    PullFilter *src, int allow_compr, int need_mdc);
 
 static int
-parse_compressed_data(PGP_Context * ctx, MBuf * dst, PullFilter * pkt)
+parse_compressed_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt)
 {
    int         res;
    uint8       type;
@@ -868,7 +868,7 @@ parse_compressed_data(PGP_Context * ctx, MBuf * dst, PullFilter * pkt)
 }
 
 static int
-process_data_packets(PGP_Context * ctx, MBuf * dst, PullFilter * src,
+process_data_packets(PGP_Context *ctx, MBuf *dst, PullFilter *src,
                     int allow_compr, int need_mdc)
 {
    uint8       tag;
@@ -975,7 +975,7 @@ process_data_packets(PGP_Context * ctx, MBuf * dst, PullFilter * src,
 }
 
 static int
-parse_symenc_data(PGP_Context * ctx, PullFilter * pkt, MBuf * dst)
+parse_symenc_data(PGP_Context *ctx, PullFilter *pkt, MBuf *dst)
 {
    int         res;
    PGP_CFB    *cfb = NULL;
@@ -1009,7 +1009,7 @@ out:
 }
 
 static int
-parse_symenc_mdc_data(PGP_Context * ctx, PullFilter * pkt, MBuf * dst)
+parse_symenc_mdc_data(PGP_Context *ctx, PullFilter *pkt, MBuf *dst)
 {
    int         res;
    PGP_CFB    *cfb = NULL;
@@ -1061,7 +1061,7 @@ out:
  * skip over packet contents
  */
 int
-pgp_skip_packet(PullFilter * pkt)
+pgp_skip_packet(PullFilter *pkt)
 {
    int         res = 1;
    uint8      *tmp;
@@ -1075,7 +1075,7 @@ pgp_skip_packet(PullFilter * pkt)
  * expect to be at packet end, any data is error
  */
 int
-pgp_expect_packet_end(PullFilter * pkt)
+pgp_expect_packet_end(PullFilter *pkt)
 {
    int         res = 1;
    uint8      *tmp;
@@ -1093,7 +1093,7 @@ pgp_expect_packet_end(PullFilter * pkt)
 }
 
 int
-pgp_decrypt(PGP_Context * ctx, MBuf * msrc, MBuf * mdst)
+pgp_decrypt(PGP_Context *ctx, MBuf *msrc, MBuf *mdst)
 {
    int         res;
    PullFilter *src = NULL;
index e2c928154bbb64ef2f62d60ed53d069e035ec4a4..48f2f01f6297a138a8b36c9391294d68d814a8f4 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-encrypt.c,v 1.3 2005/10/15 02:49:06 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-encrypt.c,v 1.4 2009/06/11 14:48:52 momjian Exp $
  */
 
 #include "postgres.h"
@@ -66,7 +66,7 @@ render_newlen(uint8 *h, int len)
 }
 
 static int
-write_tag_only(PushFilter * dst, int tag)
+write_tag_only(PushFilter *dst, int tag)
 {
    uint8       hdr = 0xC0 | tag;
 
@@ -74,7 +74,7 @@ write_tag_only(PushFilter * dst, int tag)
 }
 
 static int
-write_normal_header(PushFilter * dst, int tag, int len)
+write_normal_header(PushFilter *dst, int tag, int len)
 {
    uint8       hdr[8];
    uint8      *h = hdr;
@@ -90,7 +90,7 @@ write_normal_header(PushFilter * dst, int tag, int len)
  */
 
 static int
-mdc_init(PushFilter * dst, void *init_arg, void **priv_p)
+mdc_init(PushFilter *dst, void *init_arg, void **priv_p)
 {
    int         res;
    PX_MD      *md;
@@ -104,7 +104,7 @@ mdc_init(PushFilter * dst, void *init_arg, void **priv_p)
 }
 
 static int
-mdc_write(PushFilter * dst, void *priv, const uint8 *data, int len)
+mdc_write(PushFilter *dst, void *priv, const uint8 *data, int len)
 {
    PX_MD      *md = priv;
 
@@ -113,7 +113,7 @@ mdc_write(PushFilter * dst, void *priv, const uint8 *data, int len)
 }
 
 static int
-mdc_flush(PushFilter * dst, void *priv)
+mdc_flush(PushFilter *dst, void *priv)
 {
    int         res;
    uint8       pkt[2 + MDC_DIGEST_LEN];
@@ -156,7 +156,7 @@ struct EncStat
 };
 
 static int
-encrypt_init(PushFilter * next, void *init_arg, void **priv_p)
+encrypt_init(PushFilter *next, void *init_arg, void **priv_p)
 {
    struct EncStat *st;
    PGP_Context *ctx = init_arg;
@@ -188,7 +188,7 @@ encrypt_init(PushFilter * next, void *init_arg, void **priv_p)
 }
 
 static int
-encrypt_process(PushFilter * next, void *priv, const uint8 *data, int len)
+encrypt_process(PushFilter *next, void *priv, const uint8 *data, int len)
 {
    int         res;
    struct EncStat *st = priv;
@@ -236,7 +236,7 @@ struct PktStreamStat
 };
 
 static int
-pkt_stream_init(PushFilter * next, void *init_arg, void **priv_p)
+pkt_stream_init(PushFilter *next, void *init_arg, void **priv_p)
 {
    struct PktStreamStat *st;
 
@@ -249,7 +249,7 @@ pkt_stream_init(PushFilter * next, void *init_arg, void **priv_p)
 }
 
 static int
-pkt_stream_process(PushFilter * next, void *priv, const uint8 *data, int len)
+pkt_stream_process(PushFilter *next, void *priv, const uint8 *data, int len)
 {
    int         res;
    uint8       hdr[8];
@@ -275,7 +275,7 @@ pkt_stream_process(PushFilter * next, void *priv, const uint8 *data, int len)
 }
 
 static int
-pkt_stream_flush(PushFilter * next, void *priv)
+pkt_stream_flush(PushFilter *next, void *priv)
 {
    int         res;
    uint8       hdr[8];
@@ -308,7 +308,7 @@ static const PushFilterOps pkt_stream_filter = {
 };
 
 int
-pgp_create_pkt_writer(PushFilter * dst, int tag, PushFilter ** res_p)
+pgp_create_pkt_writer(PushFilter *dst, int tag, PushFilter **res_p)
 {
    int         res;
 
@@ -324,7 +324,7 @@ pgp_create_pkt_writer(PushFilter * dst, int tag, PushFilter ** res_p)
  */
 
 static int
-crlf_process(PushFilter * dst, void *priv, const uint8 *data, int len)
+crlf_process(PushFilter *dst, void *priv, const uint8 *data, int len)
 {
    const uint8 *data_end = data + len;
    const uint8 *p2,
@@ -371,7 +371,7 @@ static const PushFilterOps crlf_filter = {
  * Initialize literal data packet
  */
 static int
-init_litdata_packet(PushFilter ** pf_res, PGP_Context * ctx, PushFilter * dst)
+init_litdata_packet(PushFilter **pf_res, PGP_Context *ctx, PushFilter *dst)
 {
    int         res;
    int         hdrlen;
@@ -426,7 +426,7 @@ init_litdata_packet(PushFilter ** pf_res, PGP_Context * ctx, PushFilter * dst)
  * Initialize compression filter
  */
 static int
-init_compress(PushFilter ** pf_res, PGP_Context * ctx, PushFilter * dst)
+init_compress(PushFilter **pf_res, PGP_Context *ctx, PushFilter *dst)
 {
    int         res;
    uint8       type = ctx->compress_algo;
@@ -454,7 +454,7 @@ init_compress(PushFilter ** pf_res, PGP_Context * ctx, PushFilter * dst)
  * Initialize encdata packet
  */
 static int
-init_encdata_packet(PushFilter ** pf_res, PGP_Context * ctx, PushFilter * dst)
+init_encdata_packet(PushFilter **pf_res, PGP_Context *ctx, PushFilter *dst)
 {
    int         res;
    int         tag;
@@ -475,7 +475,7 @@ init_encdata_packet(PushFilter ** pf_res, PGP_Context * ctx, PushFilter * dst)
  * write prefix
  */
 static int
-write_prefix(PGP_Context * ctx, PushFilter * dst)
+write_prefix(PGP_Context *ctx, PushFilter *dst)
 {
    uint8       prefix[PGP_MAX_BLOCK + 2];
    int         res,
@@ -499,7 +499,7 @@ write_prefix(PGP_Context * ctx, PushFilter * dst)
  */
 
 static int
-symencrypt_sesskey(PGP_Context * ctx, uint8 *dst)
+symencrypt_sesskey(PGP_Context *ctx, uint8 *dst)
 {
    int         res;
    PGP_CFB    *cfb;
@@ -519,7 +519,7 @@ symencrypt_sesskey(PGP_Context * ctx, uint8 *dst)
 
 /* 5.3: Symmetric-Key Encrypted Session-Key */
 static int
-write_symenc_sesskey(PGP_Context * ctx, PushFilter * dst)
+write_symenc_sesskey(PGP_Context *ctx, PushFilter *dst)
 {
    uint8       pkt[256];
    int         pktlen;
@@ -560,7 +560,7 @@ write_symenc_sesskey(PGP_Context * ctx, PushFilter * dst)
  * key setup
  */
 static int
-init_s2k_key(PGP_Context * ctx)
+init_s2k_key(PGP_Context *ctx)
 {
    int         res;
 
@@ -576,7 +576,7 @@ init_s2k_key(PGP_Context * ctx)
 }
 
 static int
-init_sess_key(PGP_Context * ctx)
+init_sess_key(PGP_Context *ctx)
 {
    int         res;
 
@@ -600,7 +600,7 @@ init_sess_key(PGP_Context * ctx)
  * combine
  */
 int
-pgp_encrypt(PGP_Context * ctx, MBuf * src, MBuf * dst)
+pgp_encrypt(PGP_Context *ctx, MBuf *src, MBuf *dst)
 {
    int         res;
    int         len;
index 9f887ec6d900ffb0af112b137ea56914ef3f4595..a51a553236f5b40580f8ccc2d1399c9b3bc9c814 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-info.c,v 1.4 2005/10/15 02:49:06 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-info.c,v 1.5 2009/06/11 14:48:52 momjian Exp $
  */
 #include "postgres.h"
 
@@ -35,7 +35,7 @@
 #include "pgp.h"
 
 static int
-read_pubkey_keyid(PullFilter * pkt, uint8 *keyid_buf)
+read_pubkey_keyid(PullFilter *pkt, uint8 *keyid_buf)
 {
    int         res;
    PGP_PubKey *pk = NULL;
@@ -68,7 +68,7 @@ err:
 }
 
 static int
-read_pubenc_keyid(PullFilter * pkt, uint8 *keyid_buf)
+read_pubenc_keyid(PullFilter *pkt, uint8 *keyid_buf)
 {
    uint8       ver;
    int         res;
@@ -109,7 +109,7 @@ static const uint8 any_key[] =
  * dst should have room for 17 bytes
  */
 int
-pgp_get_keyid(MBuf * pgp_data, char *dst)
+pgp_get_keyid(MBuf *pgp_data, char *dst)
 {
    int         res;
    PullFilter *src;
index d2b5d0c8de73ee0d88b7c31b738ca135ac5f540d..283946b17d215876d18f071a7cc10c9fba20bd8e 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-internal.c,v 1.7 2006/10/04 00:29:46 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-internal.c,v 1.8 2009/06/11 14:48:52 momjian Exp $
  */
 #include "postgres.h"
 
@@ -46,7 +46,7 @@ mp_new()
 }
 
 static void
-mp_clear_free(mpz_t * a)
+mp_clear_free(mpz_t *a)
 {
    if (!a)
        return;
@@ -56,7 +56,7 @@ mp_clear_free(mpz_t * a)
 
 
 static int
-mp_px_rand(uint32 bits, mpz_t * res)
+mp_px_rand(uint32 bits, mpz_t *res)
 {
    int         err;
    unsigned    bytes = (bits + 7) / 8;
@@ -88,7 +88,7 @@ mp_px_rand(uint32 bits, mpz_t * res)
 }
 
 static void
-mp_modmul(mpz_t * a, mpz_t * b, mpz_t * p, mpz_t * res)
+mp_modmul(mpz_t *a, mpz_t *b, mpz_t *p, mpz_t *res)
 {
    mpz_t      *tmp = mp_new();
 
@@ -98,7 +98,7 @@ mp_modmul(mpz_t * a, mpz_t * b, mpz_t * p, mpz_t * res)
 }
 
 static mpz_t *
-mpi_to_bn(PGP_MPI * n)
+mpi_to_bn(PGP_MPI *n)
 {
    mpz_t      *bn = mp_new();
 
@@ -117,7 +117,7 @@ mpi_to_bn(PGP_MPI * n)
 }
 
 static PGP_MPI *
-bn_to_mpi(mpz_t * bn)
+bn_to_mpi(mpz_t *bn)
 {
    int         res;
    PGP_MPI    *n;
@@ -164,8 +164,8 @@ decide_k_bits(int p_bits)
 }
 
 int
-pgp_elgamal_encrypt(PGP_PubKey * pk, PGP_MPI * _m,
-                   PGP_MPI ** c1_p, PGP_MPI ** c2_p)
+pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m,
+                   PGP_MPI **c1_p, PGP_MPI **c2_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    int         k_bits;
@@ -214,8 +214,8 @@ err:
 }
 
 int
-pgp_elgamal_decrypt(PGP_PubKey * pk, PGP_MPI * _c1, PGP_MPI * _c2,
-                   PGP_MPI ** msg_p)
+pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2,
+                   PGP_MPI **msg_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    mpz_t      *c1 = mpi_to_bn(_c1);
@@ -252,7 +252,7 @@ err:
 }
 
 int
-pgp_rsa_encrypt(PGP_PubKey * pk, PGP_MPI * _m, PGP_MPI ** c_p)
+pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    mpz_t      *m = mpi_to_bn(_m);
@@ -280,7 +280,7 @@ err:
 }
 
 int
-pgp_rsa_decrypt(PGP_PubKey * pk, PGP_MPI * _c, PGP_MPI ** m_p)
+pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    mpz_t      *c = mpi_to_bn(_c);
index 0e692e35d25e086c21a16f54113c47aa82867fe4..f2b25de0900710475408bbd37537e4c5e0417d5f 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-openssl.c,v 1.4 2005/10/15 02:49:06 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-openssl.c,v 1.5 2009/06/11 14:48:52 momjian Exp $
  */
 #include "postgres.h"
 
@@ -37,7 +37,7 @@
 #include "pgp.h"
 
 static BIGNUM *
-mpi_to_bn(PGP_MPI * n)
+mpi_to_bn(PGP_MPI *n)
 {
    BIGNUM     *bn = BN_bin2bn(n->data, n->bytes, NULL);
 
@@ -99,8 +99,8 @@ decide_k_bits(int p_bits)
 }
 
 int
-pgp_elgamal_encrypt(PGP_PubKey * pk, PGP_MPI * _m,
-                   PGP_MPI ** c1_p, PGP_MPI ** c2_p)
+pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m,
+                   PGP_MPI **c1_p, PGP_MPI **c2_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    int         k_bits;
@@ -162,8 +162,8 @@ err:
 }
 
 int
-pgp_elgamal_decrypt(PGP_PubKey * pk, PGP_MPI * _c1, PGP_MPI * _c2,
-                   PGP_MPI ** msg_p)
+pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2,
+                   PGP_MPI **msg_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    BIGNUM     *c1 = mpi_to_bn(_c1);
@@ -213,7 +213,7 @@ err:
 }
 
 int
-pgp_rsa_encrypt(PGP_PubKey * pk, PGP_MPI * _m, PGP_MPI ** c_p)
+pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    BIGNUM     *m = mpi_to_bn(_m);
@@ -249,7 +249,7 @@ err:
 }
 
 int
-pgp_rsa_decrypt(PGP_PubKey * pk, PGP_MPI * _c, PGP_MPI ** m_p)
+pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p)
 {
    int         res = PXE_PGP_MATH_FAILED;
    BIGNUM     *c = mpi_to_bn(_c);
index da0edb1361c951cb10a9f02c91e7cccad52909d2..3f2ec0f5c76cff2c3f94a8e0a0450cf0652943b5 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi.c,v 1.4 2005/10/15 02:49:06 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi.c,v 1.5 2009/06/11 14:48:52 momjian Exp $
  */
 #include "postgres.h"
 
@@ -35,7 +35,7 @@
 #include "pgp.h"
 
 int
-pgp_mpi_alloc(int bits, PGP_MPI ** mpi)
+pgp_mpi_alloc(int bits, PGP_MPI **mpi)
 {
    PGP_MPI    *n;
    int         len = (bits + 7) / 8;
@@ -54,7 +54,7 @@ pgp_mpi_alloc(int bits, PGP_MPI ** mpi)
 }
 
 int
-pgp_mpi_create(uint8 *data, int bits, PGP_MPI ** mpi)
+pgp_mpi_create(uint8 *data, int bits, PGP_MPI **mpi)
 {
    int         res;
    PGP_MPI    *n;
@@ -68,7 +68,7 @@ pgp_mpi_create(uint8 *data, int bits, PGP_MPI ** mpi)
 }
 
 int
-pgp_mpi_free(PGP_MPI * mpi)
+pgp_mpi_free(PGP_MPI *mpi)
 {
    if (mpi == NULL)
        return 0;
@@ -78,7 +78,7 @@ pgp_mpi_free(PGP_MPI * mpi)
 }
 
 int
-pgp_mpi_read(PullFilter * src, PGP_MPI ** mpi)
+pgp_mpi_read(PullFilter *src, PGP_MPI **mpi)
 {
    int         res;
    uint8       hdr[2];
@@ -103,7 +103,7 @@ pgp_mpi_read(PullFilter * src, PGP_MPI ** mpi)
 }
 
 int
-pgp_mpi_write(PushFilter * dst, PGP_MPI * n)
+pgp_mpi_write(PushFilter *dst, PGP_MPI *n)
 {
    int         res;
    uint8       buf[2];
@@ -117,7 +117,7 @@ pgp_mpi_write(PushFilter * dst, PGP_MPI * n)
 }
 
 int
-pgp_mpi_hash(PX_MD * md, PGP_MPI * n)
+pgp_mpi_hash(PX_MD *md, PGP_MPI *n)
 {
    uint8       buf[2];
 
@@ -130,7 +130,7 @@ pgp_mpi_hash(PX_MD * md, PGP_MPI * n)
 }
 
 unsigned
-pgp_mpi_cksum(unsigned cksum, PGP_MPI * n)
+pgp_mpi_cksum(unsigned cksum, PGP_MPI *n)
 {
    int         i;
 
index 5ffa5ad0a9a0a9f837f923580d6f02e982d14335..530a3d38d801a04fa0899faeee33a901285281d5 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pgsql.c,v 1.10 2008/05/04 16:42:41 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pgsql.c,v 1.11 2009/06/11 14:48:52