db_variables.c (0edf66eca446dc74078eeb1f019becce246e468b) db_variables.c (381fe1aaf4d3cb1ad62f758c15ace6cb07eea97a)
1/*
2 * Mach Operating System
3 * Copyright (c) 1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the

--- 9 unchanged lines hidden (view full) ---

18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie the
24 * rights to redistribute these changes.
25 *
1/*
2 * Mach Operating System
3 * Copyright (c) 1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the

--- 9 unchanged lines hidden (view full) ---

18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie the
24 * rights to redistribute these changes.
25 *
26 * $Id$
26 * $Id: db_variables.c,v 1.2 1993/10/16 16:47:29 rgrimes Exp $
27 */
28
29/*
30 * Author: David B. Golub, Carnegie Mellon University
31 * Date: 7/90
32 */
33
34#include "param.h"
27 */
28
29/*
30 * Author: David B. Golub, Carnegie Mellon University
31 * Date: 7/90
32 */
33
34#include "param.h"
35#include "systm.h"
35#include "proc.h"
36#include "proc.h"
36#include <machine/db_machdep.h>
37#include "ddb/ddb.h"
37
38#include <ddb/db_lex.h>
39#include <ddb/db_variables.h>
40
38
39#include <ddb/db_lex.h>
40#include <ddb/db_variables.h>
41
41extern unsigned int db_maxoff;
42void db_read_variable(struct db_variable *, db_expr_t *);
43static void db_write_variable(struct db_variable *, db_expr_t *);
42
44
43extern int db_radix;
44extern int db_max_width;
45extern int db_tab_stop_width;
46
47struct db_variable db_vars[] = {
48 { "radix", &db_radix, FCN_NULL },
49 { "maxoff", (int *)&db_maxoff, FCN_NULL },
50 { "maxwidth", &db_max_width, FCN_NULL },
51 { "tabstops", &db_tab_stop_width, FCN_NULL },
52};
53struct db_variable *db_evars = db_vars + sizeof(db_vars)/sizeof(db_vars[0]);
54

--- 47 unchanged lines hidden (view full) ---

102 return (0);
103
104 db_write_variable(vp, &value);
105
106 return (1);
107}
108
109
45struct db_variable db_vars[] = {
46 { "radix", &db_radix, FCN_NULL },
47 { "maxoff", (int *)&db_maxoff, FCN_NULL },
48 { "maxwidth", &db_max_width, FCN_NULL },
49 { "tabstops", &db_tab_stop_width, FCN_NULL },
50};
51struct db_variable *db_evars = db_vars + sizeof(db_vars)/sizeof(db_vars[0]);
52

--- 47 unchanged lines hidden (view full) ---

100 return (0);
101
102 db_write_variable(vp, &value);
103
104 return (1);
105}
106
107
108void
110db_read_variable(vp, valuep)
111 struct db_variable *vp;
112 db_expr_t *valuep;
113{
114 int (*func)() = vp->fcn;
115
116 if (func == FCN_NULL)
117 *valuep = *(vp->valuep);
118 else
119 (*func)(vp, valuep, DB_VAR_GET);
120}
121
109db_read_variable(vp, valuep)
110 struct db_variable *vp;
111 db_expr_t *valuep;
112{
113 int (*func)() = vp->fcn;
114
115 if (func == FCN_NULL)
116 *valuep = *(vp->valuep);
117 else
118 (*func)(vp, valuep, DB_VAR_GET);
119}
120
121static void
122db_write_variable(vp, valuep)
123 struct db_variable *vp;
124 db_expr_t *valuep;
125{
126 int (*func)() = vp->fcn;
127
128 if (func == FCN_NULL)
129 *(vp->valuep) = *valuep;
130 else
131 (*func)(vp, valuep, DB_VAR_SET);
132}
133
134void
122db_write_variable(vp, valuep)
123 struct db_variable *vp;
124 db_expr_t *valuep;
125{
126 int (*func)() = vp->fcn;
127
128 if (func == FCN_NULL)
129 *(vp->valuep) = *valuep;
130 else
131 (*func)(vp, valuep, DB_VAR_SET);
132}
133
134void
135db_set_cmd()
135db_set_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4)
136{
137 db_expr_t value;
138 int (*func)();
139 struct db_variable *vp;
140 int t;
141
142 t = db_read_token();
143 if (t != tDOLLAR) {

--- 22 unchanged lines hidden ---
136{
137 db_expr_t value;
138 int (*func)();
139 struct db_variable *vp;
140 int t;
141
142 t = db_read_token();
143 if (t != tDOLLAR) {

--- 22 unchanged lines hidden ---