CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

cssysdef.h File Reference

This file should be #included before any other Crystal Space header files. More...

#include "csdef.h"
#include "csutil/csosdefs.h"
#include "csextern.h"
#include <stdio.h>

Go to the source code of this file.

Defines

#define CS_MAXPATHLEN   1024
 Maximum length of a filesystem pathname.
#define CS_ALLOC_STACK_ARRAY(type, var, size)   type var [size]
 Dynamic stack memory allocation.
#define CS_TEMP_DIR   ""
 Directory for temporary files.
#define CS_TEMP_FILE   "$cs$.tmp"
 Name for temporary files.
#define CS_HEADER_GLOBAL(X, Y)   CS_HEADER_GLOBAL_COMPOSE(X,Y)
 The CS_HEADER_GLOBAL() macro composes a pathname from two components and wraps the path in `<' and `>'.
#define CS_HEADER_LOCAL(X, Y)   CS_HEADER_LOCAL_COMPOSE1(X,Y)
 The CS_HEADER_LOCAL() macro composes a pathname from two components and wraps the path in double-quotes.
#define CS_INITIALIZE_PLATFORM_APPLICATION
 Perform platform-specific application initializations.
#define CS_DEFINE_STATICALLY_LINKED_FLAG   bool scfStaticallyLinked = false;
 Define the scfStaticallyLinked variable.
#define CS_IMPLEMENT_FOREIGN_DLL
 The CS_IMPLEMENT_FOREIGN_DLL macro should be placed at the global scope in exactly one compilation unit comprising a foreign (non-Crystal Space) module.
#define CS_IMPLEMENT_PLUGIN
 The CS_IMPLEMENT_PLUGIN macro should be placed at the global scope in exactly one compilation unit comprising a plugin module.
#define CS_IMPLEMENT_APPLICATION
 The CS_IMPLEMENT_APPLICATION macro should be placed at the global scope in exactly one compilation unit comprising an application.
#define CS_REGISTER_STATIC_FOR_DESTRUCTION(getterFunc)   csStaticVarCleanup (getterFunc);
 Register a method that will destruct one static variable.
#define CS_STATIC_VARIABLE_CLEANUP   csStaticVarCleanup (0);
 Invoke the function that will call all destruction functions.
#define CS_IMPLEMENT_STATIC_VAR(getterFunc, Type, initParam)   CS_IMPLEMENT_STATIC_VAR_EXT(getterFunc,Type,initParam,_kill)
 Create a global variable thats created on demand.
#define CS_DECLARE_STATIC_CLASSVAR(var, getterFunc, Type)
 Declare a static variable inside a class.
#define CS_IMPLEMENT_STATIC_CLASSVAR(Class, var, getterFunc, Type, initParam)   CS_IMPLEMENT_STATIC_CLASSVAR_EXT(Class,var,getterFunc,Type,initParam,_kill)
 Create the static class variable that has been declared with CS_DECLARE_STATIC_CLASSVAR.
#define CS_DEPRECATED_METHOD   __attribute__ ((deprecated))
 Use the CS_DEPRECATED_METHOD macro in front of method declarations to indicate that they are deprecated.
#define CS_DEPRECATED_TYPE   __attribute__ ((deprecated))
 Use the CS_DEPRECATED_TYPE macro after type declarations to indicate that they are deprecated.
#define CS_IMPLEMENT_IMPLICIT_PTR_CAST(classname)
 Implements a static member function for a class which can be used to perform implicit pointer casts.
#define CS_IMPLICIT_PTR_CAST(classname, ptr)   (classname::_CS_IMPLICITPTRCAST_NAME(ptr))
 Perform a compiler implicit cast of a pointer to another pointer type using a static member function declared with the CS_IMPLEMENT_IMPLICIT_PTR_CAST macro.
#define CS_VA_COPY(dest, src)   dest = src;
 Copies the state of a va_list value.

Variables

void(* fatal_exit )(int errorcode, bool canreturn)
 Fatal exit routine (which can be replaced if neccessary).


Detailed Description

This file should be #included before any other Crystal Space header files.

It sets up a compilation environment which smooths over differences between platforms, allowing the same code to compile cleanly over a variety of operating systems and build tools. It also provides a number of utility macros useful to projects utilizing Crystal Space and to the Crystal Space code itself.

Definition in file cssysdef.h.


Define Documentation

#define CS_ALLOC_STACK_ARRAY type,
var,
size   )     type var [size]
 

Dynamic stack memory allocation.

Parameters:
type Type of the array elements.
var Name of the array to be allocated.
size Number of elements to be allocated.

Definition at line 86 of file cssysdef.h.

#define CS_DECLARE_STATIC_CLASSVAR var,
getterFunc,
Type   ) 
 

Value:

static Type *var;                                             \
static Type *getterFunc ();
Declare a static variable inside a class.

