1 /* This file contains procedures to dump DS data structures.
3 * The entry points into this file are
4 * data_store_dmp: display DS data store contents
7 * Oct 18, 2005: by Jorrit N. Herder
11 #include "../ds/store.h"
13 PUBLIC
struct data_store store
[NR_DS_KEYS
];
15 FORWARD
_PROTOTYPE( char *s_flags_str
, (int flags
) );
17 /*===========================================================================*
19 *===========================================================================*/
20 PUBLIC
void data_store_dmp()
22 struct data_store
*dsp
;
27 printf("Data Store (DS) contents dump\n");
29 if((s
=getsysinfo(DS_PROC_NR
, SI_DATA_STORE
, store
)) != OK
) {
30 printf("Couldn't talk to DS: %d.\n", s
);
34 printf("slot key type value\n");
36 for (i
=prev_i
; i
<NR_DS_KEYS
; i
++) {
38 if (! dsp
->ds_flags
& DS_IN_USE
) continue;
42 if(dsp
->ds_flags
& DS_TYPE_U32
) {
43 printf("u32 %lu\n", dsp
->ds_val
.ds_val_u32
);
44 } else if(dsp
->ds_flags
& DS_TYPE_STR
) {
45 printf("str \"%s\"\n", dsp
->ds_val
.ds_val_str
);
47 printf("Bogus type\n");
50 if (i
>= NR_DS_KEYS
) i
= 0;
51 else printf("--more--\r");
56 PRIVATE
char *s_flags_str(int flags
)
59 str
[0] = (flags
& DS_IN_USE
) ? 'U' : '-';
60 str
[1] = (flags
& DS_PUBLIC
) ? 'P' : '-';