diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
commit | d31084e9d1118b25fd16580d9d8c2924b5740dff (patch) | |
tree | 3179e66307d54df9c7b966543550e601eb55e668 /src/backend/utils/adt/dt.c | |
download | postgresql-PG95-1_01.tar.gz postgresql-PG95-1_01.zip |
Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01
Diffstat (limited to 'src/backend/utils/adt/dt.c')
-rw-r--r-- | src/backend/utils/adt/dt.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/backend/utils/adt/dt.c b/src/backend/utils/adt/dt.c new file mode 100644 index 00000000000..bc162427d28 --- /dev/null +++ b/src/backend/utils/adt/dt.c @@ -0,0 +1,58 @@ +/*------------------------------------------------------------------------- + * + * dt.c-- + * Functions for the built-in type "dt". + * + * Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.1.1.1 1996/07/09 06:22:04 scrappy Exp $ + * + *------------------------------------------------------------------------- + */ +#include "c.h" +#include "utils/palloc.h" +#include "utils/builtins.h" /* where function declarations go */ + + +/***************************************************************************** + * USER I/O ROUTINES * + *****************************************************************************/ + +/* + * dtin - converts "nseconds" to internal representation + * + * XXX Currently, just creates an integer. + */ +int32 dtin(char *datetime) +{ + if (datetime == NULL) + return((int32) 0); + return((int32) atol(datetime)); +} + +/* + * dtout - converts internal form to "..." + * + * XXX assumes sign, 10 digits max, '\0' + */ +char *dtout(int32 datetime) +{ + char *result; + + result = (char *) palloc(12); + Assert(result); + ltoa(datetime, result); + return(result); +} + +/***************************************************************************** + * PUBLIC ROUTINES * + *****************************************************************************/ +/* (see int.c for comparison/operation routines) */ + +/***************************************************************************** + * PRIVATE ROUTINES * + *****************************************************************************/ +/* (none) */ |