Commit c0cda71c authored by Stefan Behnel's avatar Stefan Behnel

replace 'const_xyz' work-arounds in standard .pxd files by real 'const' declarations

parent ee5ac4a5
# 7.11 Localization <locale.h> # 7.11 Localization <locale.h>
cdef extern from *: # deprecated cimport for backwards compatibility:
ctypedef char const_char "const char" from .string cimport const_char
cdef extern from "locale.h" nogil: cdef extern from "locale.h" nogil:
...@@ -39,7 +40,7 @@ cdef extern from "locale.h" nogil: ...@@ -39,7 +40,7 @@ cdef extern from "locale.h" nogil:
enum: LC_TIME enum: LC_TIME
# 7.11.1 Locale control # 7.11.1 Locale control
char *setlocale (int CATEGORY, const_char *LOCALE) char *setlocale (int CATEGORY, const char *LOCALE)
# 7.11.2 Numeric formatting convention inquiry # 7.11.2 Numeric formatting convention inquiry
lconv *localeconv () lconv *localeconv ()
# 7.19 Input/output <stdio.h> # 7.19 Input/output <stdio.h>
cdef extern from *:
ctypedef char const_char "const char" # deprecated cimports for backwards compatibility:
ctypedef void const_void "const void" from .string cimport const_char, const_void
cdef extern from "stdio.h" nogil: cdef extern from "stdio.h" nogil:
...@@ -13,11 +14,11 @@ cdef extern from "stdio.h" nogil: ...@@ -13,11 +14,11 @@ cdef extern from "stdio.h" nogil:
enum: FOPEN_MAX enum: FOPEN_MAX
enum: FILENAME_MAX enum: FILENAME_MAX
FILE *fopen (const_char *FILENAME, const_char *OPENTYPE) FILE *fopen (const char *FILENAME, const char *OPENTYPE)
FILE *freopen (const_char *FILENAME, const_char *OPENTYPE, FILE *STREAM) FILE *freopen (const char *FILENAME, const char *OPENTYPE, FILE *STREAM)
int fclose (FILE *STREAM) int fclose (FILE *STREAM)
int remove (const_char *FILENAME) int remove (const char *FILENAME)
int rename (const_char *OLDNAME, const_char *NEWNAME) int rename (const char *OLDNAME, const char *NEWNAME)
FILE *tmpfile () FILE *tmpfile ()
enum: _IOFBF enum: _IOFBF
...@@ -28,7 +29,7 @@ cdef extern from "stdio.h" nogil: ...@@ -28,7 +29,7 @@ cdef extern from "stdio.h" nogil:
void setbuf (FILE *STREAM, char *BUF) void setbuf (FILE *STREAM, char *BUF)
size_t fread (void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM) size_t fread (void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM)
size_t fwrite (const_void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM) size_t fwrite (const void *DATA, size_t SIZE, size_t COUNT, FILE *STREAM)
int fflush (FILE *STREAM) int fflush (FILE *STREAM)
enum: EOF enum: EOF
...@@ -43,23 +44,23 @@ cdef extern from "stdio.h" nogil: ...@@ -43,23 +44,23 @@ cdef extern from "stdio.h" nogil:
long int ftell (FILE *STREAM) long int ftell (FILE *STREAM)
ctypedef long long int fpos_t ctypedef long long int fpos_t
ctypedef fpos_t const_fpos_t "const fpos_t" ctypedef const fpos_t const_fpos_t "const fpos_t"
int fgetpos (FILE *STREAM, fpos_t *POSITION) int fgetpos (FILE *STREAM, fpos_t *POSITION)
int fsetpos (FILE *STREAM, const_fpos_t *POSITION) int fsetpos (FILE *STREAM, const fpos_t *POSITION)
int scanf (const_char *TEMPLATE, ...) int scanf (const char *TEMPLATE, ...)
int sscanf (const_char *S, const_char *TEMPLATE, ...) int sscanf (const char *S, const char *TEMPLATE, ...)
int fscanf (FILE *STREAM, const_char *TEMPLATE, ...) int fscanf (FILE *STREAM, const char *TEMPLATE, ...)
int printf (const_char *TEMPLATE, ...) int printf (const char *TEMPLATE, ...)
int sprintf (char *S, const_char *TEMPLATE, ...) int sprintf (char *S, const char *TEMPLATE, ...)
int snprintf (char *S, size_t SIZE, const_char *TEMPLATE, ...) int snprintf (char *S, size_t SIZE, const char *TEMPLATE, ...)
int fprintf (FILE *STREAM, const_char *TEMPLATE, ...) int fprintf (FILE *STREAM, const char *TEMPLATE, ...)
void perror (const_char *MESSAGE) void perror (const char *MESSAGE)
char *gets (char *S) char *gets (char *S)
char *fgets (char *S, int COUNT, FILE *STREAM) char *fgets (char *S, int COUNT, FILE *STREAM)
int puts (const_char *S) int puts (const char *S)
int fputs (const_char *S, FILE *STREAM) int fputs (const char *S, FILE *STREAM)
# 7.20 General utilities <stdlib.h> # 7.20 General utilities <stdlib.h>
cdef extern from *: # deprecated cimports for backwards compatibility:
ctypedef char const_char "const char" from .string cimport const_char, const_void
ctypedef void const_void "const void"
cdef extern from "stdlib.h" nogil: cdef extern from "stdlib.h" nogil:
# 7.20.1 Numeric conversion functions # 7.20.1 Numeric conversion functions
int atoi (const_char *STRING) int atoi (const char *STRING)
long atol (const_char *STRING) long atol (const char *STRING)
long long atoll (const_char *STRING) long long atoll (const char *STRING)
double atof (const_char *STRING) double atof (const char *STRING)
long strtol (const_char *STRING, char **TAILPTR, int BASE) long strtol (const char *STRING, char **TAILPTR, int BASE)
unsigned long int strtoul (const_char *STRING, char **TAILPTR, int BASE) unsigned long int strtoul (const char *STRING, char **TAILPTR, int BASE)
long long int strtoll (const_char *STRING, char **TAILPTR, int BASE) long long int strtoll (const char *STRING, char **TAILPTR, int BASE)
unsigned long long int strtoull (const_char *STRING, char **TAILPTR, int BASE) unsigned long long int strtoull (const char *STRING, char **TAILPTR, int BASE)
float strtof (const_char *STRING, char **TAILPTR) float strtof (const char *STRING, char **TAILPTR)
double strtod (const_char *STRING, char **TAILPTR) double strtod (const char *STRING, char **TAILPTR)
long double strtold (const_char *STRING, char **TAILPTR) long double strtold (const char *STRING, char **TAILPTR)
# 7.20.2 Pseudo-random sequence generation functions # 7.20.2 Pseudo-random sequence generation functions
enum: RAND_MAX enum: RAND_MAX
...@@ -37,15 +37,15 @@ cdef extern from "stdlib.h" nogil: ...@@ -37,15 +37,15 @@ cdef extern from "stdlib.h" nogil:
void _Exit (int STATUS) void _Exit (int STATUS)
int atexit (void (*FUNCTION) ()) int atexit (void (*FUNCTION) ())
void abort () void abort ()
char *getenv (const_char *NAME) char *getenv (const char *NAME)
int system (const_char *COMMAND) int system (const char *COMMAND)
#7.20.5 Searching and sorting utilities #7.20.5 Searching and sorting utilities
void *bsearch (const_void *KEY, const_void *ARRAY, void *bsearch (const void *KEY, const void *ARRAY,
size_t COUNT, size_t SIZE, size_t COUNT, size_t SIZE,
int (*COMPARE)(const_void *, const_void *)) int (*COMPARE)(const void *, const void *))
void qsort (void *ARRAY, size_t COUNT, size_t SIZE, void qsort (void *ARRAY, size_t COUNT, size_t SIZE,
int (*COMPARE)(const_void *, const_void *)) int (*COMPARE)(const void *, const void *))
# 7.20.6 Integer arithmetic functions # 7.20.6 Integer arithmetic functions
int abs (int NUMBER) int abs (int NUMBER)
......
# 7.21 String handling <string.h> # 7.21 String handling <string.h>
cdef extern from *: cdef extern from *:
ctypedef char const_char "const char" # deprecated backwards compatibility declarations
ctypedef signed char const_schar "const signed char" ctypedef const char const_char "const char"
ctypedef unsigned char const_uchar "const unsigned char" ctypedef const signed char const_schar "const signed char"
ctypedef void const_void "const void" ctypedef const unsigned char const_uchar "const unsigned char"
ctypedef const void const_void "const void"
cdef extern from "string.h" nogil: cdef extern from "string.h" nogil:
void *memcpy (void *TO, const_void *FROM, size_t SIZE) void *memcpy (void *TO, const void *FROM, size_t SIZE)
void *memmove (void *TO, const_void *FROM, size_t SIZE) void *memmove (void *TO, const void *FROM, size_t SIZE)
void *memset (void *BLOCK, int C, size_t SIZE) void *memset (void *BLOCK, int C, size_t SIZE)
int memcmp (const_void *A1, const_void *A2, size_t SIZE) int memcmp (const void *A1, const void *A2, size_t SIZE)
void *memchr (const_void *BLOCK, int C, size_t SIZE) void *memchr (const void *BLOCK, int C, size_t SIZE)
void *memchr (const_void *BLOCK, int C, size_t SIZE) void *memchr (const void *BLOCK, int C, size_t SIZE)
void *memrchr (const_void *BLOCK, int C, size_t SIZE) void *memrchr (const void *BLOCK, int C, size_t SIZE)
size_t strlen (const_char *S) size_t strlen (const char *S)
char *strcpy (char *TO, const_char *FROM) char *strcpy (char *TO, const char *FROM)
char *strncpy (char *TO, const_char *FROM, size_t SIZE) char *strncpy (char *TO, const char *FROM, size_t SIZE)
char *strdup (const_char *S) char *strdup (const char *S)
char *strndup (const_char *S, size_t SIZE) char *strndup (const char *S, size_t SIZE)
char *strcat (char *TO, const_char *FROM) char *strcat (char *TO, const char *FROM)
char *strncat (char *TO, const_char *FROM, size_t SIZE) char *strncat (char *TO, const char *FROM, size_t SIZE)
int strcmp (const_char *S1, const_char *S2) int strcmp (const char *S1, const char *S2)
int strcasecmp (const_char *S1, const_char *S2) int strcasecmp (const char *S1, const char *S2)
int strncmp (const_char *S1, const_char *S2, size_t SIZE) int strncmp (const char *S1, const char *S2, size_t SIZE)
int strncasecmp (const_char *S1, const_char *S2, size_t N) int strncasecmp (const char *S1, const char *S2, size_t N)
int strcoll (const_char *S1, const_char *S2) int strcoll (const char *S1, const char *S2)
size_t strxfrm (char *TO, const_char *FROM, size_t SIZE) size_t strxfrm (char *TO, const char *FROM, size_t SIZE)
char *strerror (int ERRNUM) char *strerror (int ERRNUM)
char *strchr (const_char *STRING, int C) char *strchr (const char *STRING, int C)
char *strrchr (const_char *STRING, int C) char *strrchr (const char *STRING, int C)
char *strstr (const_char *HAYSTACK, const_char *NEEDLE) char *strstr (const char *HAYSTACK, const char *NEEDLE)
char *strcasestr (const_char *HAYSTACK, const_char *NEEDLE) char *strcasestr (const char *HAYSTACK, const char *NEEDLE)
size_t strcspn (const_char *STRING, const_char *STOPSET) size_t strcspn (const char *STRING, const char *STOPSET)
char * strpbrk (const_char *STRING, const_char *STOPSET) char * strpbrk (const char *STRING, const char *STOPSET)
char *strtok (char *NEWSTRING, const_char *DELIMITERS) char *strtok (char *NEWSTRING, const char *DELIMITERS)
char *strsep (char **STRING_PTR, const_char *DELIMITER) char *strsep (char **STRING_PTR, const char *DELIMITER)
from libc.string cimport const_char
# deprecated cimport for backwards compatibility:
from .string cimport const_char
cdef extern from "<string>" namespace "std": cdef extern from "<string>" namespace "std":
...@@ -12,8 +15,8 @@ cdef extern from "<string>" namespace "std": ...@@ -12,8 +15,8 @@ cdef extern from "<string>" namespace "std":
# as a string formed by a repetition of character c, n times. # as a string formed by a repetition of character c, n times.
string(size_t, char) nogil except + string(size_t, char) nogil except +
const_char* c_str() nogil const char* c_str() nogil
const_char* data() nogil const char* data() nogil
size_t size() nogil size_t size() nogil
size_t max_size() nogil size_t max_size() nogil
size_t length() nogil size_t length() nogil
......
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