library: remove procps_version functions
It doesn't make any sense to have the binary version strings embedded into the library. The version strings are defined already either in the Makefile or in include/c.h
This commit is contained in:
parent
6577371919
commit
505f257a8c
1
pgrep.c
1
pgrep.c
@ -53,7 +53,6 @@
|
||||
#include "proc/sig.h"
|
||||
#include "proc/devname.h"
|
||||
#include "proc/sysinfo.h"
|
||||
#include "proc/version.h" /* procps_version */
|
||||
|
||||
static int i_am_pkill = 0;
|
||||
|
||||
|
@ -4,7 +4,6 @@ global:
|
||||
closeproc;
|
||||
cpuinfo;
|
||||
dev_to_tty;
|
||||
display_version;
|
||||
escape_command;
|
||||
escape_str;
|
||||
escape_strlist;
|
||||
@ -47,7 +46,6 @@ global:
|
||||
page_bytes;
|
||||
pretty_print_signals;
|
||||
print_uptime;
|
||||
procps_version;
|
||||
put_slabinfo;
|
||||
readeither;
|
||||
readproc;
|
||||
|
@ -24,12 +24,6 @@
|
||||
#include <stdlib.h>
|
||||
#include "version.h"
|
||||
|
||||
const char procps_version[] = PACKAGE_NAME " version " PACKAGE_VERSION;
|
||||
|
||||
void display_version(void) {
|
||||
fprintf(stdout, "%s\n", procps_version);
|
||||
}
|
||||
|
||||
/* Linux kernel version information for procps-ng utilities
|
||||
* Copyright (c) 1996 Charles Blake <cblake@bbn.com>
|
||||
*/
|
||||
|
@ -15,8 +15,6 @@
|
||||
EXTERN_C_BEGIN
|
||||
|
||||
void init_Linux_version(void); /* Get Linux version */
|
||||
extern void display_version(void); /* display suite version */
|
||||
extern const char procps_version[]; /* global buf for suite version */
|
||||
|
||||
extern int linux_version_code; /* runtime version of LINUX_VERSION_CODE
|
||||
in /usr/include/linux/version.h */
|
||||
|
@ -55,7 +55,7 @@ static void signal_handler(int signo){
|
||||
signo,
|
||||
signal_number_to_name(signo),
|
||||
myname,
|
||||
procps_version
|
||||
PACKAGE_VERSION
|
||||
);
|
||||
switch (signo) {
|
||||
case SIGHUP:
|
||||
|
@ -479,7 +479,7 @@ void self_info(void){
|
||||
sysv_l_format ? sysv_l_format : "(none)"
|
||||
);
|
||||
|
||||
display_version();
|
||||
fprintf(stderr, "%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
fprintf(stderr, "Linux version %d.%d.%d\n",
|
||||
LINUX_VERSION_MAJOR(linux_version_code),
|
||||
LINUX_VERSION_MINOR(linux_version_code),
|
||||
|
13
ps/parser.c
13
ps/parser.c
@ -32,9 +32,9 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "../proc/alloc.h"
|
||||
#include "../proc/version.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "c.h"
|
||||
|
||||
#define ARG_GNU 0
|
||||
#define ARG_END 1
|
||||
@ -58,6 +58,11 @@ static int force_bsd = 0; /* set when normal parsing fails */
|
||||
return _("the option is exclusive: " x)
|
||||
|
||||
/********** utility functions **********/
|
||||
static void display_ps_version(void)
|
||||
{
|
||||
fprintf(stdout, PROCPS_NG_VERSION);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Both "-Oppid" and "-O ppid" should be legal, though Unix98
|
||||
@ -341,7 +346,7 @@ static const char *parse_sysv_option(void){
|
||||
case 'V': /* single */
|
||||
trace("-V prints version\n");
|
||||
exclusive("-V");
|
||||
display_version();
|
||||
display_ps_version();
|
||||
exit(0);
|
||||
// This must be verified against SVR4-MP. (UnixWare or Powermax)
|
||||
// Leave it undocumented until that problem is solved.
|
||||
@ -610,7 +615,7 @@ static const char *parse_bsd_option(void){
|
||||
case 'V': /* single */
|
||||
trace("V show version info\n");
|
||||
exclusive("V");
|
||||
display_version();
|
||||
display_ps_version();
|
||||
exit(0);
|
||||
case 'W':
|
||||
trace("W N/A get swap info from ... not /dev/drum.\n");
|
||||
@ -1029,7 +1034,7 @@ static const char *parse_gnu_option(void){
|
||||
case_version:
|
||||
trace("--version\n");
|
||||
exclusive("--version");
|
||||
display_version();
|
||||
display_ps_version();
|
||||
exit(0);
|
||||
return NULL;
|
||||
case_context:
|
||||
|
@ -445,7 +445,7 @@ static void bye_bye (const char *str) {
|
||||
, LINUX_VERSION_MAJOR(linux_version_code)
|
||||
, LINUX_VERSION_MINOR(linux_version_code)
|
||||
, LINUX_VERSION_PATCH(linux_version_code)
|
||||
, procps_version
|
||||
, PACKAGE_STRING
|
||||
, (unsigned)Hertz, (unsigned)sizeof(Hertz), (unsigned)sizeof(Hertz) * 8
|
||||
, (int)page_bytes, Cpu_faux_tot, (int)smp_num_cpus, (unsigned)sizeof(CPU_t)
|
||||
, (unsigned)sizeof(HST_t), ((int)page_bytes / (int)sizeof(HST_t)), HHist_siz
|
||||
@ -3696,7 +3696,7 @@ static void parse_args (char **args) {
|
||||
case 'h':
|
||||
case 'v':
|
||||
puts(fmtmk(N_fmt(HELP_cmdline_fmt)
|
||||
, procps_version, Myname, N_txt(USAGE_abbrev_txt)));
|
||||
, PACKAGE_STRING, Myname, N_txt(USAGE_abbrev_txt)));
|
||||
bye_bye(NULL);
|
||||
case 'i':
|
||||
TOGw(Curwin, Show_IDLEPS);
|
||||
@ -3975,7 +3975,7 @@ signify_that:
|
||||
putp(Cap_home);
|
||||
// this string is well above ISO C89's minimum requirements!
|
||||
show_special(1, fmtmk(N_unq(COLOR_custom_fmt)
|
||||
, procps_version, w->grpname
|
||||
, PACKAGE_STRING, w->grpname
|
||||
, CHKw(w, View_NOBOLD) ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt)
|
||||
, CHKw(w, Show_COLORS) ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt)
|
||||
, CHKw(w, Show_HIBOLD) ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt)
|
||||
@ -4219,7 +4219,7 @@ signify_that:
|
||||
adj_geometry();
|
||||
|
||||
show_special(1, fmtmk(N_unq(KEYS_helpbas_fmt)
|
||||
, procps_version
|
||||
, PACKAGE_STRING
|
||||
, w->grpname
|
||||
, CHKw(w, Show_CTIMES) ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt)
|
||||
, Rc.delay_time
|
||||
|
Loading…
Reference in New Issue
Block a user