This will also declare a Getter function. Example:

 CS_DECLARE_STATIC_CLASSVAR (pool, GetVertexPool, csVertexPool)
 

Definition at line 463 of file cssysdef.h.

#define CS_DEFINE_STATICALLY_LINKED_FLAG   bool scfStaticallyLinked = false;
 

Define the scfStaticallyLinked variable.

Definition at line 307 of file cssysdef.h.

#define CS_DEPRECATED_METHOD   __attribute__ ((deprecated))
 

Use the CS_DEPRECATED_METHOD macro in front of method declarations to indicate that they are deprecated.

Example:

 struct iFoo : iBase {
   CS_DEPRECATED_METHOD virtual void Plankton() const = 0;
 }
Compilers which are capable of flagging deprecation will exhibit a warning when it encounters client code invoking methods so tagged.

Definition at line 647 of file cssysdef.h.

Referenced by csImageBase::GetKeycolor(), csImageBase::HasKeycolor(), and csHash< KeyInfo, csStrKey, csConstCharHashKeyHandler >::PutFirst().

#define CS_DEPRECATED_TYPE   __attribute__ ((deprecated))
 

Use the CS_DEPRECATED_TYPE macro after type declarations to indicate that they are deprecated.

Example:

 typedef csFoo csBar CS_DEPRECATED_TYPE;
Compilers which are capable of flagging deprecation will exhibit a warning when it encounters client code using types so tagged.

Definition at line 669 of file cssysdef.h.

#define CS_HEADER_GLOBAL X,
 )     CS_HEADER_GLOBAL_COMPOSE(X,Y)
 

The CS_HEADER_GLOBAL() macro composes a pathname from two components and wraps the path in `<' and `>'.

This macro is useful in cases where one does not have the option of augmenting the preprocessor's header search path, even though the include path for some header file may vary from platform to platform. For instance, on many platforms OpenGL headers are in a `GL' directory, whereas on other platforms they are in an `OpenGL' directory. As an example, in the first case, the platform might define the preprocessor macro GLPATH with the value `GL', and in the second case GLPATH would be given the value `OpenGL'. To actually include an OpenGL header, such as gl.h, the following code would be used:

 #include CS_HEADER_GLOBAL(GLPATH,gl.h)
 

Definition at line 178 of file cssysdef.h.

#define CS_HEADER_LOCAL X,
 )     CS_HEADER_LOCAL_COMPOSE1(X,Y)
 

The CS_HEADER_LOCAL() macro composes a pathname from two components and wraps the path in double-quotes.

This macro is useful in cases where one does not have the option of augmenting the preprocessor's header search path, even though the include path for some header file may vary from platform to platform. For example, assuming that the preprocessor macro UTILPATH is defined with some platform-specific value, to actually include a header, such as util.h, the following code would be used:

 #include CS_HEADER_LOCAL(UTILPATH,util.h)
 

Definition at line 193 of file cssysdef.h.

#define CS_IMPLEMENT_APPLICATION
 

Value:

CS_DECLARE_DEFAULT_STATIC_VARIABLE_REGISTRATION                 \
  CS_DEFINE_STATICALLY_LINKED_FLAG                                      \
  CS_DEFINE_STATIC_VARIABLE_REGISTRATION (csStaticVarCleanup_csutil);   \
  CS_IMPLEMENT_PLATFORM_APPLICATION
The CS_IMPLEMENT_APPLICATION macro should be placed at the global scope in exactly one compilation unit comprising an application.

For maximum portability, each application should employ this macro. Platforms may override the definition of this macro in order to augment the implementation of an application with any special implementation details required by the platform.

Definition at line 382 of file cssysdef.h.

#define CS_IMPLEMENT_FOREIGN_DLL
 

Value:

CS_DECLARE_DEFAULT_STATIC_VARIABLE_REGISTRATION                     \
       CS_DEFINE_STATICALLY_LINKED_FLAG                                     \
       CS_DEFINE_STATIC_VARIABLE_REGISTRATION (csStaticVarCleanup_csutil);
The CS_IMPLEMENT_FOREIGN_DLL macro should be placed at the global scope in exactly one compilation unit comprising a foreign (non-Crystal Space) module.

For maximum portability, each such module should employ this macro. This is useful for situations in which a dynamic load library (DLL) is being built for some other facility. Obvious examples are pure extension modules for Python, Perl, and Java. For Crystal Space plugins, instead use CS_IMPLEMENT_PLUGIN. Platforms may override the definition of this macro in order to augment the implementation of the foreign module with any special implementation details required by the platform.

Definition at line 329 of file cssysdef.h.

#define CS_IMPLEMENT_IMPLICIT_PTR_CAST classname   ) 
 

Value:

inline static classname* _CS_IMPLICITPTRCAST_NAME (classname* ptr) \
  { \
    return ptr;\
  }
Implements a static member function for a class which can be used to perform implicit pointer casts.

