Put MAXNOC in xdump version
Create virtual selector nsc_ver_maxnoc() for it.
This commit is contained in:
parent
2725d6e736
commit
4f5e2119c6
1 changed files with 14 additions and 2 deletions
|
@ -46,6 +46,7 @@
|
||||||
#include "product.h"
|
#include "product.h"
|
||||||
|
|
||||||
static void *nsc_ver(struct valstr *, struct natstr *, void *);
|
static void *nsc_ver(struct valstr *, struct natstr *, void *);
|
||||||
|
static void *nsc_ver_maxnoc(struct valstr *, struct natstr *, void *);
|
||||||
static void *nsc_pln_att(struct valstr *, struct natstr *, void *);
|
static void *nsc_pln_att(struct valstr *, struct natstr *, void *);
|
||||||
static void *nsc_pln_def(struct valstr *, struct natstr *, void *);
|
static void *nsc_pln_def(struct valstr *, struct natstr *, void *);
|
||||||
static void *nsc_lnd_att(struct valstr *, struct natstr *, void *);
|
static void *nsc_lnd_att(struct valstr *, struct natstr *, void *);
|
||||||
|
@ -698,6 +699,9 @@ nsc_init(void)
|
||||||
static struct castr version_ca0 = {
|
static struct castr version_ca0 = {
|
||||||
"version", 0, NSC_STRINGY, sizeof(PACKAGE_STRING), NULL, EF_BAD, 0
|
"version", 0, NSC_STRINGY, sizeof(PACKAGE_STRING), NULL, EF_BAD, 0
|
||||||
};
|
};
|
||||||
|
static struct castr version_ca1 = {
|
||||||
|
"maxnoc", 0, NSC_LONG, 0, nsc_ver_maxnoc, EF_BAD, 0
|
||||||
|
};
|
||||||
static struct castr *ca;
|
static struct castr *ca;
|
||||||
struct keymatch *kp;
|
struct keymatch *kp;
|
||||||
int n, i;
|
int n, i;
|
||||||
|
@ -709,9 +713,10 @@ nsc_init(void)
|
||||||
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL))
|
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL))
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
ca = calloc(n + 2, sizeof(*ca));
|
ca = calloc(2 + n + 1, sizeof(*ca));
|
||||||
ca[0] = version_ca0;
|
ca[0] = version_ca0;
|
||||||
i = 1;
|
ca[1] = version_ca1;
|
||||||
|
i = 2;
|
||||||
for (kp = configkeys; kp->km_key; ++kp) {
|
for (kp = configkeys; kp->km_key; ++kp) {
|
||||||
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) {
|
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) {
|
||||||
ca[i].ca_type = kp->km_type;
|
ca[i].ca_type = kp->km_type;
|
||||||
|
@ -752,6 +757,13 @@ nsc_ver(struct valstr *val, struct natstr *np, void *ptr)
|
||||||
return kp->km_data;
|
return kp->km_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
nsc_ver_maxnoc(struct valstr *val, struct natstr *np, void *ptr)
|
||||||
|
{
|
||||||
|
val->val_as.lng = MAXNOC;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
nsc_pln_def(struct valstr *val, struct natstr *np, void *ptr)
|
nsc_pln_def(struct valstr *val, struct natstr *np, void *ptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue