Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9f5185cf
Commit
9f5185cf
authored
Sep 07, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove common.c, removed in Karal's patch.
parent
377d131b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
99 deletions
+0
-99
src/backend/utils/mb/common.c
src/backend/utils/mb/common.c
+0
-99
No files found.
src/backend/utils/mb/common.c
deleted
100644 → 0
View file @
377d131b
/*
* This file contains some public functions
* usable for both the backend and the frontend.
* Tatsuo Ishii
* $Id: common.c,v 1.13 2001/04/16 02:42:01 tgl Exp $
*/
#include "postgres.h"
#ifdef WIN32
#include "win32.h"
#else
#include <unistd.h>
#endif
#include "miscadmin.h"
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
#ifndef FRONTEND
/*
* convert encoding char to encoding symbol value.
* case is ignored.
* if there's no valid encoding, returns -1
*/
int
pg_char_to_encoding
(
const
char
*
s
)
{
pg_encoding_conv_tbl
*
p
=
pg_conv_tbl
;
if
(
!
s
)
return
(
-
1
);
for
(;
p
->
encoding
>=
0
;
p
++
)
{
if
(
!
strcasecmp
(
s
,
p
->
name
))
break
;
}
return
(
p
->
encoding
);
}
/* Same, as an fmgr-callable function */
Datum
PG_char_to_encoding
(
PG_FUNCTION_ARGS
)
{
Name
s
=
PG_GETARG_NAME
(
0
);
PG_RETURN_INT32
(
pg_char_to_encoding
(
NameStr
(
*
s
)));
}
/*
* check to see if encoding name is valid
*/
int
pg_valid_client_encoding
(
const
char
*
name
)
{
return
(
pg_char_to_encoding
(
name
));
}
/*
* find encoding table entry by encoding
*/
pg_encoding_conv_tbl
*
pg_get_encent_by_encoding
(
int
encoding
)
{
pg_encoding_conv_tbl
*
p
=
pg_conv_tbl
;
for
(;
p
->
encoding
>=
0
;
p
++
)
{
if
(
p
->
encoding
==
encoding
)
return
(
p
);
}
return
(
0
);
}
/*
* convert encoding symbol to encoding char.
* if there's no valid encoding symbol, returns ""
*/
const
char
*
pg_encoding_to_char
(
int
encoding
)
{
pg_encoding_conv_tbl
*
p
=
pg_get_encent_by_encoding
(
encoding
);
if
(
!
p
)
return
(
""
);
return
(
p
->
name
);
}
/* Same, as an fmgr-callable function */
Datum
PG_encoding_to_char
(
PG_FUNCTION_ARGS
)
{
int32
encoding
=
PG_GETARG_INT32
(
0
);
const
char
*
encoding_name
=
pg_encoding_to_char
(
encoding
);
return
DirectFunctionCall1
(
namein
,
CStringGetDatum
(
encoding_name
));
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment