Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

lib
(lib globals)

   in adts.h
   in allocators.h
   in app_hooks.h
   in base32.h
   in bits.h
   in byte_order.h
   in cache_adt.h
   in code_annotation.h
   in config.h
   in debug.h
   in debug_stl.h
   in fnv_hash.h
   in input.h
   in lib.h
   in lib_errors.h
   in lockfree.h
   in mmgr.h
   in module_init.h
   in ogl.h
   in path_util.h
   in rand.h
   in regex.h
   in secure_crt.h
   in self_test.h
   in timer.h
   in types.h
   in allocators.h
   in bits.h
   in cache_adt.h
   in debug.h
   in debug_stl.h
   in lib.h
   in self_test.h
   in allocators.cpp
   in app_hooks.cpp
   in debug_stl.cpp
   in ogl.cpp
   in secure_crt.cpp
   in timer.cpp
   in wsecure_crt.cpp
   in allocators.cpp
   in app_hooks.cpp
   in base32.cpp
   in bits.cpp
   in byte_order.cpp
   in debug.cpp
   in debug_stl.cpp
   in fnv_hash.cpp
   in input.cpp
   in lib.cpp
   in lib_errors.cpp
   in lockfree.cpp
   in mmgr.cpp
   in module_init.cpp
   in ogl.cpp
   in path_util.cpp
   in rand.cpp
   in regex.cpp
   in secure_crt.cpp
   in timer.cpp

(lib globals)


Field Summary
 static intptr_t active_data_structures
          See lockfree.cpp
 static intptr_t active_threads
          See lockfree.cpp
 static AppHooks ah
          See app_hooks.cpp
 static const size_t ALIGN
          See allocators.cpp
 static LibErrorAssociation* associations
          ========================================================================= File : lib_errors.
 const size_t BUCKET_SIZE
          See allocators.cpp
 static TimerClient* clients
          See timer.cpp
 const int DA_NOT_OUR_MEM
          See allocators.cpp
 const size_t DBG_FILE_LEN
          does the given pointer appear to point to code?
 const size_t DBG_SYMBOL_LEN
          maximum number of characters (including trailing \0) written to user's buffers by debug_resolve_symbol.
 wchar_t[ LOG_CHARS ] debug_log
          See debug.cpp
 wchar_t* debug_log_pos
          See debug.cpp
 const size_t DEBUG_STL_MAX_ITERATOR_SIZE
          no STL iterator is larger than this; see below.
 const u8 DEBUG_SUPPRESS
          value for suppress flag once set by debug_display_error.
 static AppHooks default_ah
          See app_hooks.cpp
 static bool exit_requested
          See debug.cpp
 static LibError expected_err
          See debug.cpp
 static uintptr_t expected_err_valid
          See debug.cpp
 static const char* exts
          ========================================================================= File : ogl.
 static FILE* f
          See input.cpp
 int fps
          See timer.cpp
 u32 game_ticks
          See input.cpp
 const size_t GiB
          number of array elements
 static InHandler[ MAX_HANDLERS ] handler_stack
          See input.cpp
 static uint handler_stack_top
          See input.cpp
 static uint hash_jumps
          See debug.cpp
 static bool have_12
          See ogl.cpp
 static bool have_13
          See ogl.cpp
 static bool have_14
          See ogl.cpp
 static bool have_20
          See ogl.cpp
 static ModuleInitState initState
          See lockfree.cpp
 const size_t KiB
          low-level aka "lib" ------------------- this codebase was grown from modules shared between several projects, i.
 static const size_t LOG_CHARS
          See debug.cpp
 static const int MAX_CHARS
          See debug.cpp
 const uint MAX_HANDLERS
          ========================================================================= File : input.
 static const size_t MAX_RETIRED
          See lockfree.cpp
 static const uint MAX_SYMBOLS
          See debug.cpp
 static const uint MAX_TAGS
          See debug.cpp
 static const size_t message_size_bytes
          See debug.cpp
 const size_t MiB
          See lib.h
 static const int mmap_flags
          See allocators.cpp
 static const ModuleInitState MODULE_ERROR
          See module_init.cpp
 static const ModuleInitState MODULE_UNINITIALIZED
          ========================================================================= File : module_init.
 static u32 next_ev_time
          See input.cpp
 static uint num_clients
          See timer.cpp
 static const uint NUM_HPS
          ========================================================================= File : lockfree.
 static uint num_tags
          See debug.cpp
 GLint ogl_max_tex_size
          See ogl.cpp
 GLint ogl_max_tex_units
          See ogl.cpp
 const size_t POOL_VARIABLE_ALLOCS
          pass as pool_create's param to indicate variable-sized allocs are required (see below).
 float spf
          See timer.cpp
  state
          See input.cpp
 static char* string_buf
          See debug.cpp
 static char* string_buf_pos
          See debug.cpp
 static const size_t STRING_BUF_SIZE
          See debug.cpp
 static Symbol* symbols
          See debug.cpp
 static u32[ MAX_TAGS ] tags
          See debug.cpp
 static u32 time_adjust
          See input.cpp
 static pthread_key_t tls_key
          See debug.cpp
 static TLS* tls_list
          See lockfree.cpp
 static pthread_once_t tls_once
          See debug.cpp
 static uint total_symbols
          See debug.cpp
 static const uint XRAND_MAX
          ========================================================================= File : rand.
 
