File: ggiResourceAcquire.3ggi

package info (click to toggle)
libggi 1%3A2.0.1-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,072 kB
  • ctags: 5,274
  • sloc: ansic: 42,720; sh: 6,508; makefile: 666
file content (56 lines) | stat: -rw-r--r-- 1,784 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
46
47
48
49
50
51
52
53
54
55
56
.\\" auto-generated by docbook2man-spec $Revision: 1.5 $
.TH "ggiResourceAcquire" "3ggi" "22 August 2001" "GGI" "LibGGI API"
.SH NAME
ggiResourceAcquire, ggiResourceRelease, ggiResourceMustAcquire \- Acquire and release a LibGGI resource
.SH SYNOPSIS
\fB#include <ggi/ggi.h>
.sp
int ggiResourceAcquire(ggi_resource_t \fIres\fB, uint32 \fIactype\fB);
.sp
int ggiResourceRelease(ggi_resource_t \fIres\fB);
.sp
int ggiResourceMustAcquire(ggi_resource_t \fIres\fB);
\fR.SH "DESCRIPTION"
.PP
\fBggiResourceAcquire\fR acquires (locks) a LibGGI resource, typically a
DirectBuffer (see examples below). The \fIactype\fR indicates the
desired access type for the operation. The following flags may be
bitwise-or'ed together:
.TP
\fBGGI_ACTYPE_READ\fR
read access to the resource
.TP
\fBGGI_ACTYPE_WRITE\fR
write access to the resource
.PP
\fBggiResourceRelease\fR releases (unlocks) an already-acquired
resource.
.PP
\fBggiResourceMustAcquire\fR determines whether or not the
specified resource needs to be acquired before using.
.SH "RETURN VALUE"
.PP
\fBggiResourceAcquire\fR and \fBggiResourceRelease\fR
return 0 on success, <0 on failure.
.PP
\fBggiResourceMustAcquire\fR is simply a macro that returns true
if the resource must be explicitly acquired and released, or false if not.
However, it is still safe to call \fBggiResourceAcquire\fR or
\fBggiResourceRelease\fR even in the latter case -- it would be a no-op.
.SH "EXAMPLES"
.SS "USING DIRECTBUFFERS"
.sp
.nf
const ggi_directbuffer *dbuf;

/* Acquire DirectBuffer before we use it. */
if (ggiResourceAcquire(dbuf->resource, GGI_ACTYPE_WRITE) != 0) {
	fail("Error acquiring DirectBuffer\\n");
}

\fI/* Do framebuffer rendering here... */\fR

/* Release DirectBuffer when done with it. */
ggiResourceRelease(dbuf->resource);
.sp
.fi