annotate docs/ccguide/os9.refentry @ 579:dc9fb26efbad

All function prototypes are added.
author roug
date Fri, 01 Nov 2002 10:02:34 +0000
parents e43a77fddcbd
children 42b2c775f05f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
1 <refentry id="os9">
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
2 <refnamediv>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
3 <refname>_os9</refname>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
4 <refpurpose>system call interface from C programs</refpurpose>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
5 </refnamediv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
6
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
7 <refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
8 <funcsynopsis>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
9 <funcsynopsisinfo>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
10 #include &lt;os9.h&gt;
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
11 </funcsynopsisinfo>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
12 <funcprototype>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
13 <funcdef><function>_os9</function></funcdef>
572
e43a77fddcbd All function prototypes are added.
roug
parents: 534
diff changeset
14 <paramdef>char <parameter>code</parameter></paramdef>
e43a77fddcbd All function prototypes are added.
roug
parents: 534
diff changeset
15 <paramdef>struct registers *<parameter>reg</parameter></paramdef>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
16 </funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
17 </funcsynopsis>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
18
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
19 </refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
20
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
21 <refsect1><title>Description</title>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
22 <para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
23 Placeholder
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
24 </para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
25 </refsect1>
534
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
26
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
27 <refsect1><title>Diagnostics</title>
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
28 <para>
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
29 -1 is returned is the OS-9 call failed. 0 is returned on success.
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
30 </para>
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
31 </refsect1>
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
32
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
33 <refsect1><title>Program Example</title>
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
34 <programlisting>
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
35 #include &lt;os9.h&gt;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
36 #include &lt;modes.h&gt;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
37
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
38 /* this program does an I$GETSTT call to get file size */
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
39 main(argc,argv)
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
40 int argc;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
41 char **argv;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
42 {
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
43 struct registers reg;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
44 int path;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
45
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
46 /* tell linker we need longs */
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
47 pflinit();
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
48
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
49 /* low level open(file name is first command line param */
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
50 path=open(*++argv,S_IREAD);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
51
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
52 /* set up regs for call to OS-9 */
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
53 reg.rg_a=path;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
54 reg.rg_b=SS_SIZE;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
55
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
56 if(_os9(I_GETSTT,&amp;reg) == 0)
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
57 printf("filesize = %lx\n", /* success */
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
58 (long) (reg.rg_x &lt;&lt; 16)+reg.rg_u);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
59 else printf("OS9 error #%d\n",reg.rg_b &amp; 0xff); /*failed*/
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
60
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
61 dumpregs(&amp;reg); /* take a look at the registers */
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
62 }
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
63
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
64 dumpregs(r)
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
65 register struct registers *r;
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
66 {
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
67 printf("cc=%02x\n",r->rg_cc &amp; 0xff);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
68 printf(" a=%02x\n",r->rg_a &amp; 0xff);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
69 printf(" b=%02x\n",r->rg_b &amp; 0xff);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
70 printf("dp=%02x\n",r->rg_dp &amp; 0xff);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
71 printf(" x=%02x\n",r->rg_x);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
72 printf(" y=%02x\n",r->rg_u);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
73 printf(" u=%02x\n",r->rg_y);
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
74 }
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
75 </programlisting>
032365886652 Mainly section structures added.
roug
parents: 468
diff changeset
76 </refsect1>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
77 </refentry>