Deleted Added
full compact
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$
27 */
28
29/*
30 * Author: David B. Golub, Carnegie Mellon University
31 * Date: 7/90
32 */
33
34#include "param.h"
35#include "proc.h"
36#include <machine/db_machdep.h>
37
38#include <ddb/db_lex.h>
39#include <ddb/db_variables.h>
40
41extern unsigned int db_maxoff;
42
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
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
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()
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 ---