Parameters:
classname Name of the class that the macro is being used in.
Remarks:
This macro is intended to support typecasting within macros, allowing the compiler to provide a more descriptive error message. Use CS_IMPLEMENT_IMPLICIT_PTR_CAST() in the declaration of the class and CS_IMPLICIT_PTR_CAST() in the macro declaration.
Example:
 struct iObjectRegistry : public iBase
 {
   // Allow implicit casts through static function.
   CS_IMPLEMENT_IMPLICIT_PTR_CAST(iObjectRegistry);
   ...
 }

 #define CS_QUERY_REGISTRY_TAG(Reg, Tag) \
  csPtr<iBase> (CS_IMPLICIT_PTR_CAST(iObjectRegistry, Reg)->Get (Tag))

Definition at line 770 of file cssysdef.h.

#define CS_IMPLEMENT_PLUGIN
 

Value:

CS_IMPLEMENT_PLATFORM_PLUGIN                                    \
          CS_DEFINE_STATICALLY_LINKED_FLAG                              \
          CS_DECLARE_DEFAULT_STATIC_VARIABLE_REGISTRATION               \
          CS_DEFINE_STATIC_VARIABLE_REGISTRATION (csStaticVarCleanup_csutil);
The CS_IMPLEMENT_PLUGIN macro should be placed at the global scope in exactly one compilation unit comprising a plugin module.

For maximum portability, each plugin module must employ this macro. Platforms may override the definition of this macro in order to augment the implementation of the plugin module with any special implementation details required by the platform.

Definition at line 354 of file cssysdef.h.

#define CS_IMPLEMENT_STATIC_CLASSVAR Class,
var,
getterFunc,
Type,
initParam   )     CS_IMPLEMENT_STATIC_CLASSVAR_EXT(Class,var,getterFunc,Type,initParam,_kill)
 

Create the static class variable that has been declared with CS_DECLARE_STATIC_CLASSVAR.

This will also create the Getter function and the destruction function. The destruction function will be registered upon the first invocation of the Getter function. Example:

 CS_IMPLEMENT_STATIC_CLASSVAR (csPolygon2D, pool, GetVertexPool,
                               csVertexPool,)
 

Definition at line 514 of file cssysdef.h.

#define CS_IMPLEMENT_STATIC_VAR getterFunc,
Type,
initParam   )     CS_IMPLEMENT_STATIC_VAR_EXT(getterFunc,Type,initParam,_kill)
 

Create a global variable thats created on demand.

Create a Getter function to access the variable and a destruction function. The Getter function will register the destruction function on first invocation. Example:

 CS_IMPLEMENT_STATIC_VAR (GetVertexPool, csVertexPool,)
 
This will give you a global function GetVertexPool that returns a pointer to a static variable.

Definition at line 446 of file cssysdef.h.

#define CS_IMPLICIT_PTR_CAST classname,
ptr   )     (classname::_CS_IMPLICITPTRCAST_NAME(ptr))
 

Perform a compiler implicit cast of a pointer to another pointer type using a static member function declared with the CS_IMPLEMENT_IMPLICIT_PTR_CAST macro.

Parameters:
classname Name of the class to convert to
ptr Pointer to be convereted into
See also:
CS_IMPLEMENT_IMPLICIT_PTR_CAST

Definition at line 784 of file cssysdef.h.

#define CS_INITIALIZE_PLATFORM_APPLICATION
 

Perform platform-specific application initializations.

This macro should be invoked very near to the "beginning" of the application.

Remarks:
NB: It is invoked in csInitializer::CreateEnvironment().

Definition at line 237 of file cssysdef.h.

#define CS_MAXPATHLEN   1024
 

Maximum length of a filesystem pathname.

Useful for declaring character buffers for calls to system functions which return a pathname in the buffer.

Definition at line 71 of file cssysdef.h.

#define CS_REGISTER_STATIC_FOR_DESTRUCTION getterFunc   )     csStaticVarCleanup (getterFunc);
 

Register a method that will destruct one static variable.

Definition at line 393 of file cssysdef.h.

#define CS_STATIC_VARIABLE_CLEANUP   csStaticVarCleanup (0);
 

Invoke the function that will call all destruction functions.

Definition at line 401 of file cssysdef.h.

#define CS_TEMP_DIR   ""
 

Directory for temporary files.

Definition at line 101 of file cssysdef.h.

#define CS_TEMP_FILE   "$cs$.tmp"
 

Name for temporary files.

Definition at line 112 of file cssysdef.h.

#define CS_VA_COPY dest,
src   )     dest = src;
 

Copies the state of a va_list value.

Definition at line 799 of file cssysdef.h.


Variable Documentation

void(* fatal_exit)(int errorcode, bool canreturn)
 

Fatal exit routine (which can be replaced if neccessary).


Generated for Crystal Space by doxygen 1.3.9.1