Commit 36292c55 authored by scoder's avatar scoder

Merge pull request #429 from larsmans/posix

wrap POSIX dynamic linking API and stdio.h extensions
parents ab78f93b dc5904f1
# POSIX dynamic linking/loading interface.
# http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dlfcn.h.html
cdef extern from "dlfcn.h" nogil:
void *dlopen(const char *, int)
char *dlerror()
void *dlsym(void *, const char *)
int dlclose(void *)
enum:
RTLD_LAZY
RTLD_NOW
RTLD_GLOBAL
RTLD_LOCAL
# POSIX additions to <stdio.h>.
# http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdio.h.html
from libc.stdio cimport FILE
from libc.stddef cimport wchar_t
from posix.types cimport off_t
cdef extern from "stdio.h" nogil:
# File descriptors
FILE *fdopen(int, const char *)
int fileno(FILE *)
# Pipes
FILE *popen(const char *, const char *)
int pclose(FILE *)
# Memory streams (POSIX.2008)
FILE *fmemopen(void *, size_t, const char *)
FILE *open_memstream(char **, size_t *)
FILE *open_wmemstream(wchar_t **, size_t *)
# Seek and tell with off_t
int fseeko(FILE *, off_t, int)
off_t ftello(FILE *)
# Locking (for multithreading)
void flockfile(FILE *)
int ftrylockfile(FILE *)
void funlockfile(FILE *)
int getc_unlocked(FILE *)
int getchar_unlocked()
int putc_unlocked(int, FILE *)
int putchar_unlocked(int)
# Reading lines and records (POSIX.2008)
ssize_t getline(char **, size_t *, FILE *)
ssize_t getdelim(char **, size_t *, int, FILE *)
...@@ -23,6 +23,10 @@ cimport posix.stat ...@@ -23,6 +23,10 @@ cimport posix.stat
from posix cimport stat from posix cimport stat
from posix.stat cimport * from posix.stat cimport *
cimport posix.stdio
from posix cimport stdio
from posix.stdio cimport *
cimport posix.stdlib cimport posix.stdlib
from posix cimport stdlib from posix cimport stdlib
from posix.stdlib cimport * from posix.stdlib cimport *
...@@ -42,3 +46,7 @@ from posix.wait cimport * ...@@ -42,3 +46,7 @@ from posix.wait cimport *
cimport posix.mman cimport posix.mman
from posix cimport mman from posix cimport mman
from posix.mman cimport * from posix.mman cimport *
cimport posix.dlfcn
from posix cimport dlfcn
from posix.dlfcn cimport *
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment