File: device.h.html

package info (click to toggle)
librudiments0 0.27-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,528 kB
  • ctags: 2,284
  • sloc: cpp: 14,657; sh: 7,547; ansic: 2,664; makefile: 945; xml: 15
file content (45 lines) | stat: -rw-r--r-- 2,681 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<title>~/src/firstworks/rudiments-0.27/include/rudiments/device.h.html</title>
<meta name="Generator" content="Vim/6.2">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2004 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a520f7">#ifndef RUDIMENTS_DEVICE_H</font>
<font color="#a520f7">#define RUDIMENTS_DEVICE_H</font>

<font color="#a520f7">#include </font><font color="#ff00ff">&lt;rudiments/private/deviceincludes.h&gt;</font>

<font color="#0000ff">// The device class provides methods for interacting with devices.</font>

<font color="#298a52"><b>class</b></font> device : <font color="#a52829"><b>public</b></font> file {
        <font color="#a52829"><b>public</b></font>:

                        device();
                        <font color="#0000ff">// Creates an uninitialized instance of the</font>
                        <font color="#0000ff">// device class.</font>
                <font color="#298a52"><b>virtual</b></font> ~device();

                <font color="#298a52"><b>static</b></font> <font color="#298a52"><b>bool</b></font>     createDeviceNode(<font color="#298a52"><b>const</b></font> <font color="#298a52"><b>char</b></font> *filename,
                                                <font color="#298a52"><b>bool</b></font> blockdevice,
                                                <font color="#298a52"><b>unsigned</b></font> <font color="#298a52"><b>short</b></font> major,
                                                <font color="#298a52"><b>unsigned</b></font> <font color="#298a52"><b>short</b></font> minor,
                                                mode_t perms);
                        <font color="#0000ff">// Creates device node &quot;filename&quot; with major number</font>
                        <font color="#0000ff">// &quot;major&quot; and minor number &quot;minor&quot;.  The device node</font>
                        <font color="#0000ff">// will be created as a block device if &quot;blockdevice&quot;</font>
                        <font color="#0000ff">// is true, otherwise it will be created as a character</font>
                        <font color="#0000ff">// device.  The device node will be assigned</font>
                        <font color="#0000ff">// permissions &quot;perms&quot;.</font>
                        <font color="#0000ff">//</font>
                        <font color="#0000ff">// Returns true on success and false on failure.</font>
};

<font color="#a520f7">#endif</font>
</pre>
</body>
</html>