Method Summary
 u16 addusw( u16 x, u16 y )
          ========================================================================= File : lib.
 void ah_bundle_logs( FILE* f )
          See app_hooks.cpp
 ErrorReaction ah_display_error( const wchar_t* text, uint flags )
          See app_hooks.cpp
 const char* ah_get_log_dir( void )
          See app_hooks.cpp
 void ah_log( const wchar_t* text )
          See app_hooks.cpp
 void ah_override_gl_upload_caps( void )
          See app_hooks.cpp
 const wchar_t* ah_translate( const wchar_t* text )
          See app_hooks.cpp
 void ah_translate_free( const wchar_t* text )
          See app_hooks.cpp
 bool app_hook_was_redefined( size_t offset_in_struct )
          See app_hooks.cpp
 void app_hooks_update( AppHooks* new_ah )
          See app_hooks.cpp
 static const LibErrorAssociation* AssociationFromErrno( errno_t errno_equivalent )
          See lib_errors.cpp
 static const LibErrorAssociation* AssociationFromLibError( LibError err )
          See lib_errors.cpp
 void base32( const size_t in_len, const u8* in, u8* out )
          ========================================================================= File : base32.
 inline uint bit_mask( uint num_bits )
          a mask that includes the lowest N bits
 inline u64 bit_mask64( uint num_bits )
          See bits.h
 inline uint bits( uint num, uint lo_idx, uint hi_idx )
          extract the value of bits hi_idx:lo_idx within num example: bits(0x69, 2, 5) == 0x0A
 inline u64 bits64( u64 num, uint lo_idx, uint hi_idx )
          See bits.h
 void* bucket_alloc( Bucket* b, size_t size )
          See allocators.cpp
 LibError bucket_create( Bucket* b, size_t el_size )
          See allocators.cpp
 void bucket_destroy( Bucket* b )
          See allocators.cpp
 void bucket_free( Bucket* b, void* el )
          See allocators.cpp
 void calc_fps()
          See timer.cpp
 static ErrorReaction call_display_error( const wchar_t* text, uint flags )
          See debug.cpp
 static ErrorReaction carry_out_ErrorReaction( ErrorReaction er, uint flags, u8* suppress )
          See debug.cpp
  cassert( sizeof( int )* CHAR_BIT == 32 )
          See bits.cpp
 uint ceil_log2( uint x )
          See bits.cpp
 static LFList* chain( LFHash* hash, uintptr_t key )
          See lockfree.cpp
 static bool container_valid( const void* front, size_t el_count )
          See debug_stl.cpp
 LibError da_alloc( DynArray* da, size_t max_size )
          See allocators.cpp
 LibError da_append( DynArray* da, const void* data, size_t size )
          See allocators.cpp
 LibError da_free( DynArray* da )
          See allocators.cpp
 LibError da_read( DynArray* da, void* data, size_t size )
          See allocators.cpp
 LibError da_reserve( DynArray* da, size_t size )
          See allocators.cpp
 LibError da_set_prot( DynArray* da, int prot )
          See allocators.cpp
 LibError da_set_size( DynArray* da, size_t new_size )
          See allocators.cpp
 LibError da_wrap_fixed( DynArray* da, u8* p, size_t size )
          See allocators.cpp
 ErrorReaction debug_assert_failed( const char* expr, u8* suppress, const char* file, int line, const char* func )
          See debug.cpp
 ErrorReaction debug_display_error( const wchar_t* description, uint flags, uint skip, void* context, const char* file, int line, const char* func, u8* suppress )
          See debug.cpp
 void debug_display_msgw( const wchar_t* caption, const wchar_t* msg )
          See debug.cpp
 const wchar_t* debug_error_message_build( const wchar_t* description, const char* fn_only, int line, const char* func, uint skip, void* context, ErrorMessageMem* emm )
          See debug.cpp
 void debug_error_message_free( ErrorMessageMem* emm )
          See debug.cpp
 void debug_filter_add( const char* tag )
          See debug.cpp
 bool debug_filter_allows( const char* text )
          See debug.cpp
 void debug_filter_clear()
          See debug.cpp
 void debug_filter_remove( const char* tag )
          See debug.cpp
 const char* debug_get_symbol_string( void* symbol, const char* name, const char* file, int line )
          See debug.cpp
 const char* debug_get_thread_name()
          See debug.cpp
 void debug_printf( const char* fmt,... )
          See debug.cpp
 void debug_set_thread_name( const char* name )
          See debug.cpp
 void debug_shutdown()
          See debug.cpp
 void debug_skip_next_assert()
          See debug.cpp
 void debug_skip_next_err( LibError err )
          See debug.cpp
 char* debug_stl_simplify_name( char* name )
          See debug_stl.cpp
 ErrorReaction debug_warn_err( LibError err, u8* suppress, const char* file, int line, const char* func )
          See debug.cpp
 void debug_wprintf( const wchar_t* fmt,... )
          See debug.cpp
 void debug_wprintf_mem( const wchar_t* fmt,... )
          See debug.cpp
 LibError debug_write_crashlog( const wchar_t* text )
          storage for and construction of strings describing a symbol
 static void def_bundle_logs( FILE* UNUSED( f ) )
          See app_hooks.cpp
 static ErrorReaction def_display_error( const wchar_t* UNUSED( text ), uint UNUSED( flags ) )
          See app_hooks.cpp
 static const char* def_get_log_dir()
          See app_hooks.cpp
 static void def_log( const wchar_t* text )
          See app_hooks.cpp
 static void def_override_gl_upload_caps()
          ========================================================================= File : app_hooks.
 static const wchar_t* def_translate( const wchar_t* text )
          See app_hooks.cpp
 static void def_translate_free( const wchar_t* UNUSED( text ) )
          See app_hooks.cpp
 static void dispatch_ev( const SDL_Event_* ev )
          See input.cpp
 static void dump_gl_error( GLenum err )
          See ogl.cpp
 int error_AddAssociation( LibErrorAssociation* lea )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_6,"Case 6",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_7,"Case 7",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::INVALID_HANDLE,"Invalid Handle (argument)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_21,"Case 21",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_19,"Case 19",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::STRING_NOT_TERMINATED,"Invalid string (no 0 terminator found in buffer)",-1 )
          ========================================================================= File : secure_crt.
  ERROR_ASSOCIATE( ERR::PATH_COMPONENT_SEPARATOR,"Path component contains dir separator",-1 )
          See path_util.cpp
  ERROR_ASSOCIATE( ERR::PATH_NON_CANONICAL,"Path contains unsupported .. or ./",-1 )
          See path_util.cpp
  ERROR_ASSOCIATE( ERR::PATH_NON_PORTABLE,"Path contains OS-specific dir separator",-1 )
          See path_util.cpp
  ERROR_ASSOCIATE( ERR::PATH_NOT_RELATIVE,"Path is not relative",-1 )
          See path_util.cpp
  ERROR_ASSOCIATE( ERR::STL_CNT_UNKNOWN,"Unknown STL container type_name",-1 )
          ========================================================================= File : debug_stl.
  ERROR_ASSOCIATE( INFO::CANNOT_HANDLE,"Cannot handle (not an error)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::NO_MEM,"Not enough memory", ENOMEM )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::NOT_SUPPORTED,"Feature isn't and won't be supported",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::PATH_EMPTY,"Path is an empty string",-1 )
          See path_util.cpp
  ERROR_ASSOCIATE( ERR::NOT_IMPLEMENTED,"Feature currently not implemented", ENOSYS )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::PATH_LENGTH,"Path exceeds PATH_MAX characters", ENAMETOOLONG )
          ========================================================================= File : path_util.
  ERROR_ASSOCIATE( ERR::NO_SYS,"OS doesn't provide a required API",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::LIMIT,"Fixed limit exceeded",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::MEM_OVERWRITTEN,"Wrote to memory outside valid allocation",-1 )
          See mmgr.cpp
  ERROR_ASSOCIATE( ERR::MEM_ALLOC_NOT_FOUND,"Not a valid allocated address",-1 )
          ========================================================================= File : mmgr.
  ERROR_ASSOCIATE( ERR::SYM_NO_STACK_FRAMES_FOUND,"No stack frames found",-1 )
          ========================================================================= File : debug.
  ERROR_ASSOCIATE( ERR::SYM_UNRETRIEVABLE_STATIC,"Value unretrievable (stored in external module)",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::SYM_UNRETRIEVABLE_REG,"Value unretrievable (stored in register)",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::SYM_TYPE_INFO_UNAVAILABLE,"Error getting type_info",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::SYM_INTERNAL_ERROR,"Exception raised while processing a symbol",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::SYM_UNSUPPORTED,"Symbol type not (fully) supported",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::SYM_CHILD_NOT_FOUND,"Symbol does not have the given child",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::SYM_NESTING_LIMIT,"Symbol nesting too deep or infinite recursion",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::SYM_SINGLE_SYMBOL_LIMIT,"Symbol has produced too much output",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( INFO::SYM_SUPPRESS_OUTPUT,"Symbol was suppressed",-1 )
          See debug.cpp
  ERROR_ASSOCIATE( ERR::AGAIN,"Try again later",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::BUF_SIZE,"Buffer argument too small",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::INVALID_PARAM,"Invalid function argument", EINVAL )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::CORRUPTED,"File/memory data is corrupted",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::REENTERED,"Single-call function was reentered",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::TIMED_OUT,"Timed out",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::LOGIC,"Logic error in code",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( INFO::ALREADY_EXISTS,"Already exists (not an error)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( INFO::ALL_COMPLETE,"All complete (not an error)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_16,"Case 16",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( INFO::SKIPPED,"Skipped (not an error)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( INFO::CB_CONTINUE,"Continue (not an error)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::FAIL,"Function failed (no details available)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( INFO::OK,"(but return value was 0 which indicates success)",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_2,"Case 2",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_1,"Case 1",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_3,"Case 3",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_4,"Case 4",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_5,"Case 5",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_29,"Case 29",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_28,"Case 28",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_27,"Case 27",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_26,"Case 26",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_25,"Case 25",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_24,"Case 24",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_23,"Case 23",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_22,"Case 22",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_9,"Case 9",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_8,"Case 8",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_18,"Case 18",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_17,"Case 17",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::STL_CNT_INVALID,"Container type is known but contents are invalid",-1 )
          See debug_stl.cpp
  ERROR_ASSOCIATE( ERR::_14,"Case 14",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_11,"Case 11",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_12,"Case 12",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_13,"Case 13",-1 )
          See lib_errors.cpp
  ERROR_ASSOCIATE( ERR::_15,"Case 15",-1 )
          See lib_errors.cpp
 char* error_description_r( LibError err, char* buf, size_t max_chars )
          See lib_errors.cpp
 inline bool feq( double d1, double d2, double epsilon = 0. 00001 )
          are the given floats nearly "equal"?
 inline bool feqf( float f1, float f2, float epsilon = 0. 001f )
          See lib.h
 int floor_log2( const float x )
          See bits.cpp
 u32 fnv_hash( const void* buf, size_t len )
          ========================================================================= File : fnv_hash.
 u64 fnv_hash64( const void* buf, size_t len )
          See fnv_hash.cpp
 u32 fnv_lc_hash( const char* str, size_t len )
          See fnv_hash.cpp
 static void* freelist_pop( void** pfreelist )
          See allocators.cpp
 static void freelist_push( void** pfreelist, void* el )
          See allocators.cpp
 static size_t get_page_size()
          ========================================================================= File : allocators.
 double get_time()
          See timer.cpp
 static uint hash( void* symbol )
          See debug.cpp
 static void importExtensionFunctions()
          See ogl.cpp
 void in_add_handler( InHandler handler )
          See input.cpp
 void in_dispatch_event( const SDL_Event_* ev )
          See input.cpp
 void in_dispatch_recorded_events()
          See input.cpp
 LibError in_playback( const char* fn )
          See input.cpp
 LibError in_record( const char* fn )
          See input.cpp
 void in_stop()
          See input.cpp
 static inline bool is_marked_as_deleted( Node* p )
          See lockfree.cpp
 static bool is_node_referenced( Node* node, void** hps, size_t num_hps )
          See lockfree.cpp
 static inline bool is_page_multiple( uintptr_t x )
          See allocators.cpp
 bool is_pow2( uint n )
          ========================================================================= File : bits.
 static bool isImplementedInCore( const char* ext )
          See ogl.cpp
 inline bool IsSimilarMagnitude( double d1, double d2, const double relativeErrorTolerance = 0. 05 )
          return upper 32-bits
 static void LatchStartTime()
          ========================================================================= File : timer.
 LibError lfh_erase( LFHash* hash, uintptr_t key )
          See lockfree.cpp
 void* lfh_find( LFHash* hash, uintptr_t key )
          See lockfree.cpp
 void lfh_free( LFHash* hash )
          See lockfree.cpp
 LibError lfh_init( LFHash* hash, size_t num_entries )
          See lockfree.cpp
 void* lfh_insert( LFHash* hash, uintptr_t key, size_t additional_bytes, int* was_inserted )
          See lockfree.cpp
 LibError lfl_erase( LFList* list, uintptr_t key )
          lock-free hash table
 void* lfl_find( LFList* list, uintptr_t key )
          See lockfree.cpp
 void lfl_free( LFList* list )
          See lockfree.cpp
 LibError lfl_init( LFList* list )
          See lockfree.cpp
 void* lfl_insert( LFList* list, uintptr_t key, size_t additional_bytes, int* was_inserted )
          See lockfree.cpp
 LibError LibError_from_errno( bool warn_if_failed )
          See lib_errors.cpp
 static inline LibError LibError_from_mmap( void* ret, bool warn_if_failed = true )
          See allocators.cpp
 LibError LibError_from_posix( int ret, bool warn_if_failed )
          See lib_errors.cpp
 void LibError_set_errno( LibError err )
          See lib_errors.cpp
 static bool list_lookup( LFList* list, uintptr_t key, ListPos* pos )
          See lockfree.cpp
 template< class Entries > float ll_calc_min_credit_density( const Entries& entries )
          ========================================================================= File : cache_adt.
 void lockfree_Init()
          See lockfree.cpp
 void lockfree_Shutdown()
          See lockfree.cpp
 int log2_of_pow2( uint n )
          See bits.cpp
 int match_wildcard( const char* s, const char* w )
          ========================================================================= File : regex.
 int match_wildcardw( const wchar_t* s, const wchar_t* w )
          See regex.cpp
 void** matrix_alloc( uint cols, uint rows, size_t el_size )
          See allocators.cpp
 void matrix_free( void** matrix )
          See allocators.cpp
 static LibError mem_commit( u8* p, size_t size, int prot )
          See allocators.cpp
 static LibError mem_decommit( u8* p, size_t size )
          See allocators.cpp
 static LibError mem_protect( u8* p, size_t size, int prot )
          See allocators.cpp
 static LibError mem_release( u8* p, size_t size )
          See allocators.cpp
 static LibError mem_reserve( size_t size, u8** pp )
          See allocators.cpp
 void ModuleSetError( volatile ModuleInitState* pInitState )
          See module_init.cpp
 bool ModuleShouldInitialize( volatile ModuleInitState* pInitState )
          See module_init.cpp
 bool ModuleShouldShutdown( volatile ModuleInitState* pInitState )
          See module_init.cpp
 i64 movsx_be64( const u8* p, size_t size_bytes )
          See byte_order.cpp
 i64 movsx_le64( const u8* p, size_t size_bytes )
          See byte_order.cpp
 u64 movzx_be64( const u8* p, size_t size_bytes )
          See byte_order.cpp
 u64 movzx_le64( const u8* p, size_t size_bytes )
          See byte_order.cpp
 static inline Node* node_alloc( size_t additional_bytes )
          See lockfree.cpp
 static inline void node_free( Node* n )
          See lockfree.cpp
 static inline void* node_user_data( Node* n )
          thread-local storage for SMR
 const char* ogl_ExtensionString()
          See ogl.cpp
 LibError ogl_get_gfx_info()
          See ogl.cpp
 bool ogl_HaveExtension( const char* ext )
          See ogl.cpp
 const char* ogl_HaveExtensions( int dummy,... )
          See ogl.cpp
 bool ogl_HaveVersion( const char* desired_version )
          See ogl.cpp
 void ogl_Init()
          See ogl.cpp
 void ogl_SquelchError( GLenum err_to_ignore )
          See ogl.cpp
 void ogl_WarnIfError()
          See ogl.cpp
 void* page_aligned_alloc( size_t unaligned_size )
          See allocators.cpp
 void page_aligned_free( void* p, size_t unaligned_size )
          See allocators.cpp
 LibError path_append( char* dst, const char* path1, const char* path2, uint flags )
          See path_util.cpp
 LibError path_component_validate( const char* name )
          See path_util.cpp
 void path_copy( char* dst, const char* src )
          See path_util.cpp
 void path_dir_only( const char* path, char* dir )
          See path_util.cpp
 const char* path_extension( const char* fn )
          See path_util.cpp
 LibError path_foreach_component( const char* path_org, PathComponentCb cb, void* ctx )
          See path_util.cpp
 bool path_is_dir_sep( char c )
          See path_util.cpp
 bool path_is_subpath( const char* s1, const char* s2 )
          See path_util.cpp
 const char* path_last_component( const char* path )
          See path_util.cpp
 const char* path_name_only( const char* path )
          See path_util.cpp
 LibError path_package_append_file( PathPackage* pp, const char* path )
          See path_util.cpp
 void path_package_copy( PathPackage* pp_dst, const PathPackage* pp_src )
          See path_util.cpp
 LibError path_package_set_dir( PathPackage* pp, const char* dir )
          See path_util.cpp
 LibError path_replace( char* dst, const char* src, const char* remove, const char* replace )
          See path_util.cpp
 void path_strip_fn( char* path )
          See path_util.cpp
 LibError path_validate( const char* path )
          See path_util.cpp
 void* pool_alloc( Pool* p, size_t size )
          See allocators.cpp
 bool pool_contains( Pool* p, void* el )
          See allocators.cpp
 LibError pool_create( Pool* p, size_t max_size, size_t el_size )
          See allocators.cpp
 LibError pool_destroy( Pool* p )
          See allocators.cpp
 void pool_free( Pool* p, void* el )
          See allocators.cpp
 void pool_free_all( Pool* p )
          See allocators.cpp
 uint rand( uint min_inclusive, uint max_exclusive )
          See rand.cpp
 u16 read_be16( const void* p )
          See byte_order.cpp
 u32 read_be32( const void* p )
          See byte_order.cpp
 u64 read_be64( const void* p )
          See byte_order.cpp
 u16 read_le16( const void* p )
          See byte_order.cpp
 u32 read_le32( const void* p )
          See byte_order.cpp
 u64 read_le64( const void* p )
          See byte_order.cpp
 static int return_errno_from_LibError( LibError err )
          See lib_errors.cpp
 uintptr_t round_down( const uintptr_t n, const uintptr_t multiple )
          See bits.cpp
 uintptr_t round_up( const uintptr_t n, const uintptr_t multiple )
          See bits.cpp
 static inline size_t round_up_to_page( size_t size )
          See allocators.cpp
 uint round_up_to_pow2( uint x )
          See bits.cpp
 static bool should_skip_this_assert()
          See debug.cpp
 static bool should_skip_this_error( LibError err )
          See debug.cpp
 static bool should_suppress_error( u8* suppress )
          See debug.cpp
 static inline i64 SignExtend( u64 bits, size_t size_bytes )
          See byte_order.cpp
 void* single_calloc( void* storage, volatile uintptr_t* in_use_flag, size_t size )
          See allocators.cpp
 void single_free( void* storage, volatile uintptr_t* in_use_flag, void* p )
          See allocators.cpp
 static void smr_release_unreferenced_nodes( TLS* tls )
          See lockfree.cpp
 static void smr_retire_node( Node* node )
          See lockfree.cpp
 static void smr_shutdown()
          lock-free singly linked list
 int sprintf_s( char* buf, size_t max_chars, const char* fmt,... )
          See secure_crt.cpp
 void* static_calloc( StaticStorage* ss, size_t size )
          See allocators.cpp
 int strcat_s( char* dst, size_t max_dst_chars, const char* src )
          See secure_crt.cpp
 int strcpy_s( char* dst, size_t max_dst_chars, const char* src )
          See secure_crt.cpp
 int strncat_s( char* dst, size_t max_dst_chars, const char* src, size_t max_src_chars )
          See secure_crt.cpp
 int strncpy_s( char* dst, size_t max_dst_chars, const char* src, size_t max_src_chars )
          See secure_crt.cpp
 size_t strnlen( const char* str, size_t max_len )
          See secure_crt.cpp
 u16 subusw( u16 x, u16 y )
          See lib.cpp
 u16 swap16( const u16 x )
          ========================================================================= File : byte_order.
 u32 swap32( const u32 x )
          See byte_order.cpp
 u64 swap64( const u64 x )
          See byte_order.cpp
 static void symbol_string_add_to_cache( const char* string, void* symbol )
          See debug.cpp
 static const char* symbol_string_build( void* symbol, const char* name, const char* file, int line )
          cache, mapping symbol address to its description string.
 static const char* symbol_string_from_cache( void* symbol )
          See debug.cpp
 TimerClient* timer_add_client( TimerClient* tc, const char* description )
          See timer.cpp
 void timer_bill_client( TimerClient* tc, TimerUnit dt )
          See timer.cpp
 void timer_display_client_totals()
          See timer.cpp
 void timer_Init()
          See timer.cpp
 double timer_res()
          See timer.cpp
 void timer_Shutdown()
          See timer.cpp
 static TLS* tls_alloc()
          See lockfree.cpp
 static TLS* tls_get()
          "Safe Memory Reclamation for Lock-Free Objects" via hazard pointers
 static void tls_init()
          See debug.cpp
 static void tls_retire( void* tls_ )
          See lockfree.cpp
 static void tls_shutdown()
          See debug.cpp
 u16 to_be16( u16 x )
          See byte_order.cpp
 u32 to_be32( u32 x )
          See byte_order.cpp
 u64 to_be64( u64 x )
          See byte_order.cpp
 u16 to_le16( u16 x )
          See byte_order.cpp
 u32 to_le32( u32 x )
          See byte_order.cpp
 u64 to_le64( u64 x )
          See byte_order.cpp
 template< typename T > std::vector< T > ts_make_vector( T* start, size_t size_bytes )
          See self_test.h
 bool ts_str_contains( const std::string& str1, const std::string& str2 )
          See self_test.h
 u16 u16_from_double( double in )
          See lib.cpp
 template< typename T > u16 u16_from_larger( T x )
          convert double to u8; verifies number is in range.
 template< typename T > u32 u32_from_larger( T x )
          See lib.h
 u32 u32_from_u16( u16 hi, u16 lo )
          See lib.cpp
 u16 u32_hi( u32 x )
          See lib.cpp
 u16 u32_lo( u32 x )
          See lib.cpp
 u64 u64_from_u32( u32 hi, u32 lo )
          See lib.cpp
 u32 u64_hi( u64 x )
          See lib.cpp
 u32 u64_lo( u64 x )
          See lib.cpp
 u8 u8_from_double( double in )
          See lib.cpp
 static void validate( LFHash* hash )
          See lockfree.cpp
 static LibError validate_da( DynArray* da )
          See allocators.cpp
 static inline Node* with_mark( Node* p )
          See lockfree.cpp
 static inline Node* without_mark( Node* p )
          See lockfree.cpp
 void write_be16( void* p, u16 x )
          See byte_order.cpp
 void write_be32( void* p, u32 x )
          See byte_order.cpp
 void write_be64( void* p, u64 x )
          See byte_order.cpp
 void write_le16( void* p, u16 x )
          See byte_order.cpp
 void write_le32( void* p, u32 x )
          See byte_order.cpp
 void write_le64( void* p, u64 x )
          See byte_order.cpp
 static uint xrand()
          See rand.cpp
 
Symbol Summary
 #define __FUNCTION__ 0
          See mmgr.h
 #define _CRTDBG_MAP_ALLOC
          See mmgr.h
 #define BIG_ENDIAN 0x1234
          See config.h
 #define BYTE_ORDER BIG_ENDIAN
          See config.h
 #define CALL_CONV
          See ogl.h
 #define CONFIG_DISABLE_EXCEPTIONS 0
          See config.h
 #define CONFIG_FINAL 0
          See config.h
 #define CONFIG_OMIT_FP 0
          See config.h
 #define CONFIG_OVERRUN_PROTECTION 0
          See config.h
 #define CONFIG_PARANOIA 0
          See config.h
 #define CONFIG_RETURN64_EDX_EAX 1
          See config.h
 #define CONFIG_TIMER_ALLOW_RDTSC 0
          See config.h
 #define CONFIG_TRACE 0
          See config.h
 #define CONFIG_USE_MMGR 0
          See config.h
 #define CPU_ALPHA 0
          See config.h
 #define CPU_AMD64 0
          See config.h
 #define CPU_ARM 0
          See config.h
 #define CPU_IA32 0
          See config.h
 #define CPU_IA64 0
          See config.h
 #define CPU_MIPS 0
          See config.h
 #define CXXTEST_HAVE_EH
          See self_test.h
 #define CXXTEST_HAVE_STD
          See self_test.h
 #define DEBUG_PRINTF_BRIEF if(debug_level >= DEBUG_LEVEL_BRIEF) debug_printf
          See debug.h
 #define DEBUG_PRINTF_DETAILED if(debug_level >= DEBUG_LEVEL_DETAILED) debug_printf
          See debug.h
 #define DEBUG_PRINTF_FULL if(debug_level >= DEBUG_LEVEL_FULL ) debug_printf
          See debug.h
 #define FOURCC FOURCC_LE
          See byte_order.h
 #define fscanf_s fscanf
          See secure_crt.h
 #define GCC_VERSION 0
          See config.h
 #define GL_TEXTURE_IMAGE_SIZE_ARB 0x86A0
          See ogl.h
 #define HAVE_C99 1
          See config.h
 #define HAVE_C99_MATH 0
          See config.h
 #define HAVE_GNU_ASM 0
          See config.h
 #define HAVE_MKDIR 1
          See config.h
 #define HAVE_MS_ASM 0
          See config.h
 #define HAVE_PCH 0
          See config.h
 #define HAVE_SECURE_CRT 0
          See config.h
 #define HAVE_STL_HASH 0
          See config.h
 #define HAVE_STL_SLIST 0
          See config.h
 #define HAVE_STRDUP 1
          See config.h
 #define HAVE_VC_DEBUG_ALLOC 0
          See config.h
 #define HAVE_WCSDUP 1
          See config.h
 #define HAVE_X 0
          See config.h
 #define i16 int16_t
          See types.h
 #define i32 int32_t
          See types.h
 #define i64 int64_t
          See types.h
 #define i8 int8_t
          See types.h
 #define ICC_VERSION 0
          See config.h
 #define INCLUDED_ADTS
          See adts.h
 #define INCLUDED_ALLOCATORS
          See allocators.h
 #define INCLUDED_APP_HOOKS
          See app_hooks.h
 #define INCLUDED_BASE32
          See base32.h
 #define INCLUDED_BITS
          See bits.h
 #define INCLUDED_BYTE_ORDER
          See byte_order.h
 #define INCLUDED_CACHE_ADT
          See cache_adt.h
 #define INCLUDED_CODE_ANNOTATION
          See code_annotation.h
 #define INCLUDED_CONFIG
          See config.h
 #define INCLUDED_DEBUG
          See debug.h
 #define INCLUDED_DEBUG_STL
          See debug_stl.h
 #define INCLUDED_FNV_HASH
          See fnv_hash.h
 #define INCLUDED_INPUT
          See input.h
 #define INCLUDED_LIB
          See lib.h
 #define INCLUDED_LIB_ERRORS
          See lib_errors.h
 #define INCLUDED_LOCKFREE
          See lockfree.h
 #define INCLUDED_MMGR
          See mmgr.h
 #define INCLUDED_MODULE_INIT
          See module_init.h
 #define INCLUDED_OGL
          See ogl.h
 #define INCLUDED_PATH_UTIL
          See path_util.h
 #define INCLUDED_RAND
          See rand.h
 #define INCLUDED_REGEX
          See regex.h
 #define INCLUDED_SECURE_CRT
          See secure_crt.h
 #define INCLUDED_SELF_TEST
          See self_test.h
 #define INCLUDED_TIMER
          See timer.h
 #define INCLUDED_TYPES
          See types.h
 #define LCC_VERSION 0
          See config.h
 #define LITTLE_ENDIAN 0x4321
          See config.h
 #define MSC_VERSION 0
          See config.h
 #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
          See mmgr.h
 #define NODEFAULT default: UNREACHABLE
          convenient specialization of UNREACHABLE for switch statements whose default can never be reached.
 #define ogl_WarnIfError
          See ogl.h
 #define OS_AMIGA 0
          See config.h
 #define OS_BEOS 0
          See config.h
 #define OS_BSD 1
          See config.h
 #define OS_LINUX 0
          See config.h
 #define OS_MAC 0
          See config.h
 #define OS_MACOSX 0
          See config.h
 #define OS_SOLARIS 0
          See config.h
 #define OS_UNIX 1
          See config.h
 #define OS_WIN 0
          See config.h
 #define OS_WIN64 0
          See config.h
 #define REAL_GL_1_2
          See ogl.h
 #define REAL_GL_1_3
          See ogl.h
 #define REDEFINED_NEW
          See mmgr.h
 #define SAFE_STRCPY str##cpy
          equivalent to strcpy, but indicates that the programmer checked usage and promises it is safe.
 #define SAFE_WCSCPY wcs##cpy
          See code_annotation.h
 #define STL_DINKUMWARE 0
          See config.h
 #define STL_GCC 0
          See config.h
 #define STL_ICC 0
          See config.h
 #define swap16 _byteswap_ushort
          See byte_order.h
 #define swap32 _byteswap_ulong
          See byte_order.h
 #define swap64 _byteswap_uint64
          See byte_order.h
 #define tcat_s strcat_s
          See secure_crt.cpp
 #define tcmp strcmp
          See secure_crt.cpp
 #define tcpy strcpy
          See secure_crt.cpp
 #define tcpy_s strcpy_s
          See secure_crt.cpp
 #define tfopen fopen
          See secure_crt.cpp
 #define tfopen_s fopen_s
          See secure_crt.cpp
 #define tncat_s strncat_s
          See secure_crt.cpp
 #define tncpy_s strncpy_s
          See secure_crt.cpp
 #define tnlen strnlen
          See secure_crt.cpp
 #define tprintf_s sprintf_s
          See secure_crt.cpp
 #define u16 uint16_t
          See types.h
 #define u32 uint32_t
          See types.h
 #define u64 uint64_t
          See types.h
 #define u8 uint8_t
          See types.h
 #define UID2__ PASTE3__(LINE_, __LINE__, _2)
          See code_annotation.h
 #define UID__ PASTE3__(LINE_, __LINE__, _)
          See code_annotation.h
 #define uint PS_uint
          See types.h
 #define ulong PS_ulong
          See types.h
 #define UNREACHABLE ASSUME_UNREACHABLE
          See code_annotation.h
 #define USE_IA32_FLOAT_TO_INT 0
          See config.h
 #define vtnprintf vsnprintf
          See secure_crt.cpp
 #define WGL_HEADER_NEEDED
          See ogl.h
 #define WSECURE_CRT
          See wsecure_crt.cpp
 
Macro Summary
 #define AH_IS_DEFINED(name) app_hook_was_redefined(offsetof(AppHooks, name))
          See app_hooks.h
 #define ARRAY_SIZE(name) (sizeof(name) / sizeof(name[0]))
          number of array elements
 #define AT_STARTUP(code__namespace) { struct UID__{UID__() { code__ }} UID2__ }
          execute the code passed as a parameter before main is entered.
 #define BIT(n) (1ul << (n))
          value of bit number as unsigned long.
 #define BIT64(n) (1ull << (n))
          value of bit number as unsigned long long.
 #define calloc(num, size) mmgr_calloc_dbg (num,size,__FILE__,__LINE__,__FUNCTION__)
          See mmgr.h
 #define cassert(expr) struct UID__ { unsigned int CASSERT_FAILURE: (expr) }
          compile-time debug_assert.
 #define cassert2(expr) extern char CASSERT_FAILURE[1][(expr)]
          compile-time debug_assert.
 #define CHECK_DA(da) RETURN_ERR(validate_da(da))
          See allocators.cpp
 #define CHECK_ERR(expressionSTMT(i64 err64__ = (i64expressionif(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAXDEBUG_WARN_ERR(err__return (LibErrorerr__ & UINT_MAX})
          See lib_errors.h
 #define CHECK_PATH(path) RETURN_ERR(path_validate(path))
          return appropriate code if path is invalid, otherwise continue.
 #define CONTAINER(name, type_name_patternelse) if(match_wildcard(type_name, type_name_pattern)){handled = truevalid = get_container_info((Any_##name*)p, size, el_size, el_count, el_iterator, it_mem)}
          See debug_stl.cpp
 #define debug_assert(expr) STMT(static u8 suppress__if(!(expr)){switch(debug_assert_failed(#expr, &suppress__, __FILE__, __LINE__, __func__)){case ER_BREAK:debug_break()breakdefault:break}})
          make sure the expression evaluates to non-zero.
 #define debug_warn(expr) STMT(static u8 suppress__switch(debug_assert_failed(expr, &suppress__, __FILE__, __LINE__, __func__)){case ER_BREAK:debug_break()breakdefault:break})
          show a dialog to make sure unexpected states in the program are noticed.
 #define DEBUG_WARN_ERR(errSTMT(static u8 suppress__switch(debug_warn_err(err, &suppress__, __FILE__, __LINE__, __func__{case ER_BREAK:debug_break(breakdefault:break})
          if (LibError)err indicates an function failed, display the error dialog.
 #define DISPLAY_ERROR(text) debug_display_error(text, 0, 0,0, __FILE__,__LINE__,__func__, 0)
          convenience version, in case the advanced parameters aren't needed.
 #define E(e) case e: debug_printf("%s\n", #e) break
          See ogl.cpp
 #define ENFORCE(condition, err_to_warn, retval) STMT(if(!(condition)) { DEBUG_WARN_ERR(err_to_warn) return retval } )
          See secure_crt.cpp
 #define ERROR_ASSOCIATE(err, description, errno_equivalentstatic) LibErrorAssociation UID__ = { err, description, errno_equivalent }static int UID2__ = error_AddAssociation(&UID__)
          See lib_errors.h
 #define FOURCC_BE(a, b, c, d) ( ((u32)(u8)a) << 24 | ((u32)(u8)b) << 16 | ((u32)(u8)c) << 8 | ((u32)(u8)d) << 0 )
          big-endian version of FOURCC
 #define FOURCC_LE(a, b, c, d) ( ((u32)(u8)a) << 0 | ((u32)(u8)b) << 8 | ((u32)(u8)c) << 16 | ((u32)(u8)d) << 24 )
          little-endian version of FOURCC
 #define free(p) mmgr_free_dbg (p, __FILE__,__LINE__,__FUNCTION__)
          See mmgr.h
 #define FUNC(ret, name, params) EXTERN_C ret (CALL_CONV *p##name) params
          See ogl.h
 #define FUNC2(ret, nameARB, nameCore, version, params) EXTERN_C ret (CALL_CONV *p##nameARB) params
          See ogl.h
 #define getcwd(p, size) mmgr_getcwd_dbg(p, size, __FILE__,__LINE__,__FUNCTION__)
          See mmgr.h
 #define malloc(size) mmgr_malloc_dbg (size, __FILE__,__LINE__,__FUNCTION__)
          See mmgr.h
 #define MATCH(known_extif(!strcmp(ext, #known_extreturn) true
          See ogl.cpp
 #define ONCE(ONCE_code__STMT(static bool ONCE_done__ = falseif(!ONCE_done__{ONCE_done__ = trueONCE_code__})
          execute the code passed as a parameter only the first time this is reached.
 #define ONCE_NOT(ONCE_code__STMT(static bool ONCE_done__ = falseif(!ONCE_done__ONCE_done__ = trueelseONCE_code__)
          execute the code passed as a parameter except the first time this is reached.
 #define ONE_SIDE(x, x0, x1, x2) SIGN_EQ(x-x0, x-x1, x-x2)
          See timer.cpp
 #define OVERRIDE_IF_NONZERO(HOOKNAME) if(new_ah->HOOKNAME) ah.HOOKNAME = new_ah->HOOKNAME
          See app_hooks.cpp
 #define PASTE3__(a, b, c) PASTE3_HIDDEN__(a, b, c)
          See code_annotation.h
 #define PASTE3_HIDDEN__(a, b, c) a ## b ## c
          See code_annotation.h
 #define realloc(p, size) mmgr_realloc_dbg(p,size, __FILE__,__LINE__,__FUNCTION__)
          See mmgr.h
 #define REL_ERR(correct, measured) (fabs((correct) - (measured)) / (correct))
          See timer.cpp
 #define REPLACE(what, withelse) if(!strncmp(src, (what), sizeof(what)-1)){src += sizeof(what)-1-1 strcpy(dst, (with)) dst += sizeof(with)-1}
          See debug_stl.cpp
 #define RETURN0_IF_ERR(expressionSTMT(i64 err64__ = (i64expressionif(err64__ < 0return 0)
          See lib_errors.h
 #define RETURN_ERR(expressionSTMT(i64 err64__ = (i64expressionif(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAXreturn err__})
          See lib_errors.h
 #define RETURN_IF_FALSE(okSTMT(if(!(okreturn ERR::FAIL)
          See lib_errors.h
 #define SAFE_ARRAY_DELETE(pSTMT(delete[] (p (p= 0)
          delete memory ensuing from new[] and set the pointer to zero (thus making double-frees safe / a no-op)
 #define SAFE_DELETE(pSTMT(delete (p (p= 0)
          delete memory ensuing from new and set the pointer to zero (thus making double-frees safe / a no-op)
 #define SAFE_FREE(pSTMT(free((void*p (p= 0)
          free memory ensuing from malloc and set the pointer to zero (thus making double-frees safe / a no-op)
 #define SAFE_NEW(type, ptrtype*) ptrtry{ptr = new type()}catch(std::bad_alloc){ptr = 0}
          C++ new wrapper: allocates an instance of the given type and stores a pointer to it.
 #define SIGN_EQ(x0, x1, x2) ( ((x0) * (x1)) > 0.0 && ((x1) * (x2)) > 0.0 )
          See timer.cpp
 #define STATIC_STORAGE(name, sizestatic) u8 storage[(size)]static StaticStorage name = { storage, storage+(size) }
          See allocators.h
 #define STD_CONTAINER(name) CONTAINER(name, "std::" #name "<*>")
          See debug_stl.cpp
 #define STMT(STMT_code__) do { STMT_code__ } while(false)
          package code into a single statement.
 #define strdup(p) mmgr_strdup_dbg(p, __FILE__,__LINE__,__FUNCTION__)
          See mmgr.h
 #define STRINGIZE(id) STRINGIZE2(id)
          See debug_stl.cpp
 #define STRINGIZE2(id) # id
          See debug_stl.cpp
 #define STRIP(whatelse) if(!strncmp(src, (what), sizeof(what)-1)){src += sizeof(what)-1-1}
          See debug_stl.cpp
 #define STRIP_NESTED(whatelse) if(!strncmp(src, (what), sizeof(what)-1)){if(src != name && src[-1] == ',')dst--src += sizeof(what)-1debug_assert(nesting == 0)nesting = 1}
          See debug_stl.cpp
 #define T(string_literal) string_literal
          See secure_crt.cpp
 #define THROW_ERR(expressionSTMT(i64 err64__ = (i64expressionif(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAXDEBUG_WARN_ERR(err__throw err__})
          See lib_errors.h
 #define TIMER(description) ScopeTimer UID__(description)
          See timer.h
 #define TIMER_ACCRUE(client) ScopeTimerAccrue<> UID__(client)
          See timer.h
 #define TIMER_ADD_CLIENT(idstatic) TimerClient UID__static TimerClient* id = timer_add_client(&UID__, #id)
          See timer.h
 #define TIMER_BEGIN(description) { ScopeTimer UID__(description)
          See timer.h
 #define TIMER_END(description) }
          See timer.h
 #define TS_ASSERT_OK(expr) TS_ASSERT_EQUALS((expr), INFO::OK)
          See self_test.h
 #define TS_ASSERT_STR_CONTAINS(str1, str2) TS_ASSERT(ts_str_contains(str1, str2))
          See self_test.h
 #define TS_ASSERT_STR_EQUALS(str1, str2) TS_ASSERT_EQUALS(std::string(str1), std::string(str2))
          See self_test.h
 #define TS_ASSERT_VECTOR_EQUALS_ARRAY(vec1, array) TS_ASSERT_EQUALS(vec1, ts_make_vector((array), sizeof(array)))
          See self_test.h
 #define TS_ASSERT_WSTR_EQUALS(str1, str2) TS_ASSERT_EQUALS(std::wstring(str1), std::wstring(str2))
          See self_test.h
 #define UNREACHABLESTMT(debug_warn("hit supposedly unreachable code"abort()
          See code_annotation.h
 #define UNUSED(param)
          mark a function parameter as unused and avoid the corresponding compiler warning.
 #define UNUSED2(param) (void)param
          mark a function local variable or parameter as unused and avoid the corresponding compiler warning.
 #define WARN_ERR(expressionSTMT(i64 err64__ = (i64expressionif(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAXDEBUG_WARN_ERR(err__})
          See lib_errors.h
 #define WARN_ERR_RETURN(expressionSTMT(i64 err64__ = (i64expressionif(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAXDEBUG_WARN_ERR(err__return})
          See lib_errors.h
 #define WARN_IF_FALSE(okSTMT(if(!(okdebug_warn("FYI: WARN_IF_FALSE reports that a function failed.""feel free to ignore or suppress this warning.")
          See lib_errors.h
 #define WARN_IF_PTR_LEN(len)
          See secure_crt.cpp
 #define WARN_RETURN(errSTMT(DEBUG_WARN_ERR(errreturn err)
          See lib_errors.h
 #define WARN_RETURN_IF_FALSE(okSTMT(if(!(ok{debug_warn("FYI: WARN_RETURN_IF_FALSE reports that a function failed.""feel free to ignore or suppress this warning."return ERR::FAIL})
          See lib_errors.h
 #define wcsdup(p) mmgr_wcsdup_dbg(p, __FILE__,__LINE__,__FUNCTION__)
          See mmgr.h
 

Field Detail

active_data_structures

 static intptr_t active_data_structures;
See lockfree.cpp.

active_threads

 static intptr_t active_threads;
See lockfree.cpp.

ah

 static AppHooks ah;
See app_hooks.cpp.

ALIGN

 static const size_t ALIGN;
See allocators.cpp.

associations

 static LibErrorAssociation* associations;
========================================================================= File : lib_errors.cpp Project : 0 A.D. Description : error handling system: defines error codes, associates : them with descriptive text, simplifies error notification. =========================================================================
See lib_errors.cpp.

BUCKET_SIZE

 const size_t BUCKET_SIZE;
See allocators.cpp.

clients

 static TimerClient* clients;
See timer.cpp.

DA_NOT_OUR_MEM

 const int DA_NOT_OUR_MEM;
See allocators.cpp.

DBG_FILE_LEN

 const size_t DBG_FILE_LEN;
does the given pointer appear to point to code?
See debug.h.

DBG_SYMBOL_LEN

 const size_t DBG_SYMBOL_LEN;
maximum number of characters (including trailing \0) written to user's buffers by debug_resolve_symbol.
See debug.h.

debug_log

 wchar_t debug_log[ LOG_CHARS ];
See debug.cpp.

debug_log_pos

 wchar_t* debug_log_pos;
See debug.cpp.

DEBUG_STL_MAX_ITERATOR_SIZE

 const size_t DEBUG_STL_MAX_ITERATOR_SIZE;
no STL iterator is larger than this; see below.
See debug_stl.h.

DEBUG_SUPPRESS

 const u8 DEBUG_SUPPRESS;
value for suppress flag once set by debug_display_error. rationale: this value is fairly distinctive and helps when debugging the symbol engine. initial value is 0 rather that another constant; this avoids allocating .rdata space.
See debug.h.

default_ah

 static AppHooks default_ah;
See app_hooks.cpp.

exit_requested

 static bool exit_requested;
See debug.cpp.

expected_err

 static LibError expected_err;
See debug.cpp.

expected_err_valid

 static uintptr_t expected_err_valid;
See debug.cpp.

exts

 static const char* exts;
========================================================================= File : ogl.cpp Project : 0 A.D. Description : OpenGL helper functions. =========================================================================
See ogl.cpp.

f

 static FILE* f;
See input.cpp.

fps

 int fps;
See timer.cpp.

game_ticks

 u32 game_ticks;
See input.cpp.

GiB

 const size_t GiB;
number of array elements
See lib.h.

handler_stack

 static InHandler handler_stack[ MAX_HANDLERS ];
See input.cpp.

handler_stack_top

 static uint handler_stack_top;
See input.cpp.

hash_jumps

 static uint hash_jumps;
See debug.cpp.

have_12

 static bool have_12;
See ogl.cpp.

have_13

 static bool have_13;
See ogl.cpp.

have_14

 static bool have_14;
See ogl.cpp.

have_20

 static bool have_20;
See ogl.cpp.

initState

 static ModuleInitState initState;
See lockfree.cpp.

KiB

 const size_t KiB;
low-level aka "lib" ------------------- this codebase was grown from modules shared between several projects, i.e. my personal library; hence the name "lib". it has been expanded to fit the needs of 0ad - in particular, resource loading. owing to the dual-use situation, the 0ad coding conventions are not met; also, major changes are ill-advised because they may break other projects. design goals ------------ - fast and low-overhead, including startup time - portable: must run on Win32, Mac OS X and Linux - reusable across projects, i.e. no dependency on a central 'manager' that ties modules together. scope ----- - POSIX definitions - resource management - debugging tools (including memory tracker) - low-level helper functions, e.g. ADTs, endian conversion and timing - platform-dependent system/feature detection
See lib.h.

LOG_CHARS

 static const size_t LOG_CHARS;
See debug.cpp.

MAX_CHARS

 static const int MAX_CHARS;
See debug.cpp.

MAX_HANDLERS

 const uint MAX_HANDLERS;
========================================================================= File : input.cpp Project : 0 A.D. Description : SDL input redirector; dispatches to multiple handlers and : allows record/playback of evs. =========================================================================
See input.cpp.

MAX_RETIRED

 static const size_t MAX_RETIRED;
See lockfree.cpp.

MAX_SYMBOLS

 static const uint MAX_SYMBOLS;
See debug.cpp.

MAX_TAGS

 static const uint MAX_TAGS;
See debug.cpp.

message_size_bytes

 static const size_t message_size_bytes;
See debug.cpp.

MiB

 const size_t MiB;
See lib.h.

mmap_flags

 static const int mmap_flags;
See allocators.cpp.

MODULE_ERROR

 static const ModuleInitState MODULE_ERROR;
See module_init.cpp.

MODULE_UNINITIALIZED

 static const ModuleInitState MODULE_UNINITIALIZED;
========================================================================= File : module_init.cpp Project : 0 A.D. Description : helpers for module initialization/shutdown. =========================================================================
See module_init.cpp.

next_ev_time

 static u32 next_ev_time;
See input.cpp.

num_clients

 static uint num_clients;
See timer.cpp.

NUM_HPS

 static const uint NUM_HPS;
========================================================================= File : lockfree.cpp Project : 0 A.D. Description : lock-free synchronized data structures. =========================================================================
See lockfree.cpp.

num_tags

 static uint num_tags;
See debug.cpp.

ogl_max_tex_size

 GLint ogl_max_tex_size;
See ogl.cpp.

ogl_max_tex_units

 GLint ogl_max_tex_units;
See ogl.cpp.

POOL_VARIABLE_ALLOCS

 const size_t POOL_VARIABLE_ALLOCS;
pass as pool_create's param to indicate variable-sized allocs are required (see below).
See allocators.h.

spf

 float spf;
See timer.cpp.

state

  state;
See input.cpp.

string_buf

 static char* string_buf;
See debug.cpp.

string_buf_pos

 static char* string_buf_pos;
See debug.cpp.

STRING_BUF_SIZE

 static const size_t STRING_BUF_SIZE;
See debug.cpp.

symbols

 static Symbol* symbols;
See debug.cpp.

tags

 static u32 tags[ MAX_TAGS ];
See debug.cpp.

time_adjust

 static u32 time_adjust;
See input.cpp.

tls_key

 static pthread_key_t tls_key;
See debug.cpp.

tls_list

 static TLS* tls_list;
See lockfree.cpp.

tls_once

 static pthread_once_t tls_once;
See debug.cpp.

total_symbols

 static uint total_symbols;
See debug.cpp.

XRAND_MAX

 static const uint XRAND_MAX;
========================================================================= File : rand.cpp Project : 0 A.D. Description : pseudorandom number generator =========================================================================
See rand.cpp.


Method Detail

addusw

 u16 addusw( u16 x, u16 y );
========================================================================= File : lib.cpp Project : 0 A.D. Description : various utility functions. =========================================================================
See lib.cpp.

ah_bundle_logs

 void ah_bundle_logs( FILE* f );
See app_hooks.cpp.

ah_display_error

 ErrorReaction ah_display_error( const wchar_t* text, uint flags );
See app_hooks.cpp.

ah_get_log_dir

 const char* ah_get_log_dir( void );
See app_hooks.cpp.

ah_log

 void ah_log( const wchar_t* text );
See app_hooks.cpp.

ah_override_gl_upload_caps

 void ah_override_gl_upload_caps( void );
See app_hooks.cpp.

ah_translate

 const wchar_t* ah_translate( const wchar_t* text );
See app_hooks.cpp.

ah_translate_free

 void ah_translate_free( const wchar_t* text );
See app_hooks.cpp.

app_hook_was_redefined

 bool app_hook_was_redefined( size_t offset_in_struct );
See app_hooks.cpp.

app_hooks_update

 void app_hooks_update( AppHooks* new_ah );
See app_hooks.cpp.

AssociationFromErrno

 static const LibErrorAssociation* AssociationFromErrno( errno_t errno_equivalent );
See lib_errors.cpp.

AssociationFromLibError

 static const LibErrorAssociation* AssociationFromLibError( LibError err );
See lib_errors.cpp.

base32

 void base32( const size_t in_len, const u8* in, u8* out );
========================================================================= File : base32.cpp Project : 0 A.D. Description : base32 conversion =========================================================================
See base32.cpp.

bit_mask

 inline uint bit_mask( uint num_bits );
a mask that includes the lowest N bits
Parameters:
num_bits - number of bits in mask
See bits.h.

bit_mask64

 inline u64 bit_mask64( uint num_bits );
See bits.h.

bits

 inline uint bits( uint num, uint lo_idx, uint hi_idx );
extract the value of bits hi_idx:lo_idx within num example: bits(0x69, 2, 5) == 0x0A
Parameters:
num - number whose bits are to be extracted
lo_idx - bit index of lowest bit to include
hi_idx - bit index of highest bit to include
Returns:
value of extracted bits.
See bits.h.

bits64

 inline u64 bits64( u64 num, uint lo_idx, uint hi_idx );
See bits.h.

bucket_alloc

 void* bucket_alloc( Bucket* b, size_t size );
See allocators.cpp.

bucket_create

 LibError bucket_create( Bucket* b, size_t el_size );
See allocators.cpp.

bucket_destroy

 void bucket_destroy( Bucket* b );
See allocators.cpp.

bucket_free

 void bucket_free( Bucket* b, void* el );
See allocators.cpp.

calc_fps

 void calc_fps();
See timer.cpp.

call_display_error

 static ErrorReaction call_display_error( const wchar_t* text, uint flags );
See debug.cpp.

carry_out_ErrorReaction

 static ErrorReaction carry_out_ErrorReaction( ErrorReaction er, uint flags, u8* suppress );
See debug.cpp.

cassert

 cassert( sizeof( int )* CHAR_BIT == 32 );
See bits.cpp.

ceil_log2

 uint ceil_log2( uint x );
See bits.cpp.

chain

 static LFList* chain( LFHash* hash, uintptr_t key );
See lockfree.cpp.

container_valid

 static bool container_valid( const void* front, size_t el_count );
See debug_stl.cpp.

da_alloc

 LibError da_alloc( DynArray* da, size_t max_size );
See allocators.cpp.

da_append

 LibError da_append( DynArray* da, const void* data, size_t size );
See allocators.cpp.

da_free

 LibError da_free( DynArray* da );
See allocators.cpp.

da_read

 LibError da_read( DynArray* da, void* data, size_t size );
See allocators.cpp.

da_reserve

 LibError da_reserve( DynArray* da, size_t size );
See allocators.cpp.

da_set_prot

 LibError da_set_prot( DynArray* da, int prot );
See allocators.cpp.

da_set_size

 LibError da_set_size( DynArray* da, size_t new_size );
See allocators.cpp.

da_wrap_fixed

 LibError da_wrap_fixed( DynArray* da, u8* p, size_t size );
See allocators.cpp.

debug_assert_failed

 ErrorReaction debug_assert_failed( const char* expr, u8* suppress, const char* file, int line, const char* func );
See debug.cpp.

debug_display_error

 ErrorReaction debug_display_error( const wchar_t* description, uint flags, uint skip, void* context, const char* file, int line, const char* func, u8* suppress );
See debug.cpp.

debug_display_msgw

 void debug_display_msgw( const wchar_t* caption, const wchar_t* msg );
See debug.cpp.

debug_error_message_build

 const wchar_t* debug_error_message_build( const wchar_t* description, const char* fn_only, int line, const char* func, uint skip, void* context, ErrorMessageMem* emm );
See debug.cpp.

debug_error_message_free

 void debug_error_message_free( ErrorMessageMem* emm );
See debug.cpp.

debug_filter_add

 void debug_filter_add( const char* tag );
See debug.cpp.

debug_filter_allows

 bool debug_filter_allows( const char* text );
See debug.cpp.

debug_filter_clear

 void debug_filter_clear();
See debug.cpp.

debug_filter_remove

 void debug_filter_remove( const char* tag );
See debug.cpp.

debug_get_symbol_string

 const char* debug_get_symbol_string( void* symbol, const char* name, const char* file, int line );
See debug.cpp.

debug_get_thread_name

 const char* debug_get_thread_name();
See debug.cpp.

debug_printf

 void debug_printf( const char* fmt,... );
See debug.cpp.

debug_set_thread_name

 void debug_set_thread_name( const char* name );
See debug.cpp.

debug_shutdown

 void debug_shutdown();
See debug.cpp.

debug_skip_next_assert

 void debug_skip_next_assert();
See debug.cpp.

debug_skip_next_err

 void debug_skip_next_err( LibError err );
See debug.cpp.

debug_stl_simplify_name

 char* debug_stl_simplify_name( char* name );
See debug_stl.cpp.

debug_warn_err

 ErrorReaction debug_warn_err( LibError err, u8* suppress, const char* file, int line, const char* func );
See debug.cpp.

debug_wprintf

 void debug_wprintf( const wchar_t* fmt,... );
See debug.cpp.

debug_wprintf_mem

 void debug_wprintf_mem( const wchar_t* fmt,... );
See debug.cpp.

debug_write_crashlog

 LibError debug_write_crashlog( const wchar_t* text );
storage for and construction of strings describing a symbol
See debug.cpp.

def_bundle_logs

 static void def_bundle_logs( FILE* UNUSED( f ) );
See app_hooks.cpp.

def_display_error

 static ErrorReaction def_display_error( const wchar_t* UNUSED( text ), uint UNUSED( flags ) );
See app_hooks.cpp.

def_get_log_dir

 static const char* def_get_log_dir();
See app_hooks.cpp.

def_log

 static void def_log( const wchar_t* text );
See app_hooks.cpp.

def_override_gl_upload_caps

 static void def_override_gl_upload_caps();
========================================================================= File : app_hooks.cpp Project : 0 A.D. Description : hooks to allow customization / app-specific behavior. =========================================================================
See app_hooks.cpp.

def_translate

 static const wchar_t* def_translate( const wchar_t* text );
See app_hooks.cpp.

def_translate_free

 static void def_translate_free( const wchar_t* UNUSED( text ) );
See app_hooks.cpp.

dispatch_ev

 static void dispatch_ev( const SDL_Event_* ev );
See input.cpp.

dump_gl_error

 static void dump_gl_error( GLenum err );
See ogl.cpp.

error_AddAssociation

 int error_AddAssociation( LibErrorAssociation* lea );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_6,"Case 6",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_7,"Case 7",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::INVALID_HANDLE,"Invalid Handle (argument)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_21,"Case 21",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_19,"Case 19",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::STRING_NOT_TERMINATED,"Invalid string (no 0 terminator found in buffer)",-1 );
========================================================================= File : secure_crt.cpp Project : 0 A.D. Description : partial implementation of VC8's secure CRT functions =========================================================================
See secure_crt.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::PATH_COMPONENT_SEPARATOR,"Path component contains dir separator",-1 );
See path_util.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::PATH_NON_CANONICAL,"Path contains unsupported .. or ./",-1 );
See path_util.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::PATH_NON_PORTABLE,"Path contains OS-specific dir separator",-1 );
See path_util.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::PATH_NOT_RELATIVE,"Path is not relative",-1 );
See path_util.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::STL_CNT_UNKNOWN,"Unknown STL container type_name",-1 );
========================================================================= File : debug_stl.cpp Project : 0 A.D. Description : portable debugging helper functions specific to the STL. =========================================================================
See debug_stl.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( INFO::CANNOT_HANDLE,"Cannot handle (not an error)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::NO_MEM,"Not enough memory", ENOMEM );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::NOT_SUPPORTED,"Feature isn't and won't be supported",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::PATH_EMPTY,"Path is an empty string",-1 );
See path_util.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::NOT_IMPLEMENTED,"Feature currently not implemented", ENOSYS );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::PATH_LENGTH,"Path exceeds PATH_MAX characters", ENAMETOOLONG );
========================================================================= File : path_util.cpp Project : 0 A.D. Description : helper functions for path strings. =========================================================================
See path_util.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::NO_SYS,"OS doesn't provide a required API",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::LIMIT,"Fixed limit exceeded",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::MEM_OVERWRITTEN,"Wrote to memory outside valid allocation",-1 );
See mmgr.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::MEM_ALLOC_NOT_FOUND,"Not a valid allocated address",-1 );
========================================================================= File : mmgr.cpp Project : 0 A.D. Description : memory manager and tracker. =========================================================================
See mmgr.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_NO_STACK_FRAMES_FOUND,"No stack frames found",-1 );
========================================================================= File : debug.cpp Project : 0 A.D. Description : platform-independent debug support code. =========================================================================
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_UNRETRIEVABLE_STATIC,"Value unretrievable (stored in external module)",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_UNRETRIEVABLE_REG,"Value unretrievable (stored in register)",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_TYPE_INFO_UNAVAILABLE,"Error getting type_info",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_INTERNAL_ERROR,"Exception raised while processing a symbol",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_UNSUPPORTED,"Symbol type not (fully) supported",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_CHILD_NOT_FOUND,"Symbol does not have the given child",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_NESTING_LIMIT,"Symbol nesting too deep or infinite recursion",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::SYM_SINGLE_SYMBOL_LIMIT,"Symbol has produced too much output",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( INFO::SYM_SUPPRESS_OUTPUT,"Symbol was suppressed",-1 );
See debug.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::AGAIN,"Try again later",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::BUF_SIZE,"Buffer argument too small",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::INVALID_PARAM,"Invalid function argument", EINVAL );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::CORRUPTED,"File/memory data is corrupted",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::REENTERED,"Single-call function was reentered",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::TIMED_OUT,"Timed out",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::LOGIC,"Logic error in code",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( INFO::ALREADY_EXISTS,"Already exists (not an error)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( INFO::ALL_COMPLETE,"All complete (not an error)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_16,"Case 16",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( INFO::SKIPPED,"Skipped (not an error)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( INFO::CB_CONTINUE,"Continue (not an error)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::FAIL,"Function failed (no details available)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( INFO::OK,"(but return value was 0 which indicates success)",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_2,"Case 2",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_1,"Case 1",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_3,"Case 3",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_4,"Case 4",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_5,"Case 5",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_29,"Case 29",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_28,"Case 28",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_27,"Case 27",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_26,"Case 26",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_25,"Case 25",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_24,"Case 24",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_23,"Case 23",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_22,"Case 22",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_9,"Case 9",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_8,"Case 8",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_18,"Case 18",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_17,"Case 17",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::STL_CNT_INVALID,"Container type is known but contents are invalid",-1 );
See debug_stl.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_14,"Case 14",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_11,"Case 11",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_12,"Case 12",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_13,"Case 13",-1 );
See lib_errors.cpp.

ERROR_ASSOCIATE

 ERROR_ASSOCIATE( ERR::_15,"Case 15",-1 );
See lib_errors.cpp.

error_description_r

 char* error_description_r( LibError err, char* buf, size_t max_chars );
See lib_errors.cpp.

feq

 inline bool feq( double d1, double d2, double epsilon = 0. 00001 );
are the given floats nearly "equal"?
Returns:
whether the numbers are within "epsilon" of each other. notes: - the epsilon magic number varies with the magnitude of the inputs. we use a sane default, but don't use this routine for very large/small comparands. - floating-point numbers don't magically lose precision. addition, subtraction and multiplication results are precise up to the mantissa's least-significant bit. only division, sqrt, sin/cos and other trancendental operations introduce error.
See lib.h.

feqf

 inline bool feqf( float f1, float f2, float epsilon = 0. 001f );
See lib.h.

floor_log2

 int floor_log2( const float x );
See bits.cpp.

fnv_hash

 u32 fnv_hash( const void* buf, size_t len );
========================================================================= File : fnv_hash.h Project : 0 A.D. Description : Fowler/Noll/Vo string hash =========================================================================
See fnv_hash.cpp.

fnv_hash64

 u64 fnv_hash64( const void* buf, size_t len );
See fnv_hash.cpp.

fnv_lc_hash

 u32 fnv_lc_hash( const char* str, size_t len );
See fnv_hash.cpp.

freelist_pop

 static void* freelist_pop( void** pfreelist );
See allocators.cpp.

freelist_push

 static void freelist_push( void** pfreelist, void* el );
See allocators.cpp.

get_page_size

 static size_t get_page_size();
========================================================================= File : allocators.cpp Project : 0 A.D. Description : memory suballocators. =========================================================================
See allocators.cpp.

get_time

 double get_time();
See timer.cpp.

hash

 static uint hash( void* symbol );
See debug.cpp.

importExtensionFunctions

 static void importExtensionFunctions();
See ogl.cpp.

in_add_handler

 void in_add_handler( InHandler handler );
See input.cpp.

in_dispatch_event

 void in_dispatch_event( const SDL_Event_* ev );
See input.cpp.

in_dispatch_recorded_events

 void in_dispatch_recorded_events();
See input.cpp.

in_playback

 LibError in_playback( const char* fn );
See input.cpp.

in_record

 LibError in_record( const char* fn );
See input.cpp.

in_stop

 void in_stop();
See input.cpp.

is_marked_as_deleted

 static inline bool is_marked_as_deleted( Node* p );
See lockfree.cpp.

is_node_referenced

 static bool is_node_referenced( Node* node, void** hps, size_t num_hps );
See lockfree.cpp.

is_page_multiple

 static inline bool is_page_multiple( uintptr_t x );
See allocators.cpp.

is_pow2

 bool is_pow2( uint n );
========================================================================= File : bits.cpp Project : 0 A.D. Description : bit-twiddling. =========================================================================
See bits.cpp.

isImplementedInCore

 static bool isImplementedInCore( const char* ext );
See ogl.cpp.

IsSimilarMagnitude

 inline bool IsSimilarMagnitude( double d1, double d2, const double relativeErrorTolerance = 0. 05 );
return upper 32-bits
See lib.h.

LatchStartTime

 static void LatchStartTime();
========================================================================= File : timer.cpp Project : 0 A.D. Description : platform-independent high resolution timer and : FPS measuring code. =========================================================================
See timer.cpp.

lfh_erase

 LibError lfh_erase( LFHash* hash, uintptr_t key );
See lockfree.cpp.

lfh_find

 void* lfh_find( LFHash* hash, uintptr_t key );
See lockfree.cpp.

lfh_free

 void lfh_free( LFHash* hash );
See lockfree.cpp.

lfh_init

 LibError lfh_init( LFHash* hash, size_t num_entries );
See lockfree.cpp.

lfh_insert

 void* lfh_insert( LFHash* hash, uintptr_t key, size_t additional_bytes, int* was_inserted );
See lockfree.cpp.

lfl_erase

 LibError lfl_erase( LFList* list, uintptr_t key );
lock-free hash table
See lockfree.cpp.

lfl_find

 void* lfl_find( LFList* list, uintptr_t key );
See lockfree.cpp.

lfl_free

 void lfl_free( LFList* list );
See lockfree.cpp.

lfl_init

 LibError lfl_init( LFList* list );
See lockfree.cpp.

lfl_insert

 void* lfl_insert( LFList* list, uintptr_t key, size_t additional_bytes, int* was_inserted );
See lockfree.cpp.

LibError_from_errno

 LibError LibError_from_errno( bool warn_if_failed );
See lib_errors.cpp.

LibError_from_mmap

 static inline LibError LibError_from_mmap( void* ret, bool warn_if_failed = true );
See allocators.cpp.

LibError_from_posix

 LibError LibError_from_posix( int ret, bool warn_if_failed );
See lib_errors.cpp.

LibError_set_errno

 void LibError_set_errno( LibError err );
See lib_errors.cpp.

list_lookup

 static bool list_lookup( LFList* list, uintptr_t key, ListPos* pos );
See lockfree.cpp.

ll_calc_min_credit_density

 template< class Entries > float ll_calc_min_credit_density( const Entries& entries );
========================================================================= File : cache_adt.h Project : 0 A.D. Description : Customizable cache data structure. =========================================================================
See cache_adt.h.

lockfree_Init

 void lockfree_Init();
See lockfree.cpp.

lockfree_Shutdown

 void lockfree_Shutdown();
See lockfree.cpp.

log2_of_pow2

 int log2_of_pow2( uint n );
See bits.cpp.

match_wildcard

 int match_wildcard( const char* s, const char* w );
========================================================================= File : regex.cpp Project : 0 A.D. Description : minimal regex implementation =========================================================================
See regex.cpp.

match_wildcardw

 int match_wildcardw( const wchar_t* s, const wchar_t* w );
See regex.cpp.

matrix_alloc

 void** matrix_alloc( uint cols, uint rows, size_t el_size );
See allocators.cpp.

matrix_free

 void matrix_free( void** matrix );
See allocators.cpp.

mem_commit

 static LibError mem_commit( u8* p, size_t size, int prot );
See allocators.cpp.

mem_decommit

 static LibError mem_decommit( u8* p, size_t size );
See allocators.cpp.

mem_protect

 static LibError mem_protect( u8* p, size_t size, int prot );
See allocators.cpp.

mem_release

 static LibError mem_release( u8* p, size_t size );
See allocators.cpp.

mem_reserve

 static LibError mem_reserve( size_t size, u8** pp );
See allocators.cpp.

ModuleSetError

 void ModuleSetError( volatile ModuleInitState* pInitState );
See module_init.cpp.

ModuleShouldInitialize

 bool ModuleShouldInitialize( volatile ModuleInitState* pInitState );
See module_init.cpp.

ModuleShouldShutdown

 bool ModuleShouldShutdown( volatile ModuleInitState* pInitState );
See module_init.cpp.

movsx_be64

 i64 movsx_be64( const u8* p, size_t size_bytes );
See byte_order.cpp.

movsx_le64

 i64 movsx_le64( const u8* p, size_t size_bytes );
See byte_order.cpp.

movzx_be64

 u64 movzx_be64( const u8* p, size_t size_bytes );
See byte_order.cpp.

movzx_le64

 u64 movzx_le64( const u8* p, size_t size_bytes );
See byte_order.cpp.

node_alloc

 static inline Node* node_alloc( size_t additional_bytes );
See lockfree.cpp.

node_free

 static inline void node_free( Node* n );
See lockfree.cpp.

node_user_data

 static inline void* node_user_data( Node* n );
thread-local storage for SMR
See lockfree.cpp.

ogl_ExtensionString

 const char* ogl_ExtensionString();
See ogl.cpp.

ogl_get_gfx_info

 LibError ogl_get_gfx_info();
See ogl.cpp.

ogl_HaveExtension

 bool ogl_HaveExtension( const char* ext );
See ogl.cpp.

ogl_HaveExtensions

 const char* ogl_HaveExtensions( int dummy,... );
See ogl.cpp.

ogl_HaveVersion

 bool ogl_HaveVersion( const char* desired_version );
See ogl.cpp.

ogl_Init

 void ogl_Init();
See ogl.cpp.

ogl_SquelchError

 void ogl_SquelchError( GLenum err_to_ignore );
See ogl.cpp.

ogl_WarnIfError

 void ogl_WarnIfError();
See ogl.cpp.

page_aligned_alloc

 void* page_aligned_alloc( size_t unaligned_size );
See allocators.cpp.

page_aligned_free

 void page_aligned_free( void* p, size_t unaligned_size );
See allocators.cpp.

path_append

 LibError path_append( char* dst, const char* path1, const char* path2, uint flags );
See path_util.cpp.

path_component_validate

 LibError path_component_validate( const char* name );
See path_util.cpp.

path_copy

 void path_copy( char* dst, const char* src );
See path_util.cpp.

path_dir_only

 void path_dir_only( const char* path, char* dir );
See path_util.cpp.

path_extension

 const char* path_extension( const char* fn );
See path_util.cpp.

path_foreach_component

 LibError path_foreach_component( const char* path_org, PathComponentCb cb, void* ctx );
See path_util.cpp.

path_is_dir_sep

 bool path_is_dir_sep( char c );
See path_util.cpp.

path_is_subpath

 bool path_is_subpath( const char* s1, const char* s2 );
See path_util.cpp.

path_last_component

 const char* path_last_component( const char* path );
See path_util.cpp.

path_name_only

 const char* path_name_only( const char* path );
See path_util.cpp.

path_package_append_file

 LibError path_package_append_file( PathPackage* pp, const char* path );
See path_util.cpp.

path_package_copy

 void path_package_copy( PathPackage* pp_dst, const PathPackage* pp_src );
See path_util.cpp.

path_package_set_dir

 LibError path_package_set_dir( PathPackage* pp, const char* dir );
See path_util.cpp.

path_replace

 LibError path_replace( char* dst, const char* src, const char* remove, const char* replace );
See path_util.cpp.

path_strip_fn

 void path_strip_fn( char* path );
See path_util.cpp.

path_validate

 LibError path_validate( const char* path );
See path_util.cpp.

pool_alloc

 void* pool_alloc( Pool* p, size_t size );
See allocators.cpp.

pool_contains

 bool pool_contains( Pool* p, void* el );
See allocators.cpp.

pool_create

 LibError pool_create( Pool* p, size_t max_size, size_t el_size );
See allocators.cpp.

pool_destroy

 LibError pool_destroy( Pool* p );
See allocators.cpp.

pool_free

 void pool_free( Pool* p, void* el );
See allocators.cpp.

pool_free_all

 void pool_free_all( Pool* p );
See allocators.cpp.

rand

 uint rand( uint min_inclusive, uint max_exclusive );
See rand.cpp.

read_be16

 u16 read_be16( const void* p );
See byte_order.cpp.

read_be32

 u32 read_be32( const void* p );
See byte_order.cpp.

read_be64

 u64 read_be64( const void* p );
See byte_order.cpp.

read_le16

 u16 read_le16( const void* p );
See byte_order.cpp.

read_le32

 u32 read_le32( const void* p );
See byte_order.cpp.

read_le64

 u64 read_le64( const void* p );
See byte_order.cpp.

return_errno_from_LibError

 static int return_errno_from_LibError( LibError err );
See lib_errors.cpp.

round_down

 uintptr_t round_down( const uintptr_t n, const uintptr_t multiple );
See bits.cpp.

round_up

 uintptr_t round_up( const uintptr_t n, const uintptr_t multiple );
See bits.cpp.

round_up_to_page

 static inline size_t round_up_to_page( size_t size );
See allocators.cpp.

round_up_to_pow2

 uint round_up_to_pow2( uint x );
See bits.cpp.

should_skip_this_assert

 static bool should_skip_this_assert();
See debug.cpp.

should_skip_this_error

 static bool should_skip_this_error( LibError err );
See debug.cpp.

should_suppress_error

 static bool should_suppress_error( u8* suppress );
See debug.cpp.

SignExtend

 static inline i64 SignExtend( u64 bits, size_t size_bytes );
See byte_order.cpp.

single_calloc

 void* single_calloc( void* storage, volatile uintptr_t* in_use_flag, size_t size );
See allocators.cpp.

single_free

 void single_free( void* storage, volatile uintptr_t* in_use_flag, void* p );
See allocators.cpp.

smr_release_unreferenced_nodes

 static void smr_release_unreferenced_nodes( TLS* tls );
See lockfree.cpp.

smr_retire_node

 static void smr_retire_node( Node* node );
See lockfree.cpp.

smr_shutdown

 static void smr_shutdown();
lock-free singly linked list
See lockfree.cpp.

sprintf_s

 int sprintf_s( char* buf, size_t max_chars, const char* fmt,... );
See secure_crt.cpp.

static_calloc

 void* static_calloc( StaticStorage* ss, size_t size );
See allocators.cpp.

strcat_s

 int strcat_s( char* dst, size_t max_dst_chars, const char* src );
See secure_crt.cpp.

strcpy_s

 int strcpy_s( char* dst, size_t max_dst_chars, const char* src );
See secure_crt.cpp.

strncat_s

 int strncat_s( char* dst, size_t max_dst_chars, const char* src, size_t max_src_chars );
See secure_crt.cpp.

strncpy_s

 int strncpy_s( char* dst, size_t max_dst_chars, const char* src, size_t max_src_chars );
See secure_crt.cpp.

strnlen

 size_t strnlen( const char* str, size_t max_len );
See secure_crt.cpp.

subusw

 u16 subusw( u16 x, u16 y );
See lib.cpp.

swap16

 u16 swap16( const u16 x );
========================================================================= File : byte_order.cpp Project : 0 A.D. Description : byte order (endianness) support routines. =========================================================================
See byte_order.cpp.

swap32

 u32 swap32( const u32 x );
See byte_order.cpp.

swap64

 u64 swap64( const u64 x );
See byte_order.cpp.

symbol_string_add_to_cache

 static void symbol_string_add_to_cache( const char* string, void* symbol );
See debug.cpp.

symbol_string_build

 static const char* symbol_string_build( void* symbol, const char* name, const char* file, int line );
cache, mapping symbol address to its description string.
See debug.cpp.

symbol_string_from_cache

 static const char* symbol_string_from_cache( void* symbol );
See debug.cpp.

timer_add_client

 TimerClient* timer_add_client( TimerClient* tc, const char* description );
See timer.cpp.

timer_bill_client

 void timer_bill_client( TimerClient* tc, TimerUnit dt );
See timer.cpp.

timer_display_client_totals

 void timer_display_client_totals();
See timer.cpp.

timer_Init

 void timer_Init();
See timer.cpp.

timer_res

 double timer_res();
See timer.cpp.

timer_Shutdown

 void timer_Shutdown();
See timer.cpp.

tls_alloc

 static TLS* tls_alloc();
See lockfree.cpp.

tls_get

 static TLS* tls_get();
"Safe Memory Reclamation for Lock-Free Objects" via hazard pointers
See lockfree.cpp.

tls_init

 static void tls_init();
See debug.cpp.

tls_retire

 static void tls_retire( void* tls_ );
See lockfree.cpp.

tls_shutdown

 static void tls_shutdown();
See debug.cpp.

to_be16

 u16 to_be16( u16 x );
See byte_order.cpp.

to_be32

 u32 to_be32( u32 x );
See byte_order.cpp.

to_be64

 u64 to_be64( u64 x );
See byte_order.cpp.

to_le16

 u16 to_le16( u16 x );
See byte_order.cpp.

to_le32

 u32 to_le32( u32 x );
See byte_order.cpp.

to_le64

 u64 to_le64( u64 x );
See byte_order.cpp.

ts_make_vector

 template< typename T > std::vector< T > ts_make_vector( T* start, size_t size_bytes );
See self_test.h.

ts_str_contains

 bool ts_str_contains( const std::string& str1, const std::string& str2 );
See self_test.h.

u16_from_double

 u16 u16_from_double( double in );
See lib.cpp.

u16_from_larger

 template< typename T > u16 u16_from_larger( T x );
convert double to u8; verifies number is in range.
See lib.h.

u32_from_larger

 template< typename T > u32 u32_from_larger( T x );
See lib.h.

u32_from_u16

 u32 u32_from_u16( u16 hi, u16 lo );
See lib.cpp.

u32_hi

 u16 u32_hi( u32 x );
See lib.cpp.

u32_lo

 u16 u32_lo( u32 x );
See lib.cpp.

u64_from_u32

 u64 u64_from_u32( u32 hi, u32 lo );
See lib.cpp.

u64_hi

 u32 u64_hi( u64 x );
See lib.cpp.

u64_lo

 u32 u64_lo( u64 x );
See lib.cpp.

u8_from_double

 u8 u8_from_double( double in );
See lib.cpp.

validate

 static void validate( LFHash* hash );
See lockfree.cpp.

validate_da

 static LibError validate_da( DynArray* da );
See allocators.cpp.

with_mark

 static inline Node* with_mark( Node* p );
See lockfree.cpp.

without_mark

 static inline Node* without_mark( Node* p );
See lockfree.cpp.

write_be16

 void write_be16( void* p, u16 x );
See byte_order.cpp.

write_be32

 void write_be32( void* p, u32 x );
See byte_order.cpp.

write_be64

 void write_be64( void* p, u64 x );
See byte_order.cpp.

write_le16

 void write_le16( void* p, u16 x );
See byte_order.cpp.

write_le32

 void write_le32( void* p, u32 x );
See byte_order.cpp.

write_le64

 void write_le64( void* p, u64 x );
See byte_order.cpp.

xrand

 static uint xrand();
See rand.cpp.


Symbol Detail

__FUNCTION__

 #define __FUNCTION__ 0
See mmgr.h.

_CRTDBG_MAP_ALLOC

 #define _CRTDBG_MAP_ALLOC 
See mmgr.h.

BIG_ENDIAN

 #define BIG_ENDIAN 0x1234
See config.h.

BYTE_ORDER

 #define BYTE_ORDER BIG_ENDIAN
See config.h.

CALL_CONV

 #define CALL_CONV 
See ogl.h.

CONFIG_DISABLE_EXCEPTIONS

 #define CONFIG_DISABLE_EXCEPTIONS 0
See config.h.

CONFIG_FINAL

 #define CONFIG_FINAL 0
See config.h.

CONFIG_OMIT_FP

 #define CONFIG_OMIT_FP 0
See config.h.

CONFIG_OVERRUN_PROTECTION

 #define CONFIG_OVERRUN_PROTECTION 0
See config.h.

CONFIG_PARANOIA

 #define CONFIG_PARANOIA 0
See config.h.

CONFIG_RETURN64_EDX_EAX

 #define CONFIG_RETURN64_EDX_EAX 1
See config.h.

CONFIG_TIMER_ALLOW_RDTSC

 #define CONFIG_TIMER_ALLOW_RDTSC 0
See config.h.

CONFIG_TRACE

 #define CONFIG_TRACE 0
See config.h.

CONFIG_USE_MMGR

 #define CONFIG_USE_MMGR 0
See config.h.

CPU_ALPHA

 #define CPU_ALPHA 0
See config.h.

CPU_AMD64

 #define CPU_AMD64 0
See config.h.

CPU_ARM

 #define CPU_ARM 0
See config.h.

CPU_IA32

 #define CPU_IA32 0
See config.h.

CPU_IA64

 #define CPU_IA64 0
See config.h.

CPU_MIPS

 #define CPU_MIPS 0
See config.h.

CXXTEST_HAVE_EH

 #define CXXTEST_HAVE_EH 
See self_test.h.

CXXTEST_HAVE_STD

 #define CXXTEST_HAVE_STD 
See self_test.h.

DEBUG_PRINTF_BRIEF

 #define DEBUG_PRINTF_BRIEF if(debug_level >= DEBUG_LEVEL_BRIEF)    debug_printf
See debug.h.

DEBUG_PRINTF_DETAILED

 #define DEBUG_PRINTF_DETAILED if(debug_level >= DEBUG_LEVEL_DETAILED) debug_printf
See debug.h.

DEBUG_PRINTF_FULL

 #define DEBUG_PRINTF_FULL if(debug_level >= DEBUG_LEVEL_FULL    ) debug_printf
See debug.h.

FOURCC

 #define FOURCC FOURCC_LE
See byte_order.h.

fscanf_s

 #define fscanf_s fscanf
See secure_crt.h.

GCC_VERSION

 #define GCC_VERSION 0
See config.h.

GL_TEXTURE_IMAGE_SIZE_ARB

 #define GL_TEXTURE_IMAGE_SIZE_ARB 0x86A0
See ogl.h.

HAVE_C99

 #define HAVE_C99 1
See config.h.

HAVE_C99_MATH

 #define HAVE_C99_MATH 0
See config.h.

HAVE_GNU_ASM

 #define HAVE_GNU_ASM 0
See config.h.

HAVE_MKDIR

 #define HAVE_MKDIR 1
See config.h.

HAVE_MS_ASM

 #define HAVE_MS_ASM 0
See config.h.

HAVE_PCH

 #define HAVE_PCH 0
See config.h.

HAVE_SECURE_CRT

 #define HAVE_SECURE_CRT 0
See config.h.

HAVE_STL_HASH

 #define HAVE_STL_HASH 0
See config.h.

HAVE_STL_SLIST

 #define HAVE_STL_SLIST 0
See config.h.

HAVE_STRDUP

 #define HAVE_STRDUP 1
See config.h.

HAVE_VC_DEBUG_ALLOC

 #define HAVE_VC_DEBUG_ALLOC 0
See config.h.

HAVE_WCSDUP

 #define HAVE_WCSDUP 1
See config.h.

HAVE_X

 #define HAVE_X 0
See config.h.

i16

 #define i16 int16_t
See types.h.

i32

 #define i32 int32_t
See types.h.

i64

 #define i64 int64_t
See types.h.

i8

 #define i8 int8_t
See types.h.

ICC_VERSION

 #define ICC_VERSION 0
See config.h.

INCLUDED_ADTS

 #define INCLUDED_ADTS 
See adts.h.

INCLUDED_ALLOCATORS

 #define INCLUDED_ALLOCATORS 
See allocators.h.

INCLUDED_APP_HOOKS

 #define INCLUDED_APP_HOOKS 
See app_hooks.h.

INCLUDED_BASE32

 #define INCLUDED_BASE32 
See base32.h.

INCLUDED_BITS

 #define INCLUDED_BITS 
See bits.h.

INCLUDED_BYTE_ORDER

 #define INCLUDED_BYTE_ORDER 
See byte_order.h.

INCLUDED_CACHE_ADT

 #define INCLUDED_CACHE_ADT 
See cache_adt.h.

INCLUDED_CODE_ANNOTATION

 #define INCLUDED_CODE_ANNOTATION 
See code_annotation.h.

INCLUDED_CONFIG

 #define INCLUDED_CONFIG 
See config.h.

INCLUDED_DEBUG

 #define INCLUDED_DEBUG 
See debug.h.

INCLUDED_DEBUG_STL

 #define INCLUDED_DEBUG_STL 
See debug_stl.h.

INCLUDED_FNV_HASH

 #define INCLUDED_FNV_HASH 
See fnv_hash.h.

INCLUDED_INPUT

 #define INCLUDED_INPUT 
See input.h.

INCLUDED_LIB

 #define INCLUDED_LIB 
See lib.h.

INCLUDED_LIB_ERRORS

 #define INCLUDED_LIB_ERRORS 
See lib_errors.h.

INCLUDED_LOCKFREE

 #define INCLUDED_LOCKFREE 
See lockfree.h.

INCLUDED_MMGR

 #define INCLUDED_MMGR 
See mmgr.h.

INCLUDED_MODULE_INIT

 #define INCLUDED_MODULE_INIT 
See module_init.h.

INCLUDED_OGL

 #define INCLUDED_OGL 
See ogl.h.

INCLUDED_PATH_UTIL

 #define INCLUDED_PATH_UTIL 
See path_util.h.

INCLUDED_RAND

 #define INCLUDED_RAND 
See rand.h.

INCLUDED_REGEX

 #define INCLUDED_REGEX 
See regex.h.

INCLUDED_SECURE_CRT

 #define INCLUDED_SECURE_CRT 
See secure_crt.h.

INCLUDED_SELF_TEST

 #define INCLUDED_SELF_TEST 
See self_test.h.

INCLUDED_TIMER

 #define INCLUDED_TIMER 
See timer.h.

INCLUDED_TYPES

 #define INCLUDED_TYPES 
See types.h.

LCC_VERSION

 #define LCC_VERSION 0
See config.h.

LITTLE_ENDIAN

 #define LITTLE_ENDIAN 0x4321
See config.h.

MSC_VERSION

 #define MSC_VERSION 0
See config.h.

new

 #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
See mmgr.h.

NODEFAULT

 #define NODEFAULT default: UNREACHABLE
convenient specialization of UNREACHABLE for switch statements whose default can never be reached. example usage: int x; switch(x % 2) { case 0: break; case 1: break; NODEFAULT; }
See code_annotation.h.

ogl_WarnIfError

 #define ogl_WarnIfError 
See ogl.h.

OS_AMIGA

 #define OS_AMIGA 0
See config.h.

OS_BEOS

 #define OS_BEOS 0
See config.h.

OS_BSD

 #define OS_BSD 1
See config.h.

OS_LINUX

 #define OS_LINUX 0
See config.h.

OS_MAC

 #define OS_MAC 0
See config.h.

OS_MACOSX

 #define OS_MACOSX 0
See config.h.

OS_SOLARIS

 #define OS_SOLARIS 0
See config.h.

OS_UNIX

 #define OS_UNIX 1
See config.h.

OS_WIN

 #define OS_WIN 0
See config.h.

OS_WIN64

 #define OS_WIN64 0
See config.h.

REAL_GL_1_2

 #define REAL_GL_1_2 
See ogl.h.

REAL_GL_1_3

 #define REAL_GL_1_3 
See ogl.h.

REDEFINED_NEW

 #define REDEFINED_NEW 
See mmgr.h.

SAFE_STRCPY

 #define SAFE_STRCPY str##cpy
equivalent to strcpy, but indicates that the programmer checked usage and promises it is safe. (this macro prevents actually-safe instances of the function from showing up in searches)
See code_annotation.h.

SAFE_WCSCPY

 #define SAFE_WCSCPY wcs##cpy
See code_annotation.h.

STL_DINKUMWARE

 #define STL_DINKUMWARE 0
See config.h.

STL_GCC

 #define STL_GCC 0
See config.h.

STL_ICC

 #define STL_ICC 0
See config.h.

swap16

 #define swap16 _byteswap_ushort
See byte_order.h.

swap32

 #define swap32 _byteswap_ulong
See byte_order.h.

swap64

 #define swap64 _byteswap_uint64
See byte_order.h.

tcat_s

 #define tcat_s strcat_s
See secure_crt.cpp.

tcmp

 #define tcmp strcmp
See secure_crt.cpp.

tcpy

 #define tcpy strcpy
See secure_crt.cpp.

tcpy_s

 #define tcpy_s strcpy_s
See secure_crt.cpp.

tfopen

 #define tfopen fopen           
See secure_crt.cpp.

tfopen_s

 #define tfopen_s fopen_s
See secure_crt.cpp.

tncat_s

 #define tncat_s strncat_s
See secure_crt.cpp.

tncpy_s

 #define tncpy_s strncpy_s
See secure_crt.cpp.

tnlen

 #define tnlen strnlen
See secure_crt.cpp.

tprintf_s

 #define tprintf_s sprintf_s
See secure_crt.cpp.

u16

 #define u16 uint16_t
See types.h.

u32

 #define u32 uint32_t
See types.h.

u64

 #define u64 uint64_t
See types.h.

u8

 #define u8 uint8_t
See types.h.

UID2__

 #define UID2__ PASTE3__(LINE_, __LINE__, _2)
See code_annotation.h.

UID__

 #define UID__ PASTE3__(LINE_, __LINE__, _)
See code_annotation.h.

uint

 #define uint PS_uint
See types.h.

ulong

 #define ulong PS_ulong
See types.h.

UNREACHABLE

 #define UNREACHABLE ASSUME_UNREACHABLE
See code_annotation.h.

USE_IA32_FLOAT_TO_INT

 #define USE_IA32_FLOAT_TO_INT 0
See config.h.

vtnprintf

 #define vtnprintf vsnprintf    
See secure_crt.cpp.

WGL_HEADER_NEEDED

 #define WGL_HEADER_NEEDED 
See ogl.h.

WSECURE_CRT

 #define WSECURE_CRT 
See wsecure_crt.cpp.


Macro Detail

AH_IS_DEFINED

 #define AH_IS_DEFINED(name) app_hook_was_redefined(offsetof(AppHooks, name))
See app_hooks.h.

ARRAY_SIZE

 #define ARRAY_SIZE(name) (sizeof(name) / sizeof(name[0]))
number of array elements
See lib.h.

AT_STARTUP

 #define AT_STARTUP(code__namespace) { struct UID__{UID__() { code__; }} UID2__; }
execute the code passed as a parameter before main is entered. WARNING: if the source file containing this is not directly referenced from anywhere, linkers may discard that object file (unless linking statically). see http://www.cbloom.com/3d/techdocs/more_coding.txt
See lib.h.

BIT

 #define BIT(n) (1ul << (n))
value of bit number as unsigned long. @param n bit index (0..CHAR_BIT*sizeof(int)-1)
See bits.h.

BIT64

 #define BIT64(n) (1ull << (n))
value of bit number as unsigned long long. @param n bit index (0..CHAR_BIT*sizeof(int)-1)
See bits.h.

calloc

 #define calloc(num, size) mmgr_calloc_dbg (num,size,__FILE__,__LINE__,__FUNCTION__)
See mmgr.h.

cassert

 #define cassert(expr) struct UID__ { unsigned int CASSERT_FAILURE: (expr); }
compile-time debug_assert. causes a compile error if the expression evaluates to zero/false. no runtime overhead; may be used anywhere, including file scope. especially useful for testing sizeof types. this version has a more descriptive error message, but may cause a struct redefinition warning if used from the same line in different files. note: alternative method in C++: specialize a struct only for true; using it will raise 'incomplete type' errors if instantiated with false. @param expression that is expected to evaluate to non-zero at compile-time.
See code_annotation.h.

cassert2

 #define cassert2(expr) extern char CASSERT_FAILURE[1][(expr)]
compile-time debug_assert. causes a compile error if the expression evaluates to zero/false. no runtime overhead; may be used anywhere, including file scope. especially useful for testing sizeof types. this version has a less helpful error message, but redefinition doesn't trigger warnings. @param expression that is expected to evaluate to non-zero at compile-time.
See code_annotation.h.

CHECK_DA

 #define CHECK_DA(da) RETURN_ERR(validate_da(da))
See allocators.cpp.

CHECK_ERR

 #define CHECK_ERR(expressionSTMT(i64 err64__ = (i64expression;if(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAX;DEBUG_WARN_ERR(err__;return (LibErrorerr__ & UINT_MAX;}) 
See lib_errors.h.

CHECK_PATH

 #define CHECK_PATH(path) RETURN_ERR(path_validate(path))
return appropriate code if path is invalid, otherwise continue.
See path_util.h.

CONTAINER

 #define CONTAINER(name, type_name_patternelse) if(match_wildcard(type_name, type_name_pattern)){handled = true;valid = get_container_info((Any_##name*)p, size, el_size, el_count, el_iterator, it_mem);}
See debug_stl.cpp.

debug_assert

 #define debug_assert(expr) STMT(static u8 suppress__;if(!(expr)){switch(debug_assert_failed(#expr, &suppress__, __FILE__, __LINE__, __func__)){case ER_BREAK:debug_break();break;default:break;}})
make sure the expression evaluates to non-zero. used to validate invariants in the program during development and thus gives a very helpful warning if something isn't going as expected. sprinkle these liberally throughout your code! recommended use is debug_assert(expression && "descriptive string") - the string can pass more information about the problem on to whomever is seeing the error. rationale: we call this "debug_assert" instead of "assert" for the following reasons: - consistency (everything here is prefixed with debug_) and - to avoid inadvertent use of the much less helpful built-in CRT assert. if we were to override assert, it would be difficult to tell whether user source has included (possibly indirectly via other headers) and thereby stomped on our definition.
See debug.h.

debug_warn

 #define debug_warn(expr) STMT(static u8 suppress__;switch(debug_assert_failed(expr, &suppress__, __FILE__, __LINE__, __func__)){case ER_BREAK:debug_break();break;default:break;})
show a dialog to make sure unexpected states in the program are noticed. this is less error-prone than "debug_assert(0 && "text");" and avoids "conditional expression is constant" warnings. we'd really like to completely eliminate the problem; replacing 0 literals with extern volatile variables fools VC7 but isn't guaranteed to be free of overhead. we therefore just squelch the warning (unfortunately non-portable). this duplicates the code from debug_assert to avoid compiler warnings about constant conditions.
See debug.h.

DEBUG_WARN_ERR

 #define DEBUG_WARN_ERR(errSTMT(static u8 suppress__;switch(debug_warn_err(err, &suppress__, __FILE__, __LINE__, __func__{case ER_BREAK:debug_break(;break;default:break;}) 
if (LibError)err indicates an function failed, display the error dialog. used by CHECK_ERR et al., which wrap function calls and automatically warn user and return to caller.
See debug.h.

DISPLAY_ERROR

 #define DISPLAY_ERROR(text) debug_display_error(text, 0, 0,0, __FILE__,__LINE__,__func__, 0)
convenience version, in case the advanced parameters aren't needed. macro instead of providing overload/default values for C compatibility.
See debug.h.

E

 #define E(e) case e: debug_printf("%s\n", #e); break;
See ogl.cpp.

ENFORCE

 #define ENFORCE(condition, err_to_warn, retval) STMT(if(!(condition))                    {                                   DEBUG_WARN_ERR(err_to_warn);    return retval;                  }                                   )
See secure_crt.cpp.

ERROR_ASSOCIATE

 #define ERROR_ASSOCIATE(err, description, errno_equivalentstatic) LibErrorAssociation UID__ = { err, description, errno_equivalent };static int UID2__ = error_AddAssociation(&UID__);
See lib_errors.h.

FOURCC_BE

 #define FOURCC_BE(a, b, c, d) ( ((u32)(u8)a) << 24 | ((u32)(u8)b) << 16 | ((u32)(u8)c) << 8  | ((u32)(u8)d) << 0  )
big-endian version of FOURCC
See byte_order.h.

FOURCC_LE

 #define FOURCC_LE(a, b, c, d) ( ((u32)(u8)a) << 0  | ((u32)(u8)b) << 8  | ((u32)(u8)c) << 16 | ((u32)(u8)d) << 24 )
little-endian version of FOURCC
See byte_order.h.

free

 #define free(p) mmgr_free_dbg   (p,       __FILE__,__LINE__,__FUNCTION__)
See mmgr.h.

FUNC

 #define FUNC(ret, name, params) EXTERN_C ret (CALL_CONV *p##name) params;
See ogl.h.

FUNC2

 #define FUNC2(ret, nameARB, nameCore, version, params) EXTERN_C ret (CALL_CONV *p##nameARB) params;
See ogl.h.

getcwd

 #define getcwd(p, size) mmgr_getcwd_dbg(p, size,  __FILE__,__LINE__,__FUNCTION__)
See mmgr.h.

malloc

 #define malloc(size) mmgr_malloc_dbg (size,    __FILE__,__LINE__,__FUNCTION__)
See mmgr.h.

MATCH

 #define MATCH(known_extif(!strcmp(ext, #known_extreturn) true;
See ogl.cpp.

ONCE

 #define ONCE(ONCE_code__STMT(static bool ONCE_done__ = false;if(!ONCE_done__{ONCE_done__ = true;ONCE_code__;}) 
execute the code passed as a parameter only the first time this is reached. may be called at any time (in particular before main), but is not thread-safe. if that's important, use pthread_once() instead.
See lib.h.

ONCE_NOT

 #define ONCE_NOT(ONCE_code__STMT(static bool ONCE_done__ = false;if(!ONCE_done__ONCE_done__ = true;elseONCE_code__;) 
execute the code passed as a parameter except the first time this is reached. may be called at any time (in particular before main), but is not thread-safe.
See lib.h.

ONE_SIDE

 #define ONE_SIDE(x, x0, x1, x2) SIGN_EQ(x-x0, x-x1, x-x2)
See timer.cpp.

OVERRIDE_IF_NONZERO

 #define OVERRIDE_IF_NONZERO(HOOKNAME) if(new_ah->HOOKNAME) ah.HOOKNAME = new_ah->HOOKNAME;
See app_hooks.cpp.

PASTE3__

 #define PASTE3__(a, b, c) PASTE3_HIDDEN__(a, b, c)
See code_annotation.h.

PASTE3_HIDDEN__

 #define PASTE3_HIDDEN__(a, b, c) a ## b ## c
See code_annotation.h.

realloc

 #define realloc(p, size) mmgr_realloc_dbg(p,size,  __FILE__,__LINE__,__FUNCTION__)
See mmgr.h.

REL_ERR

 #define REL_ERR(correct, measured) (fabs((correct) - (measured)) / (correct))
See timer.cpp.

REPLACE

 #define REPLACE(what, withelse) if(!strncmp(src, (what), sizeof(what)-1)){src += sizeof(what)-1-1; strcpy(dst, (with)); dst += sizeof(with)-1;}
See debug_stl.cpp.

RETURN0_IF_ERR

 #define RETURN0_IF_ERR(expressionSTMT(i64 err64__ = (i64expression;if(err64__ < 0return 0;) 
See lib_errors.h.

RETURN_ERR

 #define RETURN_ERR(expressionSTMT(i64 err64__ = (i64expression;if(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAX;return err__;}) 
See lib_errors.h.

RETURN_IF_FALSE

 #define RETURN_IF_FALSE(okSTMT(if(!(okreturn ERR::FAIL;) 
See lib_errors.h.

SAFE_ARRAY_DELETE

 #define SAFE_ARRAY_DELETE(pSTMT(delete[] (p;	 (p= 0;) 
delete memory ensuing from new[] and set the pointer to zero (thus making double-frees safe / a no-op)
See lib.h.

SAFE_DELETE

 #define SAFE_DELETE(pSTMT(delete (p;	 (p= 0;) 
delete memory ensuing from new and set the pointer to zero (thus making double-frees safe / a no-op)
See lib.h.

SAFE_FREE

 #define SAFE_FREE(pSTMT(free((void*p;	 (p= 0;) 
free memory ensuing from malloc and set the pointer to zero (thus making double-frees safe / a no-op)
See lib.h.

SAFE_NEW

 #define SAFE_NEW(type, ptrtype*) ptr;try{ptr = new type();}catch(std::bad_alloc){ptr = 0;}
C++ new wrapper: allocates an instance of the given type and stores a pointer to it. sets pointer to 0 on allocation failure. this simplifies application code when on VC6, which may or may not throw/return 0 on failure.
See lib.h.

SIGN_EQ

 #define SIGN_EQ(x0, x1, x2) ( ((x0) * (x1)) > 0.0 && ((x1) * (x2)) > 0.0 )
See timer.cpp.

STATIC_STORAGE

 #define STATIC_STORAGE(name, sizestatic) u8 storage[(size)];static StaticStorage name = { storage, storage+(size) }
See allocators.h.

STD_CONTAINER

 #define STD_CONTAINER(name) CONTAINER(name, "std::" #name "<*>")
See debug_stl.cpp.

STMT

 #define STMT(STMT_code__) do { STMT_code__; } while(false)
package code into a single statement. @param STMT_code__ code to be bundled. (must be interpretable as a macro argument, i.e. sequence of tokens). the argument name is chosen to avoid conflicts. notes: - for(;;) { break; } and {} don't work because invocations of macros implemented with STMT often end with ";", thus breaking if() expressions. - we'd really like to eliminate "conditional expression is constant" warnings. replacing 0 literals with extern volatile variables fools VC7 but isn't guaranteed to be free of overhead. we will just squelch the warning (unfortunately non-portable).
See lib.h.

strdup

 #define strdup(p) mmgr_strdup_dbg(p,        __FILE__,__LINE__,__FUNCTION__)
See mmgr.h.

STRINGIZE

 #define STRINGIZE(id) STRINGIZE2(id)
See debug_stl.cpp.

STRINGIZE2

 #define STRINGIZE2(id) # id
See debug_stl.cpp.

STRIP

 #define STRIP(whatelse) if(!strncmp(src, (what), sizeof(what)-1)){src += sizeof(what)-1-1;}
See debug_stl.cpp.

STRIP_NESTED

 #define STRIP_NESTED(whatelse) if(!strncmp(src, (what), sizeof(what)-1)){if(src != name && src[-1] == ',')dst--;src += sizeof(what)-1;debug_assert(nesting == 0);nesting = 1;}
See debug_stl.cpp.

T

 #define T(string_literal) string_literal
See secure_crt.cpp.

THROW_ERR

 #define THROW_ERR(expressionSTMT(i64 err64__ = (i64expression;if(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAX;DEBUG_WARN_ERR(err__;throw err__;}) 
See lib_errors.h.

TIMER

 #define TIMER(description) ScopeTimer UID__(description)
See timer.h.

TIMER_ACCRUE

 #define TIMER_ACCRUE(client) ScopeTimerAccrue<> UID__(client)
See timer.h.

TIMER_ADD_CLIENT

 #define TIMER_ADD_CLIENT(idstatic) TimerClient UID__;static TimerClient* id = timer_add_client(&UID__, #id);
See timer.h.

TIMER_BEGIN

 #define TIMER_BEGIN(description) { ScopeTimer UID__(description)
See timer.h.

TIMER_END

 #define TIMER_END(description) }
See timer.h.

TS_ASSERT_OK

 #define TS_ASSERT_OK(expr) TS_ASSERT_EQUALS((expr), INFO::OK)
See self_test.h.

TS_ASSERT_STR_CONTAINS

 #define TS_ASSERT_STR_CONTAINS(str1, str2) TS_ASSERT(ts_str_contains(str1, str2))
See self_test.h.

TS_ASSERT_STR_EQUALS

 #define TS_ASSERT_STR_EQUALS(str1, str2) TS_ASSERT_EQUALS(std::string(str1), std::string(str2))
See self_test.h.

TS_ASSERT_VECTOR_EQUALS_ARRAY

 #define TS_ASSERT_VECTOR_EQUALS_ARRAY(vec1, array) TS_ASSERT_EQUALS(vec1, ts_make_vector((array), sizeof(array)))
See self_test.h.

TS_ASSERT_WSTR_EQUALS

 #define TS_ASSERT_WSTR_EQUALS(str1, str2) TS_ASSERT_EQUALS(std::wstring(str1), std::wstring(str2))
See self_test.h.

UNREACHABLESTMT

 #define UNREACHABLESTMT(debug_warn("hit supposedly unreachable code";abort(;) 
See code_annotation.h.

UNUSED

 #define UNUSED(param) 
mark a function parameter as unused and avoid the corresponding compiler warning. wrap around the parameter name, e.g. void f(int UNUSED(x))
See code_annotation.h.

UNUSED2

 #define UNUSED2(param) (void)param;
mark a function local variable or parameter as unused and avoid the corresponding compiler warning. use inside the function body, e.g. void f(int x) { UNUSED2(x); }
See code_annotation.h.

WARN_ERR

 #define WARN_ERR(expressionSTMT(i64 err64__ = (i64expression;if(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAX;DEBUG_WARN_ERR(err__;}) 
See lib_errors.h.

WARN_ERR_RETURN

 #define WARN_ERR_RETURN(expressionSTMT(i64 err64__ = (i64expression;if(err64__ < 0{LibError err__ = (LibErrorerr64__ & UINT_MAX;DEBUG_WARN_ERR(err__;return;}) 
See lib_errors.h.

WARN_IF_FALSE

 #define WARN_IF_FALSE(okSTMT(if(!(okdebug_warn("FYI: WARN_IF_FALSE reports that a function failed.""feel free to ignore or suppress this warning.";) 
See lib_errors.h.

WARN_IF_PTR_LEN

 #define WARN_IF_PTR_LEN(len) 
See secure_crt.cpp.

WARN_RETURN

 #define WARN_RETURN(errSTMT(DEBUG_WARN_ERR(err;return err;) 
See lib_errors.h.

WARN_RETURN_IF_FALSE

 #define WARN_RETURN_IF_FALSE(okSTMT(if(!(ok{debug_warn("FYI: WARN_RETURN_IF_FALSE reports that a function failed.""feel free to ignore or suppress this warning.";return ERR::FAIL;}) 
See lib_errors.h.

wcsdup

 #define wcsdup(p) mmgr_wcsdup_dbg(p,        __FILE__,__LINE__,__FUNCTION__)
See mmgr.h.

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD