File: ntp_libopts.c

package info (click to toggle)
ntp 1%3A4.2.8p12%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 32,472 kB
  • sloc: ansic: 240,078; sh: 6,859; makefile: 3,369; perl: 2,765; python: 1,486; yacc: 1,451; ruby: 817; awk: 417; sed: 47; asm: 37
file content (58 lines) | stat: -rw-r--r-- 1,297 bytes parent folder | download | duplicates (3)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * ntp_libopts.c
 *
 * Common code interfacing with Autogen's libopts command-line option
 * processing.
 */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <stdio.h>
#include <stddef.h>
#include "ntp_libopts.h"
#include "ntp_stdlib.h"

extern const char *Version;	/* version.c for each program */


/*
 * ntpOptionProcess() was a clone of libopts' optionProcess which
 * overrode the --version output, appending detail from version.c
 * which was not available at Autogen time.  This is now done via
 * AutoOpts' version-proc = override in copyright.def, so this
 * routine is a straightforward wrapper of optionProcess().
 */
int
ntpOptionProcess(
	tOptions *	pOpts,
	int		argc,
	char **		argv
	)
{
	return optionProcess(pOpts, argc, argv);
}


/*
 * ntpOptionPrintVersion() replaces the stock optionPrintVersion() via
 * version-proc = ntpOptionPrintVersion; in copyright.def.  It differs
 * from the stock function by displaying the complete version string,
 * including compile time which was unknown when Autogen ran.
 *
 * Like optionPrintVersion() this function must exit(0) rather than
 * return.
 */
void
ntpOptionPrintVersion(
	tOptions *	pOpts,
	tOptDesc *	pOD
	)
{
	UNUSED_ARG(pOpts);
	UNUSED_ARG(pOD);

	printf("%s\n", Version);
	fflush(stdout);
	exit(EXIT_SUCCESS);
}