Commit 13f574a3 authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Move C standard library pxd files to libc package

--HG--
rename : Cython/Includes/stdio.pxd => Cython/Includes/libc/stdio.pxd
rename : Cython/Includes/stdlib.pxd => Cython/Includes/libc/stdlib.pxd
parent f98755eb
cdef extern from "stdio.h" nogil:
ctypedef struct FILE
int printf(char *format, ...)
int fprintf(FILE *stream, char *format, ...)
int sprintf(char *str, char *format, ...)
FILE *fopen(char *path, char *mode)
int fclose(FILE *strea)
cdef FILE *stdout
int scanf(char *format, ...)
cdef extern from "stdlib.h" nogil:
void free(void *ptr)
void *malloc(size_t size)
void *realloc(void *ptr, size_t size)
size_t strlen(char *s)
char *strcpy(char *dest, char *src)
cdef extern from "stdio.h" nogil: # Present for backwards compatability
ctypedef struct FILE from libc.stdio cimport *
int printf(char *format, ...)
int fprintf(FILE *stream, char *format, ...)
int sprintf(char *str, char *format, ...)
FILE *fopen(char *path, char *mode)
int fclose(FILE *strea)
cdef FILE *stdout
int scanf(char *format, ...)
# Present for backwards compatability
cdef extern from "stdlib.h" nogil: from libc.stdlib cimport *
void free(void *ptr)
void *malloc(size_t size)
void *realloc(void *ptr, size_t size)
size_t strlen(char *s)
char *strcpy(char *dest, char *src)
"""
>>> f()
'hello'
"""
from libc.stdio cimport sprintf
def f():
cdef char buf[10]
sprintf(buf, b'hello')
return str((<object>buf).decode('ASCII'))
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