PSPSDK 1.0+beta2
Loading...
Searching...
No Matches
fdman.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - http://www.pspdev.org
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * fdman.h - File descriptor management.
7 *
8 * Copyright (c) 2006 Rafael Cabezas <rafpsp@gmail.com>
9 */
10
11#ifndef _FDMAN_H_
12
13#include <sys/types.h>
14
15#define _FDMAN_H_
16
17#define __FILENO_MAX 1024
18
19#define __IS_FD_VALID(FD) \
20 ( (FD >= 0) && (FD < __FILENO_MAX) && (__descriptormap[FD] != NULL) )
21
22#define __IS_FD_OF_TYPE(FD, TYPE) \
23 ( (__IS_FD_VALID(FD)) && (__descriptormap[FD]->type == TYPE) )
24
32
40
42
47
48#endif
void __fdman_release_descriptor(int fd)
void __fdman_init()
int __fdman_get_dup_descriptor(int fd)
#define __FILENO_MAX
Definition fdman.h:17
int __fdman_get_new_descriptor()
__descriptormap_type * __descriptormap[__FILENO_MAX]
__fdman_fd_types
Definition fdman.h:25
@ __DESCRIPTOR_TYPE_TTY
Definition fdman.h:30
@ __DESCRIPTOR_TYPE_PIPE
Definition fdman.h:28
@ __DESCRIPTOR_TYPE_FILE
Definition fdman.h:26
@ __DESCRIPTOR_TYPE_SOCKET
Definition fdman.h:29
@ __DESCRIPTOR_TYPE_FOLDER
Definition fdman.h:27
float x
Definition psptypes.h:0
Definition fdman.h:33
char * filename
Definition fdman.h:37
uint32_t ref_count
Definition fdman.h:36
uint32_t descriptor
Definition fdman.h:34
uint32_t flags
Definition fdman.h:35
uint8_t type
Definition fdman.h:38