From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- noao/imred/quadred/src/quad/timelog.x | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 noao/imred/quadred/src/quad/timelog.x (limited to 'noao/imred/quadred/src/quad/timelog.x') diff --git a/noao/imred/quadred/src/quad/timelog.x b/noao/imred/quadred/src/quad/timelog.x new file mode 100644 index 00000000..7a8d969f --- /dev/null +++ b/noao/imred/quadred/src/quad/timelog.x @@ -0,0 +1,29 @@ +include + + +# TIMELOG -- Prepend a time stamp to the given string. +# +# For the purpose of a history logging prepend a short time stamp to the +# given string. Note that the input string is modified. + +procedure timelog (str, max_char) + +char str[max_char] # String to be time stamped +int max_char # Maximum characters in string + +pointer sp, time, temp +long clktime() + +begin + call smark (sp) + call salloc (time, SZ_DATE, TY_CHAR) + call salloc (temp, max_char, TY_CHAR) + + call cnvdate (clktime(0), Memc[time], SZ_DATE) + call sprintf (Memc[temp], max_char, "%s %s") + call pargstr (Memc[time]) + call pargstr (str) + call strcpy (Memc[temp], str, max_char) + + call sfree (sp) +end -- cgit