Skip to content

Commit d2509c7

Browse files
authored
Merge pull request #26 from drakbar/arg_parsing
2 parents 10cf163 + 3521c90 commit d2509c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sdl3/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ def __class_getitem__(cls, key: tuple[str, type, list[type]]) -> type:
354354
SDL_ENUM: typing.TypeAlias = SDL_TYPE["SDL_ENUM", ctypes.c_int]
355355
SDL_VA_LIST: typing.TypeAlias = SDL_TYPE["SDL_VA_LIST", ctypes.c_char_p]
356356

357+
def SDL_PARSE_ARGUMENTS(argc: ctypes.c_int, argv: SDL_POINTER[ctypes.c_char_p]) -> typing.List[str]:
358+
return [SDL_DEREFERENCE(argv[i]).decode("utf-8") for i in range(argc)]
359+
357360
def SDL_PROCESS_DESCRIPTION(description: str, url: str | None = None, rst: bool = False) -> str:
358361
"""Process HTML description."""
359362

0 commit comments

Comments
 (0)