Move atooid() definition to a central place

This commit is contained in:
Peter Eisentraut 2017-03-01 11:55:28 -05:00
parent b5a388392d
commit 788af6f854
12 changed files with 4 additions and 23 deletions

View File

@ -14,8 +14,6 @@
PG_MODULE_MAGIC;
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
/*
* This is the trigger that protects us from orphaned large objects

View File

@ -24,8 +24,6 @@
#include "libpq-fe.h"
#include "pg_getopt.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
#define BUFSIZE 1024
enum trivalue

View File

@ -51,8 +51,6 @@
#include "tcop/dest.h"
#include "utils/rel.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
/*
* Bison doesn't allocate anything that needs to live across parser calls,

View File

@ -52,9 +52,6 @@
#endif
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
#define atoxid(x) ((TransactionId) strtoul((x), NULL, 10))
#define MAX_TOKEN 256
#define MAX_LINE 8192

View File

@ -164,8 +164,6 @@
*/
#define atoui(x) ((unsigned int) strtoul((x), NULL, 10))
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
#define strtobool(x) ((*(x) == 't') ? true : false)
#define nullable_string(token,length) \

View File

@ -44,8 +44,6 @@
#include "utils/builtins.h"
#include "utils/timestamp.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
/*
* Common subroutine for num_nulls() and num_nonnulls().

View File

@ -39,8 +39,6 @@
#include "streamutil.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
typedef struct TablespaceListCell
{
struct TablespaceListCell *next;

View File

@ -97,8 +97,6 @@ extern char *output_files[];
#define CLUSTER_NAME(cluster) ((cluster) == &old_cluster ? "old" : \
(cluster) == &new_cluster ? "new" : "none")
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
/* OID system catalog preservation added during PG 9.0 development */
#define TABLE_SPACE_SUBDIRS_CAT_VER 201001111
/* postmaster/postgres -b (binary_upgrade) flag added during PG 9.1 development */

View File

@ -13,8 +13,6 @@
#include "libpq-fe.h"
#include "fe_utils/print.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
extern bool openQueryOutputFile(const char *fname, FILE **fout, bool *is_pipe);
extern bool setQFout(const char *fname);

View File

@ -14,8 +14,6 @@
#include "common.h"
#include "fe_utils/print.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
static void help(const char *progname);

View File

@ -19,8 +19,6 @@
#include "libpq-fe.h"
#include "pqexpbuffer.h"
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
/* Global variables controlling behavior of fmtId() and fmtQualifiedId() */
extern int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);

View File

@ -39,6 +39,10 @@ typedef unsigned int Oid;
#define OID_MAX UINT_MAX
/* you will need to include <limits.h> to use the above #define */
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
/* the above needs <stdlib.h> */
/* Define a signed 64-bit integer type for use in client API declarations. */
typedef PG_INT64_TYPE pg_int64;