|
|
1.1 root 1: .ds ZZ DEVELOPMENT PACKAGE
2: .TH SETUPVAL 3R "630 MTG"
3: .XE "setupval()"
4: .SH NAME
5: setupval \- return a setup option
6: .SH SYNOPSIS
7: \f3
8: #include <setup.h>
9: .sp
10: int setupval (obj, opt)
11: .br
12: .B int obj, opt;\fR
13: .SH DESCRIPTION
14: The
15: .I setupval
16: function
17: returns the value of a setup option.
18: The first argument,
19: .IR obj ,
20: is an object that has setup values.
21: Possible objects are the terminal
22: .RI ( S_PREF ),
23: the printer
24: .RI ( S_PRINT ),
25: and the host
26: .RI ( whathost() ).
27: The second argument,
28: .IR opt ,
29: is a particular option for that object.
30: The return value is an integer which describes that setting for
31: that option. This is summarized in the table below.
32: .sp
33: .TS
34: center tab (~);
35: lp8 lp8 lp8 lp8.
36: Object~Option~Returned~Meaning
37:
38: S_PREF~S_PREF_CTRL~S_PREF_CTRL_VIS~visible
39: (user's~(control character~S_PREF_CTRL_INVIS~invisible
40: preferences)~display)~S_PREF_CTRL_SPACE~a space
41:
42: ~S_PREF_KCLK~S_PREF_KCLK_OFF~off
43: ~(keyboard click)~S_PREF_KCLK_ON~on
44:
45: ~S_PREF_KVOL~S_PREF_KVOL_0~off
46: ~(keyboard volume)~S_PREF_KVOL_1~1
47: ~~S_PREF_KVOL_2~2
48: ~~S_PREF_KVOL_3~3
49: ~~S_PREF_KVOL_4~4
50: ~~S_PREF_KVOL_5~5
51: ~~S_PREF_KVOL_6~6
52: ~~S_PREF_KVOL_7~full
53:
54: ~S_PREF_CURS~S_PREF_CURS_NOBLK~no blinking
55: ~(cursor mode)~S_PREF_CURS_BLK~blinking
56:
57: ~S_PREF_KRPT~S_PREF_KRPT_15~15 per second
58: ~(keyboard~S_PREF_KRPT_20~20 per second
59: ~repeat rate)~S_PREF_KRPT_30~30 per second
60: ~~S_PREF_KRPT_60~60 per second
61:
62: ~S_PREF_WBUF~S_PREF_WBUF_OFF~off
63: ~(windowproc buffer)~S_PREF_WBUF_ON~on
64:
65: ~S_PREF_WTYP~S_PREF_WTYP_BASIC~basic
66: ~(windowproc type)~S_PREF_WTYP_EHN~enhanced
67:
68: S_PRINT~S_PRINT_TAB~S_PRINT_TAB_NO~no
69: (printer)~(tab expansion)~S_PRINT_TAB_YES~yes
70:
71: ~S_PRINT_ESC~S_PRINT_ESC_NO~no
72: ~(filter escapes)~S_PRINT_ESC_YES~yes
73:
74: whathost()~S_HOST_ENC~S_HOST_ENC_OFF~off
75: (process's host)~(encoding)~S_HOST_ENC_ON~on
76:
77: ~S_HOST_RTN~S_HOST_RTN_CR~carriage return
78: ~(sent return~S_HOST_RTN_LF~line feed
79: ~key definition)~S_HOST_RTN_CRLF~carriage return
80: ~~~and line feed
81:
82: ~S_HOST_NL~S_HOST_NL_LF~line feed
83: ~(newline~S_HOST_NL_CRLF~carriage return
84: ~definition)~~and line feed
85:
86: ~S_HOST_FONT~S_HOST_FONT_SMALL~smallfont
87: ~(font)~S_HOST_FONT_MEDIUM~mediumfont
88: ~~S_HOST_FONT_LARGE~largefont
89:
90: ~S_HOST_COL~multiplexed columns~number
91: ~S_HOST_ROW~multiplexed rows~number
92: ~S_HOST_NCOL~nonmultiplexed columns~number
93: ~S_HOST_NROW~nonmultiplexed rows~number
94:
95: ~S_HOST_FIXED~S_HOST_FIXED_NO~no
96: ~(fixed size window)~S_HOST_FIXED_YES~yes
97: .TE
98: .PP
99: If the object is invalid,
100: .I setupval
101: returns -1.
102: If the option for a given object is invalid,
103: the return value is undefined.
104:
105:
106: .SH EXAMPLE
107: The following example prints out the setting of some options.
108: .PP
109: .RS 3
110: .nf
111: .ft CM
112: .S -2
113: #include <setup.h>
114:
115: printval()
116: {
117: int i;
118:
119: lprintf("key click is ");
120: switch(setupval(S_PREF, S_PREF_KCLK))
121: {
122: case S_PREF_KCLK_OFF: lprintf("off\\n"); break;
123: case S_PREF_KCLK_ON: lprintf("on\\n"); break;
124: }
125: i = setupval(whathost(),
126: ismpx()? S_HOST_ROW: S_HOST_NROW);
127: if(i == -1)
128: lprintf("I am local\\n");
129: else
130: lprintf("default rows = %d\\n", i);
131: }
132: .fi
133: .ft R
134: .S +2
135: .RE
136: .PP
137: .SH SEE ALSO
138: ismpx(3R), whathost(3R).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.