Lely core libraries
2.2.5
|
#include "handle.h"
#include "io.h"
#include <lely/util/errnum.h>
#include <assert.h>
#include <stdlib.h>
Go to the source code of this file.
Functions | |
io_handle_t | io_handle_acquire (io_handle_t handle) |
Increments the reference count of an I/O device handle. More... | |
void | io_handle_release (io_handle_t handle) |
Decrements the reference count of an I/O device handle. More... | |
int | io_handle_unique (io_handle_t handle) |
Returns 1 if there is only a single reference to the specified I/O device handle, and 0 otherwise. | |
struct io_handle * | io_handle_alloc (const struct io_handle_vtab *vtab) |
Allocates a new I/O device handle from a virtual table. More... | |
void | io_handle_fini (struct io_handle *handle) |
Finalizes an I/O device handle by invoking its fini method, if available. | |
void | io_handle_free (struct io_handle *handle) |
Frees an I/O device handle. More... | |
void | io_handle_destroy (struct io_handle *handle) |
Destroys an I/O device handle. More... | |
void | io_handle_lock (struct io_handle *handle) |
Locks an unlocked I/O device handle, so the flags (and other device-specific fields) can safely be accessed. More... | |
void | io_handle_unlock (struct io_handle *handle) |
Unlocks a locked I/O device handle. More... | |
This file is part of the I/O library; it contains the implementation of the I/O handle functions.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file handle.c.
io_handle_t io_handle_acquire | ( | io_handle_t | handle | ) |
void io_handle_release | ( | io_handle_t | handle | ) |
Decrements the reference count of an I/O device handle.
If the count reaches zero, the handle is destroyed.
struct io_handle* io_handle_alloc | ( | const struct io_handle_vtab * | vtab | ) |
Allocates a new I/O device handle from a virtual table.
On success, the reference count is initialized to zero.
void io_handle_free | ( | struct io_handle * | handle | ) |
void io_handle_destroy | ( | struct io_handle * | handle | ) |
Destroys an I/O device handle.
This function SHOULD never be called directly. Call io_handle_release() instead.
void io_handle_lock | ( | struct io_handle * | handle | ) |
Locks an unlocked I/O device handle, so the flags (and other device-specific fields) can safely be accessed.
void io_handle_unlock | ( | struct io_handle * | handle | ) |
Unlocks a locked I/O device handle.