Atlas - testsymbols.c
Home / ext / SDL / test Lines: 2 | Size: 3968 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 3 4 This software is provided 'as-is', without any express or implied 5 warranty. In no event will the authors be held liable for any damages 6 arising from the use of this software. 7 8 Permission is granted to anyone to use this software for any purpose, 9 including commercial applications, and to alter it and redistribute it 10 freely. 11*/ 12 13/* Test for availability of ALL SDL3 symbols */ 14 15#define SDL_DISABLE_ANALYZE_MACROS 16 17#include <SDL3/SDL.h> 18#include <SDL3/SDL_main.h> 19#include <SDL3/SDL_vulkan.h> 20 21#if !defined(SDL_PLATFORM_ANDROID) 22extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidActivity(void); 23extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidCachePath(void); 24extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidExternalStoragePath(void); 25extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidExternalStorageState(void); 26extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidInternalStoragePath(void); 27extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidJNIEnv(void); 28extern SDL_DECLSPEC void SDLCALL SDL_GetAndroidSDKVersion(void); 29extern SDL_DECLSPEC void SDLCALL SDL_IsChromebook(void); 30extern SDL_DECLSPEC void SDLCALL SDL_IsDeXMode(void); 31extern SDL_DECLSPEC void SDLCALL SDL_RequestAndroidPermission(void); 32extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); 33extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidMessage(void); 34extern SDL_DECLSPEC void SDLCALL SDL_ShowAndroidToast(void); 35#endif 36 37#if !defined(SDL_PLATFORM_GDK) 38extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(void); 39extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(void); 40extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); 41extern SDL_DECLSPEC void SDLCALL SDL_GetGDKDefaultUser(void); 42extern SDL_DECLSPEC void SDLCALL SDL_GetGDKTaskQueue(void); 43#endif 44 45#if !defined(SDL_PLATFORM_IOS) 46extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); 47extern SDL_DECLSPEC void SDLCALL SDL_SetiOSAnimationCallback(void); 48extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(void); 49#endif 50 51#if !defined(SDL_PLATFORM_LINUX) 52extern SDL_DECLSPEC void SDLCALL SDL_SetLinuxThreadPriority(void); 53extern SDL_DECLSPEC void SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(void); 54#endif 55 56#if !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)) 57extern SDL_DECLSPEC void SDLCALL SDL_GetDXGIOutputInfo(void); 58extern SDL_DECLSPEC void SDLCALL SDL_GetDirect3D9AdapterIndex(void); 59#endif 60 61#if !defined(SDL_PLATFORM_WINDOWS) 62extern SDL_DECLSPEC void SDLCALL SDL_RegisterApp(void); 63extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void); 64extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(void); 65#endif 66 67extern SDL_DECLSPEC void SDLCALL JNI_OnLoad(void); 68 69const static struct { 70 const char *name; 71 SDL_FunctionPointer address; 72} sdl_symbols[] = { 73 #define SDL_DYNAPI_PROC(rc, fn, params, args, ret) { #fn, (SDL_FunctionPointer)fn }, 74 #include "../src/dynapi/SDL_dynapi_procs.h" 75 #undef SDL_DYNAPI_PROC 76 { NULL, NULL } 77}; 78 79static void print_usage(const char *argv0) 80{ 81 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Usage: %s [number [number] ...]\n", argv0); 82} 83 84int main(int argc, char *argv[]) 85{ 86 static const int count_sdl_symbols = (int)SDL_arraysize(sdl_symbols) - 1; 87 int i; 88 int result = 0; 89 SDL_Log("There are %d SDL3 symbols", count_sdl_symbols); 90 for (i = 1; i < argc; i++) { 91 Sint64 symbol_index = -1; 92 char *endp = NULL; 93 symbol_index = (Sint64)SDL_strtol(argv[i], &endp, 10); 94 if (*endp != '\0') { 95 print_usage(argv[0]); 96 return 1; 97 } 98 if (symbol_index < 0 || symbol_index >= count_sdl_symbols) { 99 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Index %" SDL_PRIs64 " is out of range", symbol_index); 100 result = 1; 101 continue; 102 } 103 SDL_Log("Address of %s is %p", sdl_symbols[symbol_index].name, sdl_symbols[symbol_index].address); 104 } 105 return result; 106} 107[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.