PostgreSQL Source Code  git master
formatting.h
Go to the documentation of this file.
1 /* -----------------------------------------------------------------------
2  * formatting.h
3  *
4  * src/include/utils/formatting.h
5  *
6  *
7  * Portions Copyright (c) 1999-2022, PostgreSQL Global Development Group
8  *
9  * The PostgreSQL routines for a DateTime/int/float/numeric formatting,
10  * inspired by the Oracle TO_CHAR() / TO_DATE() / TO_NUMBER() routines.
11  *
12  * Karel Zak
13  *
14  * -----------------------------------------------------------------------
15  */
16 
17 #ifndef _FORMATTING_H_
18 #define _FORMATTING_H_
19 
20 #define DCH_DATED 0x01
21 #define DCH_TIMED 0x02
22 #define DCH_ZONED 0x04
23 
24 extern char *str_tolower(const char *buff, size_t nbytes, Oid collid);
25 extern char *str_toupper(const char *buff, size_t nbytes, Oid collid);
26 extern char *str_initcap(const char *buff, size_t nbytes, Oid collid);
27 
28 extern char *asc_tolower(const char *buff, size_t nbytes);
29 extern char *asc_toupper(const char *buff, size_t nbytes);
30 extern char *asc_initcap(const char *buff, size_t nbytes);
31 
32 extern Datum parse_datetime(text *date_txt, text *fmt, Oid collid, bool strict,
33  Oid *typid, int32 *typmod, int *tz,
34  bool *have_error);
35 extern int datetime_format_flags(const char *fmt_str, bool *have_error);
36 
37 #endif
signed int int32
Definition: c.h:429
char * asc_initcap(const char *buff, size_t nbytes)
Definition: formatting.c:2105
Datum parse_datetime(text *date_txt, text *fmt, Oid collid, bool strict, Oid *typid, int32 *typmod, int *tz, bool *have_error)
Definition: formatting.c:4324
char * asc_toupper(const char *buff, size_t nbytes)
Definition: formatting.c:2082
int datetime_format_flags(const char *fmt_str, bool *have_error)
Definition: formatting.c:6716
char * str_initcap(const char *buff, size_t nbytes, Oid collid)
Definition: formatting.c:1912
char * str_toupper(const char *buff, size_t nbytes, Oid collid)
Definition: formatting.c:1790
char * asc_tolower(const char *buff, size_t nbytes)
Definition: formatting.c:2059
char * str_tolower(const char *buff, size_t nbytes, Oid collid)
Definition: formatting.c:1668
static void const char * fmt
uintptr_t Datum
Definition: postgres.h:411
unsigned int Oid
Definition: postgres_ext.h:31
Definition: c.h:622