[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Missing get_date function




Hi.

I'm trying to compile a program I downloaded from the net, and I get
the message:

undefined reference to `get_date' 


I can't figure out where to get this function.

Can someone help me out here ?


Following is the source which references the function ...


/*
 * This file is a part of the mg project.
 * Copyright (C) 1998 Martin Gall
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as pub * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
/*
 *
 */

#include <time.h>
#include "layer.h"
#include "typ_msg.h"
#include "typ_time.h"

char			*ctime_without_nl(t)
time_t			*t;
{
  char			*result;

  result = ctime(t);
  result[strlen(result) - 1] = 0;
  return (result);
}

/* is a t_msg_proc.
   Manages unix time (32 bits). It uses the GNU get_date(3) 
   and ctime_without_nl(3) to resolve strings. */
t_status		typ_time_msg(msg,arg1,arg2)
t_msg			msg;
VOID_PTR		arg1;
VOID_PTR		arg2;
{
  t_status		status;

  switch (msg)
    {
      TYP_CLASS_GENERIC;
      TYP_NAME_GENERIC("time");
    case TYP_EXTRACT:
      {
	TYP_EXTRACT_ARGS(ed,bs);
	t_u32		u32;
	t_status	status;
	time_t		t;
	
	if (ed->b.len < sizeof (t_u32))
	  return (-ERR_TRUNC);
	FBCOPY(ed->b.buf,&u32,sizeof (t_u32));
#ifdef NOTDEF
	u32 = ntohs(u32);
#endif
	t = u32;
	return (str_cat_str(bs->str,
			    bs->max_len,
			    ctime_without_nl(&t)));
      }
    case TYP_INSERT:
      {
	TYP_INSERT_ARGS(ed,str);
	t_u32		u32;
	t_status	status;	
	time_t		t;

	if (ed->b.len < sizeof (u32))
	  return (-ERR_TRUNC);
	if ((t = get_date(str,NULL)) < 0)
	  return (-ERR_MALFORMED);
	u32 = t;
#ifdef NOTDEF
	u32 = htons(u32);
#endif
	FBCOPY(&u32,ed->b.buf,sizeof (u32));
	return (0);
      }
    }
  return (-ERR_NOMETHOD);
}	



does anyone know on how to make a C program print it's compile
date and time (without writing the date string by hand ever compile) ?

I a
regards
erez.




-- 
  The day is short, and the work is great,     |   Aharon Schkolnik
  and the laborers are lazy, and the reward    |   Aharon@Deltathree.com
  is great, and the Master of the house is     |   +972 2 649 1241
  impatient. - Ethics Of The Fathers Ch. 2     |