util/xmlconfig: Indent to Mesa style.
I'm heavily editing this code, and having Mesa's style not apply sucks. Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>
This commit is contained in:
1694
src/util/xmlconfig.c
1694
src/util/xmlconfig.c
File diff suppressed because it is too large
Load Diff
@@ -43,31 +43,31 @@ extern "C" {
|
||||
|
||||
/** \brief Option data types */
|
||||
typedef enum driOptionType {
|
||||
DRI_BOOL, DRI_ENUM, DRI_INT, DRI_FLOAT, DRI_STRING
|
||||
DRI_BOOL, DRI_ENUM, DRI_INT, DRI_FLOAT, DRI_STRING
|
||||
} driOptionType;
|
||||
|
||||
/** \brief Option value */
|
||||
typedef union driOptionValue {
|
||||
unsigned char _bool; /**< \brief Boolean */
|
||||
int _int; /**< \brief Integer or Enum */
|
||||
float _float; /**< \brief Floating-point */
|
||||
char *_string; /**< \brief String */
|
||||
unsigned char _bool; /**< \brief Boolean */
|
||||
int _int; /**< \brief Integer or Enum */
|
||||
float _float; /**< \brief Floating-point */
|
||||
char *_string; /**< \brief String */
|
||||
} driOptionValue;
|
||||
|
||||
/** \brief Single range of valid values
|
||||
*
|
||||
* For empty ranges (a single value) start == end */
|
||||
typedef struct driOptionRange {
|
||||
driOptionValue start; /**< \brief Start */
|
||||
driOptionValue end; /**< \brief End */
|
||||
driOptionValue start; /**< \brief Start */
|
||||
driOptionValue end; /**< \brief End */
|
||||
} driOptionRange;
|
||||
|
||||
/** \brief Information about an option */
|
||||
typedef struct driOptionInfo {
|
||||
char *name; /**< \brief Name */
|
||||
driOptionType type; /**< \brief Type */
|
||||
driOptionRange *ranges; /**< \brief Array of ranges */
|
||||
unsigned int nRanges; /**< \brief Number of ranges */
|
||||
char *name; /**< \brief Name */
|
||||
driOptionType type; /**< \brief Type */
|
||||
driOptionRange *ranges; /**< \brief Array of ranges */
|
||||
unsigned int nRanges; /**< \brief Number of ranges */
|
||||
} driOptionInfo;
|
||||
|
||||
/** \brief Option cache
|
||||
@@ -75,26 +75,26 @@ typedef struct driOptionInfo {
|
||||
* \li One in <driver>Screen caching option info and the default values
|
||||
* \li One in each <driver>Context with the actual values for that context */
|
||||
typedef struct driOptionCache {
|
||||
driOptionInfo *info;
|
||||
/**< \brief Array of option infos
|
||||
*
|
||||
* Points to the same array in the screen and all contexts */
|
||||
driOptionValue *values;
|
||||
/**< \brief Array of option values
|
||||
*
|
||||
* \li Default values in screen
|
||||
* \li Actual values in contexts
|
||||
*/
|
||||
unsigned int tableSize;
|
||||
/**< \brief Size of the arrays
|
||||
*
|
||||
* In the current implementation it's not actually a size but log2(size).
|
||||
* The value is the same in the screen and all contexts. */
|
||||
driOptionInfo *info;
|
||||
/**< \brief Array of option infos
|
||||
*
|
||||
* Points to the same array in the screen and all contexts */
|
||||
driOptionValue *values;
|
||||
/**< \brief Array of option values
|
||||
*
|
||||
* \li Default values in screen
|
||||
* \li Actual values in contexts
|
||||
*/
|
||||
unsigned int tableSize;
|
||||
/**< \brief Size of the arrays
|
||||
*
|
||||
* In the current implementation it's not actually a size but log2(size).
|
||||
* The value is the same in the screen and all contexts. */
|
||||
} driOptionCache;
|
||||
|
||||
/** \brief Parse XML option info from configOptions
|
||||
*
|
||||
* To be called in <driver>CreateScreen
|
||||
* To be called in <driver>CreateScreen
|
||||
*
|
||||
* \param info pointer to a driOptionCache that will store the option info
|
||||
* \param configOptions XML document describing available configuration opts
|
||||
@@ -103,38 +103,38 @@ typedef struct driOptionCache {
|
||||
* it must be a public symbol __driConfigOptions. It is also passed as a
|
||||
* parameter to driParseOptionInfo in order to avoid driver-independent code
|
||||
* depending on symbols in driver-specific code. */
|
||||
void driParseOptionInfo (driOptionCache *info,
|
||||
const char *configOptions);
|
||||
void driParseOptionInfo(driOptionCache *info,
|
||||
const char *configOptions);
|
||||
/** \brief Initialize option cache from info and parse configuration files
|
||||
*
|
||||
* To be called in <driver>CreateContext. screenNum, driverName,
|
||||
* kernelDriverName, applicationName and engineName select device sections. */
|
||||
void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
|
||||
int screenNum, const char *driverName,
|
||||
const char *kernelDriverName,
|
||||
const char *applicationName, uint32_t applicationVersion,
|
||||
const char *engineName, uint32_t engineVersion);
|
||||
void driParseConfigFiles(driOptionCache *cache, const driOptionCache *info,
|
||||
int screenNum, const char *driverName,
|
||||
const char *kernelDriverName,
|
||||
const char *applicationName, uint32_t applicationVersion,
|
||||
const char *engineName, uint32_t engineVersion);
|
||||
/** \brief Destroy option info
|
||||
*
|
||||
* To be called in <driver>DestroyScreen */
|
||||
void driDestroyOptionInfo (driOptionCache *info);
|
||||
void driDestroyOptionInfo(driOptionCache *info);
|
||||
/** \brief Destroy option cache
|
||||
*
|
||||
* To be called in <driver>DestroyContext */
|
||||
void driDestroyOptionCache (driOptionCache *cache);
|
||||
void driDestroyOptionCache(driOptionCache *cache);
|
||||
|
||||
/** \brief Check if there exists a certain option */
|
||||
unsigned char driCheckOption (const driOptionCache *cache, const char *name,
|
||||
driOptionType type);
|
||||
unsigned char driCheckOption(const driOptionCache *cache, const char *name,
|
||||
driOptionType type);
|
||||
|
||||
/** \brief Query a boolean option value */
|
||||
unsigned char driQueryOptionb (const driOptionCache *cache, const char *name);
|
||||
unsigned char driQueryOptionb(const driOptionCache *cache, const char *name);
|
||||
/** \brief Query an integer option value */
|
||||
int driQueryOptioni (const driOptionCache *cache, const char *name);
|
||||
int driQueryOptioni(const driOptionCache *cache, const char *name);
|
||||
/** \brief Query a floating-point option value */
|
||||
float driQueryOptionf (const driOptionCache *cache, const char *name);
|
||||
float driQueryOptionf(const driOptionCache *cache, const char *name);
|
||||
/** \brief Query a string option value */
|
||||
char *driQueryOptionstr (const driOptionCache *cache, const char *name);
|
||||
char *driQueryOptionstr(const driOptionCache *cache, const char *name);
|
||||
|
||||
/**
|
||||
* Returns a hash of the options for this application.
|
||||
|
Reference in New Issue
Block a user