From 5dced3d1b3deca80e01415a2e35dc7972dcbfae7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 11:25:10 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- lib/ss/requests.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 lib/ss/requests.c (limited to 'lib/ss/requests.c') diff --git a/lib/ss/requests.c b/lib/ss/requests.c new file mode 100644 index 0000000..33ce5d2 --- /dev/null +++ b/lib/ss/requests.c @@ -0,0 +1,66 @@ +/* + * Various minor routines... + * + * Copyright 1987, 1988, 1989 by MIT + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose is hereby granted, provided that + * the names of M.I.T. and the M.I.T. S.I.P.B. not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. M.I.T. and the + * M.I.T. S.I.P.B. make no representations about the suitability of + * this software for any purpose. It is provided "as is" without + * express or implied warranty. + */ + +#include "config.h" +#include +#include "ss_internal.h" + +#define DECLARE(name) void name(int argc,const char * const *argv, \ + int sci_idx, void *infop) + +/* + * ss_self_identify -- assigned by default to the "." request + */ +void ss_self_identify(int argc __SS_ATTR((unused)), + const char * const *argv __SS_ATTR((unused)), + int sci_idx, void *infop __SS_ATTR((unused))) +{ + register ss_data *info = ss_info(sci_idx); + printf("%s version %s\n", info->subsystem_name, + info->subsystem_version); +} + +/* + * ss_subsystem_name -- print name of subsystem + */ +void ss_subsystem_name(int argc __SS_ATTR((unused)), + const char * const *argv __SS_ATTR((unused)), + int sci_idx, + void *infop __SS_ATTR((unused))) +{ + printf("%s\n", ss_info(sci_idx)->subsystem_name); +} + +/* + * ss_subsystem_version -- print version of subsystem + */ +void ss_subsystem_version(int argc __SS_ATTR((unused)), + const char * const *argv __SS_ATTR((unused)), + int sci_idx, + void *infop __SS_ATTR((unused))) +{ + printf("%s\n", ss_info(sci_idx)->subsystem_version); +} + +/* + * ss_unimplemented -- routine not implemented (should be + * set up as (dont_list,dont_summarize)) + */ +void ss_unimplemented(int argc __SS_ATTR((unused)), + const char * const *argv __SS_ATTR((unused)), + int sci_idx, void *infop __SS_ATTR((unused))) +{ + ss_perror(sci_idx, SS_ET_UNIMPLEMENTED, ""); +} -- cgit v1.2.3