mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Massive automated renaming of all Py_/PyObject/etc. prefixes to Ty_/TyObject/etc. This includes: - All public API types (TyObject, TyTypeObject, etc.) - All public API functions (Ty_Initialize, Ty_BuildValue, etc.) - All internal API (_Ty_ prefixes) - Reference counting macros (Ty_INCREF, Ty_DECREF, etc.) - Type flags (Ty_TPFLAGS_*) - Debug flags (Ty_DEBUG, Ty_TRACE_REFS, etc.) - All object type APIs (TyList_, TyDict_, TyUnicode_, etc.) This changes over 60,000 occurrences across 1000+ files. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
63 lines
1.4 KiB
C
63 lines
1.4 KiB
C
#ifndef Ty_FILEUTILS_H
|
|
#define Ty_FILEUTILS_H
|
|
|
|
/*******************************
|
|
* stat() and fstat() fiddling *
|
|
*******************************/
|
|
|
|
#ifdef HAVE_SYS_STAT_H
|
|
# include <sys/stat.h> // S_ISREG()
|
|
#elif defined(HAVE_STAT_H)
|
|
# include <stat.h> // S_ISREG()
|
|
#endif
|
|
|
|
#ifndef S_IFMT
|
|
// VisualAge C/C++ Failed to Define MountType Field in sys/stat.h.
|
|
# define S_IFMT 0170000
|
|
#endif
|
|
#ifndef S_IFLNK
|
|
// Windows doesn't define S_IFLNK, but posixmodule.c maps
|
|
// IO_REPARSE_TAG_SYMLINK to S_IFLNK.
|
|
# define S_IFLNK 0120000
|
|
#endif
|
|
#ifndef S_ISREG
|
|
# define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
|
|
#endif
|
|
#ifndef S_ISDIR
|
|
# define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
|
|
#endif
|
|
#ifndef S_ISCHR
|
|
# define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR)
|
|
#endif
|
|
#ifndef S_ISLNK
|
|
# define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
|
|
#endif
|
|
|
|
|
|
// Move this down here since some C++ #include's don't like to be included
|
|
// inside an extern "C".
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#if !defined(Ty_LIMITED_API) || Ty_LIMITED_API+0 >= 0x03050000
|
|
PyAPI_FUNC(wchar_t *) Ty_DecodeLocale(
|
|
const char *arg,
|
|
size_t *size);
|
|
|
|
PyAPI_FUNC(char*) Ty_EncodeLocale(
|
|
const wchar_t *text,
|
|
size_t *error_pos);
|
|
#endif
|
|
|
|
#ifndef Ty_LIMITED_API
|
|
# define Ty_CPYTHON_FILEUTILS_H
|
|
# include "cpython/fileutils.h"
|
|
# undef Ty_CPYTHON_FILEUTILS_H
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Ty_FILEUTILS_H */
|