File: ref.html

package info (click to toggle)
liboop 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,120 kB
  • sloc: sh: 11,098; ansic: 2,533; makefile: 71
file content (160 lines) | stat: -rw-r--r-- 6,055 bytes parent folder | download | duplicates (4)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html><head>
<title>liboop: Reference</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head><body>

<h2>Liboop Reference.</h2>

<h4>Event Source Interface.</h4>

<pre>
#include &lt;oop.h&gt;

/* <em>Applications can set these; liboop libraries will use them.</em> */
extern void *(*<a href="alloc.html">oop_malloc</a>)(size_t); /* <em>returns NULL on failure</em> */
extern void *(*<a href="alloc.html">oop_realloc</a>)(void *,size_t); /* <em>returns NULL on failure</em> */
extern void (*<a href="alloc.html">oop_free</a>)(void *);

typedef struct oop_source oop_source;
struct oop_source {
    /* <em>File descriptor activity events.</em> */
    void (*<a href="on_fd.html">on_fd</a>)(oop_source *,int fd,oop_event,oop_call_fd *,void *);
    void (*<a href="on_fd.html">cancel_fd</a>)(oop_source *,int fd,oop_event);

    /* <em>Timer events.</em> */
    void (*<a href="on_time.html">on_time</a>)(oop_source *,struct timeval,oop_call_time *,void *);
    void (*<a href="on_time.html">cancel_time</a>)(oop_source *,struct timeval,oop_call_time *,void *);

    /* <em>UNIX signal events.</em> */
    void (*<a href="on_signal.html">on_signal</a>)(oop_source *,int sig,oop_call_signal *,void *);
    void (*<a href="on_signal.html">cancel_signal</a>)(oop_source *,int sig,oop_call_signal *,void *);
};
</pre>

<h4>System Event Source.</h4>

<pre>
typedef struct oop_source_sys oop_source_sys;

/* <em>Create and destroy a system event source.</em> */
oop_source_sys *<a href="oop_sys.html">oop_sys_new</a>(void); /* <em>returns NULL on failure</em> */
void <a href="oop_sys.html">oop_sys_delete</a>(oop_source_sys *);

/* <em>Run the system event loop.</em> */
void *<a href="oop_sys_run.html">oop_sys_run</a>(oop_source_sys *);
void *<a href="oop_sys_run.html">oop_sys_run_once</a>(oop_source_sys *);

/* <em>Get the standard source interface for a system event source.</em> */
oop_source *<a href="oop_sys_source.html">oop_sys_source</a>(oop_source_sys *);
</pre>

<hr>
<h4><a href="http://www.chiark.greenend.org.uk/~ian/adns/">ADNS</a> Event Sink 
Adapter.</h4>

<p><em>Please note that while the core of liboop is distributed under the 
Lesser GPL, ADNS is covered by the 
<a href="http://www.fsf.org/copyleft/gpl.html">full GPL</a>.</em></p>

<pre>
#include &lt;adns.h&gt;
#include &lt;oop-adns.h&gt;

typedef struct oop_adapter_adns oop_adapter_adns;
typedef struct oop_adns_query oop_adns_query;

/* <em>Create and destroy a liboop adns adapter, including an instance of adns.</em> */
oop_adapter_adns *<a href="oop_adns.html">oop_adns_new</a>(oop_source *,adns_initflags,FILE *diag); /* <em>returns NULL on failure</em> */
void <a href="oop_adns.html">oop_adns_delete</a>(oop_adapter_adns *);

/* <em>Submit an asynchronous DNS query.</em> */
oop_adns_query *<a href="oop_adns_query.html">oop_adns_submit</a>( /* <em>returns NULL on failure</em> */
        oop_adapter_adns *,
        const char *owner,adns_rrtype type,adns_queryflags flags,
        oop_adns_call *,void *);

/* <em>Cancel a running query.</em> */
void <a href="oop_adns_query.html">oop_adns_cancel</a>(oop_adns_query *);
</pre>

<hr>
<h4><a href="http://gtk.org/">GLib</a> Event Source Adapter.</h4>

<p><em>GLib is copyrighted by Peter Mattis, Spencer Kimball and Josh MacDonald,
and licensed under the terms of the 
<a href="http://www.fsf.org/copyleft/lgpl.html">GNU Library GPL</a>.</em></p>

<pre>
#include &lt;glib.h&gt;
#include &lt;oop-glib.h&gt;

/* <em>Create and destroy a liboop GLib adapter.</em> */
oop_source *<a href="oop_glib.html">oop_glib_new</a>();
void <a href="oop_glib.html">oop_glib_delete</a>();

/* <em>Get the value used to terminate the event loop (e.g. OOP_HALT)</em>. */
void *<a href="oop_glib.html">oop_glib_return</a>();
</pre>

<hr>
<h4><a href="http://www.purl.org/tcl/home/">Tcl/Tk</a> 
Event Source Adapter.</h4>

<p><em>Tcl is copyrighted by the Regents of the University of California,
Sun Microsystems, Inc., and other parties.</em></p>

<pre>
#include &lt;oop-tcl.h&gt;

/* <em>Create and destroy a liboop Tcl adapter.</em> */
oop_source *<a href="oop_tcl.html">oop_tcl_new</a>();
void <a href="oop_tcl.html">oop_tcl_delete</a>();
</pre>

<hr>
<h4><a href="http://www.w3.org/Library/">Libwww</a> Event Sink Adapter.</h4>

<p><em>Libwww is covered by this <a 
href="http://www.w3.org/Consortium/Legal/libwww-copyright-notice-19980720.html"
>copyright notice</a> and distributed under the terms of the
<a href="http://www.w3.org/Consortium/Legal/copyright-software.html">W3C
Software License</a>.</em></p>

<pre>
#include &lt;HTEvent.h&gt;
#include &lt;oop-www.h&gt;

/* <em>Register a liboop event source as a libwww "event manager".</em> */
void <a href="oop_www.html">oop_www_register</a>(oop_source *);

/* <em>Unregister the event source, leaving libwww with no event manager.
   This function cannot be executed with outstanding event requests.</em> */
void <a href="oop_www.html">oop_www_cancel</a>();

/* <em>Use libwww for liboop's oop_malloc, oop_realloc, and oop_free.
   <b>If you use this, you must call it before any other liboop function!</b></em> */
void <a href="oop_www.html">oop_www_memory</a>();
</pre>

<hr>
<h4><a href="http://cnswww.cns.cwru.edu/~chet/readline/rltop.html">GNU
Readline Library</a> Event Sink Adapter.</h4>

<p><em>Please note that while the core of liboop is distributed under the 
Lesser GPL, Readline is covered by the 
<a href="http://www.fsf.org/copyleft/gpl.html">full GPL</a>.</em></p>

<pre>
#include &lt;oop-rl.h&gt;

/* <em>Use a liboop event source to call rl_callback_read_char().
   It is up to you to call rl_callback_handler_install().
   Note well that Readline uses malloc(), not oop_malloc().</em> */
void <a href="oop_rl.html">oop_readline_register</a>(oop_source *);

/* <em>Stop notifying readline of input characters.</em> */
void <a href="oop_rl.html">oop_readline_cancel</a>(oop_source *);
</pre>

<hr><a href="index.html">liboop home</a></body></html>