* Return 0 if okay (and set *tzp), a DTERR code if not okay.
*/
int
-DecodeTimezone(char *str, int *tzp)
+DecodeTimezone(const char *str, int *tzp)
{
int tz;
int hr,
* will be related in format.
*/
int
-DecodeTimezoneAbbrev(int field, char *lowtoken,
+DecodeTimezoneAbbrev(int field, const char *lowtoken,
int *offset, pg_tz **tz)
{
int type;
* will be related in format.
*/
int
-DecodeSpecial(int field, char *lowtoken, int *val)
+DecodeSpecial(int field, const char *lowtoken, int *val)
{
int type;
const datetkn *tp;
* will be related in format.
*/
int
-DecodeUnits(int field, char *lowtoken, int *val)
+DecodeUnits(int field, const char *lowtoken, int *val)
{
int type;
const datetkn *tp;
/* Use the specified time zone, if any. */
if (tm.tm_zone)
{
- int dterr = DecodeTimezone(unconstify(char *, tm.tm_zone), &tz);
+ int dterr = DecodeTimezone(tm.tm_zone, &tz);
if (dterr)
DateTimeParseError(dterr, text_to_cstring(date_txt), "timestamptz");
if (tm.tm_zone)
{
- int dterr = DecodeTimezone(unconstify(char *, tm.tm_zone), tz);
+ int dterr = DecodeTimezone(tm.tm_zone, tz);
if (dterr)
DateTimeParseError(dterr, text_to_cstring(date_txt), "timestamptz");
if (tm.tm_zone)
{
- int dterr = DecodeTimezone(unconstify(char *, tm.tm_zone), tz);
+ int dterr = DecodeTimezone(tm.tm_zone, tz);
if (dterr)
RETURN_ERROR(DateTimeParseError(dterr, text_to_cstring(date_txt), "timetz"));
extern int DecodeDateTime(char **field, int *ftype,
int nf, int *dtype,
struct pg_tm *tm, fsec_t *fsec, int *tzp);
-extern int DecodeTimezone(char *str, int *tzp);
+extern int DecodeTimezone(const char *str, int *tzp);
extern int DecodeTimeOnly(char **field, int *ftype,
int nf, int *dtype,
struct pg_tm *tm, fsec_t *fsec, int *tzp);
extern int ValidateDate(int fmask, bool isjulian, bool is2digits, bool bc,
struct pg_tm *tm);
-extern int DecodeTimezoneAbbrev(int field, char *lowtoken,
+extern int DecodeTimezoneAbbrev(int field, const char *lowtoken,
int *offset, pg_tz **tz);
-extern int DecodeSpecial(int field, char *lowtoken, int *val);
-extern int DecodeUnits(int field, char *lowtoken, int *val);
+extern int DecodeSpecial(int field, const char *lowtoken, int *val);
+extern int DecodeUnits(int field, const char *lowtoken, int *val);
extern int j2day(int date);