File: history.c

package info (click to toggle)
fitsh 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,768 kB
  • ctags: 4,050
  • sloc: ansic: 53,352; makefile: 1,120; sh: 25
file content (40 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*****************************************************************************/
/* history.c								     */
/*****************************************************************************/

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>

#include <fits/fits.h>

#include "fitsh.h"
#include "history.h"

/*****************************************************************************/

int fits_history_export_command_line(fits *img,char *prg,char *vrs,int argc,char *argv[])
{
 char	buff[64];
 time_t	t;
 struct	tm	*tm;

 time(&t);
 tm=localtime(&t);

 sprintf(buff,"%s: %s [%s@%s] %.4d.%.2d.%.2d %.2d:%.2d:%.2d (%s)",
	prg,vrs,FITSH_VERSION,FITSH_RELEASE_DATE,
	tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,
	tm->tm_hour,tm->tm_min,tm->tm_sec,
	(!daylight?tzname[0]:tzname[1]));
 fits_header_export_command_line(img,"FI_HSTRY",buff,"> ",argc,argv);

 return(0);
}

/*****************************************************************************/