head	1.6;
access;
symbols
	Version_2_1:1.6
	C_Demo_1:1.3;
locks; strict;
comment	@ * @;


1.6
date	91.02.28.20.55.53;	author mao;	state Exp;
branches;
next	1.5;

1.5
date	90.09.25.16.49.09;	author kemnitz;	state Exp;
branches;
next	1.4;

1.4
date	89.09.21.19.00.00;	author hirohama;	state Exp;
branches;
next	1.3;

1.3
date	89.09.05.17.26.05;	author mao;	state C_Demo_1;
branches;
next	1.2;

1.2
date	89.02.02.16.10.44;	author aoki;	state Stab;
branches;
next	1.1;

1.1
date	89.01.17.05.58.32;	author cimarron;	state Exp;
branches;
next	;


desc
@@


1.6
log
@typecast calls to palloc
@
text
@/*
 * dt.c --
 * 	Functions for the built-in type "dt".
 */

#include "tmp/c.h"

RcsId("$Header: RCS/dt.c,v 1.5 90/09/25 16:49:09 kemnitz Exp Locker: mao $");

#include "utils/palloc.h"


	    /* ========== USER I/O ROUTINES ========== */

/*
 *	dtin		- converts "nseconds" to internal representation
 *
 *	XXX Should probably take some for other than just nseconds.
 */
int32
dtin(datetime)
	char	*datetime;
{
	extern long	atol();

	if (datetime == NULL)
		return((int32) NULL);
	return((int32) atol(datetime));
}

/*
 *	dtout		- converts internal form to "..."
 *
 *	XXX Currently, just creates an integer.
 */
char *
dtout(datetime)
	int32	datetime;
{
	char		*result;
	extern int	ltoa();

	result = (char *) palloc(12);	/* assumes sign, 10 digits max, '\0' */
	ltoa((long) datetime, result);
	return(result);
}


	     /* ========== PUBLIC ROUTINES ========== */

	 /* (see int.c for comparison/operation routines) */


	     /* ========== PRIVATE ROUTINES ========== */

			     /* (none) */
@


1.5
log
@Updating from revision 1.4 to revision 1.5
@
text
@d8 1
a8 1
RcsId("$Header: RCS/dt.c,v 1.5 90/08/15 08:19:32 cimarron Exp $");
d43 1
a43 1
	result = palloc(12);	/* assumes sign, 10 digits max, '\0' */
@


1.4
log
@palloc defined in "palloc.h" not "postgres.h"
@
text
@d6 1
a6 1
#include "c.h"
d8 1
a8 1
RcsId("$Header: RCS/dt.c,v 1.3 89/09/05 17:26:05 mao C_Demo_1 Locker: hirohama $");
d10 1
a10 1
#include "palloc.h"
@


1.3
log
@Working version of C-only demo
@
text
@a6 1
#include "postgres.h"
d8 1
a8 1
RcsId("$Header: /usr6/postgres/mao/postgres/src/utils/adt/RCS/dt.c,v 1.2 89/02/02 16:10:44 aoki Stab $");
d10 1
d12 1
a13 1

@


1.2
log
@MERGE WITH OLD TREE
@
text
@d9 1
a9 1
RcsId("$Header: dt.c,v 1.1 88/06/26 23:10:43 aoki Locked $");
@


1.1
log
@Initial revision
@
text
@a0 1

a1 26
 * 
 * POSTGRES Data Base Management System
 * 
 * Copyright (c) 1988 Regents of the University of California
 * 
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for educational, research, and non-profit purposes and
 * without fee is hereby granted, provided that the above copyright
 * notice appear in all copies and that both that copyright notice and
 * this permission notice appear in supporting documentation, and that
 * the name of the University of California not be used in advertising
 * or publicity pertaining to distribution of the software without
 * specific, written prior permission.  Permission to incorporate this
 * software into commercial products can be obtained from the Campus
 * Software Office, 295 Evans Hall, University of California, Berkeley,
 * Ca., 94720 provided only that the the requestor give the University
 * of California a free licence to any derived software for educational
 * and research purposes.  The University of California makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 * 
 */



/*
d9 1
a9 1
RcsId("$Header: dt.c,v 1.1 88/11/11 16:35:43 postgres Exp $");
@
