blob: 2ac33db306c63d77cd0759988c33a6b45a67043a (
plain) (
blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
/******************************************************************************
* Copyright (C) 2015 Alejandro Colomar Andrés *
* SPDX-License-Identifier: GPL-2.0-only *
******************************************************************************/
/******************************************************************************
******* headers **************************************************************
******************************************************************************/
#include "mine-sweeper/about/about.h"
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#define ALX_NO_PREFIX
#include <libalx/base/compiler/size.h>
#include <libalx/base/errno/error.h>
#include <libalx/base/stdio/printf/sbprintf.h>
/******************************************************************************
******* macros ***************************************************************
******************************************************************************/
#define SHARE_DIR "" INSTALL_SHARE_DIR "/mine-sweeper/"
#define SHARE_COPYRIGHT_FILE "" SHARE_DIR "/COPYRIGHT.txt"
#define SHARE_DISCLAIMER_FILE "" SHARE_DIR "/DISCLAIMER.txt"
#define SHARE_HELP_FILE "" SHARE_DIR "/HELP.txt"
#define SHARE_LICENSE_FILE "" SHARE_DIR "/LICENSE.txt"
#define SHARE_USAGE_FILE "" SHARE_DIR "/USAGE.txt"
/******************************************************************************
******* enums ****************************************************************
******************************************************************************/
/******************************************************************************
******* structs / unions *****************************************************
******************************************************************************/
/******************************************************************************
******* variables ************************************************************
******************************************************************************/
/******************************************************************************
******* static functions (prototypes) ****************************************
******************************************************************************/
/******************************************************************************
******* global functions *****************************************************
******************************************************************************/
void print_share_file (int file)
{
char *fname;
char cmd[_POSIX_ARG_MAX];
switch (file) {
case SHARE_COPYRIGHT:
fname = SHARE_COPYRIGHT_FILE;
break;
case SHARE_DISCLAIMER:
fname = SHARE_DISCLAIMER_FILE;
break;
case SHARE_HELP:
fname = SHARE_HELP_FILE;
break;
case SHARE_LICENSE:
fname = SHARE_LICENSE_FILE;
break;
case SHARE_USAGE:
fname = SHARE_USAGE_FILE;
break;
}
if (sbprintf(cmd, NULL, "less %s", fname))
goto err;
if (system(cmd))
goto err;
return;
err:
perrorx(fname);
}
void print_version (void)
{
printf("%s %s\n\n", program_invocation_short_name, PROG_VERSION);
}
/******************************************************************************
******* static functions (definitions) ***************************************
******************************************************************************/
/******************************************************************************
******* end of file **********************************************************
******************************************************************************/
|