extern void PGTYPESdate_mdyjul(int *, date *);
extern int PGTYPESdate_dayofweek(date);
extern void PGTYPESdate_today(date *);
-extern int PGTYPESdate_defmt_asc(date *, char *, char *);
-extern int PGTYPESdate_fmt_asc(date, char *, char *);
+extern int PGTYPESdate_defmt_asc(date *, const char *, char *);
+extern int PGTYPESdate_fmt_asc(date, const char *, char *);
#ifdef __cplusplus
}
extern timestamp PGTYPEStimestamp_from_asc(char *, char **);
extern char *PGTYPEStimestamp_to_asc(timestamp);
extern int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *);
-extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, char *);
+extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, const char *);
extern void PGTYPEStimestamp_current(timestamp *);
-extern int PGTYPEStimestamp_defmt_asc(char *, char *, timestamp *);
+extern int PGTYPEStimestamp_defmt_asc(char *, const char *, timestamp *);
extern int PGTYPEStimestamp_add_interval(timestamp * tin, interval * span, timestamp * tout);
extern int PGTYPEStimestamp_sub_interval(timestamp * tin, interval * span, timestamp * tout);
}
char *
-pgtypes_strdup(char *str)
+pgtypes_strdup(const char *str)
{
char *new = (char *) strdup(str);
#define PGTYPES_FMTDATE_YEAR_DIGITS_LONG 6
int
-PGTYPESdate_fmt_asc(date dDate, char *fmtstring, char *outbuf)
+PGTYPESdate_fmt_asc(date dDate, const char *fmtstring, char *outbuf)
{
static struct
{
#define PGTYPES_DATE_MONTH_MAXLENGTH 20 /* probably even less :-) */
int
-PGTYPESdate_defmt_asc(date * d, char *fmt, char *str)
+PGTYPESdate_defmt_asc(date * d, const char *fmt, char *str)
{
/*
* token[2] = { 4,6 } means that token 2 starts at position 4 and ends at
int pgtypes_fmt_replace(union un_fmt_comb, int, char **, int *);
char *pgtypes_alloc(long);
-char *pgtypes_strdup(char *);
+char *pgtypes_strdup(const char *);
#ifndef bool
#define bool char
#include "pgtypes_date.h"
-int PGTYPEStimestamp_defmt_scan(char **, char *, timestamp *, int *, int *, int *,
+int PGTYPEStimestamp_defmt_scan(char **, const char *, timestamp *, int *, int *, int *,
int *, int *, int *, int *);
#ifdef HAVE_INT64_TIMESTAMP
static int
dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
- char *output, int *pstr_len, char *fmtstr)
+ char *output, int *pstr_len, const char *fmtstr)
{
union un_fmt_comb replace_val;
int replace_type;
int i;
- char *p = fmtstr;
+ const char *p = fmtstr;
char *q = output;
while (*p)
int
-PGTYPEStimestamp_fmt_asc(timestamp * ts, char *output, int str_len, char *fmtstr)
+PGTYPEStimestamp_fmt_asc(timestamp * ts, char *output, int str_len, const char *fmtstr)
{
struct tm tm;
fsec_t fsec;
}
int
-PGTYPEStimestamp_defmt_asc(char *str, char *fmt, timestamp * d)
+PGTYPEStimestamp_defmt_asc(char *str, const char *fmt, timestamp * d)
{
int year,
month,