diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /library/python/symbols | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/python/symbols')
-rw-r--r-- | library/python/symbols/libc/syms.cpp | 138 | ||||
-rw-r--r-- | library/python/symbols/libc/ya.make | 28 | ||||
-rw-r--r-- | library/python/symbols/module/module.cpp | 84 | ||||
-rw-r--r-- | library/python/symbols/module/ya.make | 10 | ||||
-rw-r--r-- | library/python/symbols/python/syms.cpp | 32 | ||||
-rw-r--r-- | library/python/symbols/python/ut/py2/ya.make | 16 | ||||
-rw-r--r-- | library/python/symbols/python/ut/py3/ya.make | 18 | ||||
-rw-r--r-- | library/python/symbols/python/ut/test_ctypes.py | 2 | ||||
-rw-r--r-- | library/python/symbols/python/ut/ya.make | 12 | ||||
-rw-r--r-- | library/python/symbols/python/ya.make | 26 | ||||
-rw-r--r-- | library/python/symbols/ya.make | 8 |
11 files changed, 187 insertions, 187 deletions
diff --git a/library/python/symbols/libc/syms.cpp b/library/python/symbols/libc/syms.cpp index 0d57b00b99c..6c04a7ef6e5 100644 --- a/library/python/symbols/libc/syms.cpp +++ b/library/python/symbols/libc/syms.cpp @@ -1,38 +1,38 @@ #include <util/system/platform.h> - + #include <library/python/symbols/registry/syms.h> #if !defined(_MSC_VER) -#if __has_include(<aio.h>) -#include <aio.h> -#endif -#include <arpa/inet.h> -#include <dirent.h> -#include <ifaddrs.h> -#include <netdb.h> -#include <pthread.h> -#include <pwd.h> -#include <sched.h> -#include <semaphore.h> -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> +#if __has_include(<aio.h>) +#include <aio.h> +#endif +#include <arpa/inet.h> +#include <dirent.h> +#include <ifaddrs.h> +#include <netdb.h> +#include <pthread.h> +#include <pwd.h> +#include <sched.h> +#include <semaphore.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> #include <errno.h> #include <sys/ipc.h> #include <dlfcn.h> #if defined(_linux_) #include <sys/prctl.h> -#include <sys/ptrace.h> +#include <sys/ptrace.h> #include <sys/sendfile.h> #else #include <sys/types.h> #include <sys/socket.h> #include <sys/uio.h> #endif - + #if defined(_darwin_) #include <sys/types.h> #include <sys/sysctl.h> @@ -97,61 +97,61 @@ namespace { } BEGIN_SYMS("c") - -SYM(calloc) -SYM(clock_gettime) + +SYM(calloc) +SYM(clock_gettime) SYM_2("clock_getres", ClockGetres) -SYM(closedir) +SYM(closedir) SYM(fdopen) SYM(fflush) -SYM(freeifaddrs) -SYM(ftok) -SYM(getifaddrs) -SYM(getnameinfo) -SYM(getpwnam) -SYM(inet_ntop) -SYM(opendir) -SYM(printf) -SYM(pthread_kill) -SYM(pthread_self) -SYM(readdir_r) -SYM(sem_close) -SYM(sem_getvalue) -SYM(sem_open) -SYM(sem_post) -SYM(sem_trywait) -SYM(sem_unlink) -SYM(sem_wait) -SYM(siginterrupt) -SYM(strdup) +SYM(freeifaddrs) +SYM(ftok) +SYM(getifaddrs) +SYM(getnameinfo) +SYM(getpwnam) +SYM(inet_ntop) +SYM(opendir) +SYM(printf) +SYM(pthread_kill) +SYM(pthread_self) +SYM(readdir_r) +SYM(sem_close) +SYM(sem_getvalue) +SYM(sem_open) +SYM(sem_post) +SYM(sem_trywait) +SYM(sem_unlink) +SYM(sem_wait) +SYM(siginterrupt) +SYM(strdup) SYM(sendfile) SYM(strtod) SYM_2("__errno_location", ErrnoLocation) - -#if defined(_linux_) -SYM(prctl) -SYM(ptrace) -SYM(sched_getaffinity) -SYM(sched_setaffinity) -SYM(sem_timedwait) -SYM(inotify_init) -SYM(inotify_add_watch) -SYM(inotify_rm_watch) + +#if defined(_linux_) +SYM(prctl) +SYM(ptrace) +SYM(sched_getaffinity) +SYM(sched_setaffinity) +SYM(sem_timedwait) +SYM(inotify_init) +SYM(inotify_add_watch) +SYM(inotify_rm_watch) SYM(mlockall) -#endif - -#if defined(_darwin_) -SYM(mach_absolute_time) -SYM(mach_timebase_info) -SYM(sysctlbyname) -#endif - -#if __has_include(<aio.h>) -SYM(aio_error) -SYM(aio_read) -SYM(aio_return) -SYM(aio_suspend) -#endif - -END_SYMS() +#endif + +#if defined(_darwin_) +SYM(mach_absolute_time) +SYM(mach_timebase_info) +SYM(sysctlbyname) +#endif + +#if __has_include(<aio.h>) +SYM(aio_error) +SYM(aio_read) +SYM(aio_return) +SYM(aio_suspend) +#endif + +END_SYMS() #endif diff --git a/library/python/symbols/libc/ya.make b/library/python/symbols/libc/ya.make index d8ab0acb635..7b84cbc9617 100644 --- a/library/python/symbols/libc/ya.make +++ b/library/python/symbols/libc/ya.make @@ -1,19 +1,19 @@ LIBRARY() - + OWNER(pg orivej) - -PEERDIR( + +PEERDIR( library/python/symbols/registry -) - +) + IF (GCC OR CLANG) - CFLAGS( - -Wno-deprecated-declarations # For sem_getvalue. - ) -ENDIF() - -SRCS( + CFLAGS( + -Wno-deprecated-declarations # For sem_getvalue. + ) +ENDIF() + +SRCS( GLOBAL syms.cpp -) - -END() +) + +END() diff --git a/library/python/symbols/module/module.cpp b/library/python/symbols/module/module.cpp index d3d511b7791..92bc7f4d67d 100644 --- a/library/python/symbols/module/module.cpp +++ b/library/python/symbols/module/module.cpp @@ -1,9 +1,9 @@ -#include <Python.h> - +#include <Python.h> + #include <library/python/symbols/registry/syms.h> -#include <util/generic/string.h> - +#include <util/generic/string.h> + #define CAP(x) SYM_2(x, x) BEGIN_SYMS("_capability") @@ -44,42 +44,42 @@ namespace { } } -static void DictSetStringPtr(PyObject* dict, const char* name, void* value) { - PyObject* p = PyLong_FromVoidPtr(value); - PyDict_SetItemString(dict, name, p); - Py_DECREF(p); -} - -static PyObject* InitSyms(PyObject* m) { - if (!m) - return NULL; - PyObject* d = PyDict_New(); - if (!d) - return NULL; - - auto f = [&](const char* mod, const char* name, void* sym) { - DictSetStringPtr(d, (TString(mod) + "|" + TString(name)).c_str(), sym); - }; - - auto cb = MakeTCB(f); - - ForEachSymbol(cb); - - if (PyObject_SetAttrString(m, "syms", d)) - m = NULL; - Py_DECREF(d); - return m; +static void DictSetStringPtr(PyObject* dict, const char* name, void* value) { + PyObject* p = PyLong_FromVoidPtr(value); + PyDict_SetItemString(dict, name, p); + Py_DECREF(p); +} + +static PyObject* InitSyms(PyObject* m) { + if (!m) + return NULL; + PyObject* d = PyDict_New(); + if (!d) + return NULL; + + auto f = [&](const char* mod, const char* name, void* sym) { + DictSetStringPtr(d, (TString(mod) + "|" + TString(name)).c_str(), sym); + }; + + auto cb = MakeTCB(f); + + ForEachSymbol(cb); + + if (PyObject_SetAttrString(m, "syms", d)) + m = NULL; + Py_DECREF(d); + return m; +} + +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef module = { + PyModuleDef_HEAD_INIT, "syms", NULL, -1, NULL, NULL, NULL, NULL, NULL}; + +extern "C" PyObject* PyInit_syms() { + return InitSyms(PyModule_Create(&module)); +} +#else +extern "C" void initsyms() { + InitSyms(Py_InitModule("syms", NULL)); } - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef module = { - PyModuleDef_HEAD_INIT, "syms", NULL, -1, NULL, NULL, NULL, NULL, NULL}; - -extern "C" PyObject* PyInit_syms() { - return InitSyms(PyModule_Create(&module)); -} -#else -extern "C" void initsyms() { - InitSyms(Py_InitModule("syms", NULL)); -} -#endif +#endif diff --git a/library/python/symbols/module/ya.make b/library/python/symbols/module/ya.make index f84d3c268e4..78e30f25478 100644 --- a/library/python/symbols/module/ya.make +++ b/library/python/symbols/module/ya.make @@ -1,11 +1,11 @@ -PY23_LIBRARY() +PY23_LIBRARY() OWNER(pg orivej) -NO_PYTHON_INCLUDES() - +NO_PYTHON_INCLUDES() + PEERDIR( - contrib/libs/python/Include + contrib/libs/python/Include ) SRCS( @@ -13,7 +13,7 @@ SRCS( ) PY_REGISTER( - library.python.symbols.module.syms + library.python.symbols.module.syms ) PY_SRCS( diff --git a/library/python/symbols/python/syms.cpp b/library/python/symbols/python/syms.cpp index 46fbd25dc20..9b52574cb1b 100644 --- a/library/python/symbols/python/syms.cpp +++ b/library/python/symbols/python/syms.cpp @@ -1,17 +1,17 @@ -#define SYM(SYM_NAME) extern "C" void SYM_NAME(); -SYM(PyObject_GetBuffer) -SYM(PyBuffer_Release) -SYM(PyCell_New) -SYM(Py_DecRef) -SYM(Py_IncRef) -#undef SYM - -#include <library/python/symbols/registry/syms.h> - -BEGIN_SYMS("python") -SYM(PyObject_GetBuffer) -SYM(PyBuffer_Release) +#define SYM(SYM_NAME) extern "C" void SYM_NAME(); +SYM(PyObject_GetBuffer) +SYM(PyBuffer_Release) SYM(PyCell_New) -SYM(Py_DecRef) -SYM(Py_IncRef) -END_SYMS() +SYM(Py_DecRef) +SYM(Py_IncRef) +#undef SYM + +#include <library/python/symbols/registry/syms.h> + +BEGIN_SYMS("python") +SYM(PyObject_GetBuffer) +SYM(PyBuffer_Release) +SYM(PyCell_New) +SYM(Py_DecRef) +SYM(Py_IncRef) +END_SYMS() diff --git a/library/python/symbols/python/ut/py2/ya.make b/library/python/symbols/python/ut/py2/ya.make index 110c9f7c758..214194de57b 100644 --- a/library/python/symbols/python/ut/py2/ya.make +++ b/library/python/symbols/python/ut/py2/ya.make @@ -1,9 +1,9 @@ PY2TEST() - -OWNER(orivej) - -PEERDIR( - library/python/symbols/python/ut -) - -END() + +OWNER(orivej) + +PEERDIR( + library/python/symbols/python/ut +) + +END() diff --git a/library/python/symbols/python/ut/py3/ya.make b/library/python/symbols/python/ut/py3/ya.make index a5e2a0d8440..76611c6a194 100644 --- a/library/python/symbols/python/ut/py3/ya.make +++ b/library/python/symbols/python/ut/py3/ya.make @@ -1,9 +1,9 @@ -PY3TEST() - -OWNER(orivej) - -PEERDIR( - library/python/symbols/python/ut -) - -END() +PY3TEST() + +OWNER(orivej) + +PEERDIR( + library/python/symbols/python/ut +) + +END() diff --git a/library/python/symbols/python/ut/test_ctypes.py b/library/python/symbols/python/ut/test_ctypes.py index ff0d37ef1ac..253a10d8b32 100644 --- a/library/python/symbols/python/ut/test_ctypes.py +++ b/library/python/symbols/python/ut/test_ctypes.py @@ -34,4 +34,4 @@ def get_buffer(obj): def test_buffer(): - assert get_buffer(b'test string') + assert get_buffer(b'test string') diff --git a/library/python/symbols/python/ut/ya.make b/library/python/symbols/python/ut/ya.make index 019017f945c..2849e01b1e0 100644 --- a/library/python/symbols/python/ut/ya.make +++ b/library/python/symbols/python/ut/ya.make @@ -1,16 +1,16 @@ -PY23_LIBRARY() +PY23_LIBRARY() OWNER(orivej) TEST_SRCS(test_ctypes.py) PEERDIR( - library/python/symbols/python + library/python/symbols/python ) END() -RECURSE_FOR_TESTS( - py2 - py3 -) +RECURSE_FOR_TESTS( + py2 + py3 +) diff --git a/library/python/symbols/python/ya.make b/library/python/symbols/python/ya.make index 5a1922861c3..6bfd54f8bcc 100644 --- a/library/python/symbols/python/ya.make +++ b/library/python/symbols/python/ya.make @@ -1,15 +1,15 @@ -LIBRARY() - -OWNER(orivej) - -PEERDIR( - library/python/symbols/registry -) - -SRCS( - GLOBAL syms.cpp -) - -END() +LIBRARY() + +OWNER(orivej) + +PEERDIR( + library/python/symbols/registry +) + +SRCS( + GLOBAL syms.cpp +) + +END() RECURSE_FOR_TESTS(ut) diff --git a/library/python/symbols/ya.make b/library/python/symbols/ya.make index 4729699d3b8..340a710c487 100644 --- a/library/python/symbols/ya.make +++ b/library/python/symbols/ya.make @@ -1,12 +1,12 @@ RECURSE( module registry - tests - - crypto + tests + + crypto libc libmagic - python + python uuid win_unicode_console ) |