libgdx-packr

repository·master·Indexed 25 days ago

https://github.com/libgdx/packr

A repository containing PackrLauncher, which provides native code to launch a Java Virtual Machine (JVM) using a custom executable, and dropt, a minimalistic, portable C99 library for command-line option parsing featuring a callback-based architecture and GNU-style long options.

Tokens
908
Snippets
0
Records
7
Agent score
81%

What's inside libgdx-packr

  1. Overview of dropt

    master
    dropt (deliberately rudimentary options) is a minimalistic C library designed for parsing command-line options. It is written in standard C99 with high portability and minimal dependencies (only the standard C library). It is designed to be easily consumable by C and provides C++ wrappers for convenience.
  2. Customize gtest.h via macro definitions

    master

    You can inject custom configurations into GoogleTest by defining specific macros before including gtest.h. This allows you to provide custom implementations for stack trace retrieval and temporary directory management.

    Available macros:

    • GTEST_OS_STACK_TRACE_GETTER_: The name of an implementation of OsStackTraceGetterInterface.
    • GTEST_CUSTOM_TEMPDIR_FUNCTION_: An override for testing::TempDir(). The implementation must match the semantics and signature of testing::TempDir.
  3. Customize gtest-port.h via macro definitions

    master

    The gtest-port.h header allows for deep customization of GoogleTest's core behaviors, including logging, threading, and symbol exporting. This is typically used when porting GoogleTest to environments with non-standard library support.

    Logging

    Define the following macros and provide implementations for LogToStderr() and FlushInfoLog():

    • GTEST_LOG_(severity)
    • GTEST_CHECK_(condition)

    Threading

    Define these macros to indicate existing support for threading primitives:

    • GTEST_HAS_NOTIFICATION_: Set if Notification is already provided.
    • GTEST_HAS_MUTEX_AND_THREAD_LOCAL_: Set if Mutex and ThreadLocal are already provided. If set, you must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and GTEST_DEFINE_STATIC_MUTEX_(mutex).
    • GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
    • GTEST_LOCK_EXCLUDED_(locks)

    Library Support & API Exporting

    • GTEST_HAS_CXXABI_H_: Indicates support for <cxxabi.h>.
    • GTEST_API_: A specifier used for exporting API symbols (e.g., for DLL/shared library visibility).
  4. Limitations and non-features of dropt

    master

    When integrating dropt, be aware of the following:

    • No localization: It does not provide facilities for localizing help text.
    • No shell tokenization: It does not tokenize a single command-line string into an argv array. On Windows, you should use CommandLineToArgvW or the __argv global from the Microsoft C runtime library.
    • No argument permutation: dropt expects all options to appear before non-option arguments.
    • No multiple option styles: It does not support mixing different styles (like /option vs -option) and encourages a consistent interface.
  5. Key features of dropt

    master

    dropt provides several standard command-line parsing features:

    • GNU-style long options: e.g., --option.
    • Short option grouping: e.g., -abc is treated as -a -b -c.
    • Argument syntax: Arguments can be specified using the = sign (e.g., --option=1 or -x=1).
    • End-of-options marker: Automatically stops parsing when encountering --, allowing subsequent arguments to start with - without being treated as options.
    • Overridable values: Supports overriding option values (e.g., --option=1 --option=2 uses the last value). Boolean flags can be explicitly disabled using --flag=0 (while --flag is shorthand for --flag=1).
    • Callback-based architecture: All options, including basic types like integers and strings, are handled via callbacks, allowing for high flexibility and custom logic.