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:
Eric Anholt 2020-09-10 16:54:38 -07:00 committed by Marge Bot
parent 91ccbb399f
commit 4f37161a8f
2 changed files with 890 additions and 888 deletions

File diff suppressed because it is too large Load diff

View file

@ -43,31 +43,31 @@ extern "C" {
/** \brief Option data types */ /** \brief Option data types */
typedef enum driOptionType { typedef enum driOptionType {
DRI_BOOL, DRI_ENUM, DRI_INT, DRI_FLOAT, DRI_STRING DRI_BOOL, DRI_ENUM, DRI_INT, DRI_FLOAT, DRI_STRING
} driOptionType; } driOptionType;
/** \brief Option value */ /** \brief Option value */
typedef union driOptionValue { typedef union driOptionValue {
unsigned char _bool; /**< \brief Boolean */ unsigned char _bool; /**< \brief Boolean */
int _int; /**< \brief Integer or Enum */ int _int; /**< \brief Integer or Enum */
float _float; /**< \brief Floating-point */ float _float; /**< \brief Floating-point */
char *_string; /**< \brief String */ char *_string; /**< \brief String */
} driOptionValue; } driOptionValue;
/** \brief Single range of valid values /** \brief Single range of valid values
* *
* For empty ranges (a single value) start == end */ * For empty ranges (a single value) start == end */
typedef struct driOptionRange { typedef struct driOptionRange {
driOptionValue start; /**< \brief Start */ driOptionValue start; /**< \brief Start */
driOptionValue end; /**< \brief End */ driOptionValue end; /**< \brief End */
} driOptionRange; } driOptionRange;
/** \brief Information about an option */ /** \brief Information about an option */
typedef struct driOptionInfo { typedef struct driOptionInfo {
char *name; /**< \brief Name */ char *name; /**< \brief Name */
driOptionType type; /**< \brief Type */ driOptionType type; /**< \brief Type */
driOptionRange *ranges; /**< \brief Array of ranges */ driOptionRange *ranges; /**< \brief Array of ranges */
unsigned int nRanges; /**< \brief Number of ranges */ unsigned int nRanges; /**< \brief Number of ranges */
} driOptionInfo; } driOptionInfo;
/** \brief Option cache /** \brief Option cache
@ -75,21 +75,21 @@ typedef struct driOptionInfo {
* \li One in <driver>Screen caching option info and the default values * \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 */ * \li One in each <driver>Context with the actual values for that context */
typedef struct driOptionCache { typedef struct driOptionCache {
driOptionInfo *info; driOptionInfo *info;
/**< \brief Array of option infos /**< \brief Array of option infos
* *
* Points to the same array in the screen and all contexts */ * Points to the same array in the screen and all contexts */
driOptionValue *values; driOptionValue *values;
/**< \brief Array of option values /**< \brief Array of option values
* *
* \li Default values in screen * \li Default values in screen
* \li Actual values in contexts * \li Actual values in contexts
*/ */
unsigned int tableSize; unsigned int tableSize;
/**< \brief Size of the arrays /**< \brief Size of the arrays
* *
* In the current implementation it's not actually a size but log2(size). * In the current implementation it's not actually a size but log2(size).
* The value is the same in the screen and all contexts. */ * The value is the same in the screen and all contexts. */
} driOptionCache; } driOptionCache;
/** \brief Parse XML option info from configOptions /** \brief Parse XML option info from configOptions
@ -103,38 +103,38 @@ typedef struct driOptionCache {
* it must be a public symbol __driConfigOptions. It is also passed as a * it must be a public symbol __driConfigOptions. It is also passed as a
* parameter to driParseOptionInfo in order to avoid driver-independent code * parameter to driParseOptionInfo in order to avoid driver-independent code
* depending on symbols in driver-specific code. */ * depending on symbols in driver-specific code. */
void driParseOptionInfo (driOptionCache *info, void driParseOptionInfo(driOptionCache *info,
const char *configOptions); const char *configOptions);
/** \brief Initialize option cache from info and parse configuration files /** \brief Initialize option cache from info and parse configuration files
* *
* To be called in <driver>CreateContext. screenNum, driverName, * To be called in <driver>CreateContext. screenNum, driverName,
* kernelDriverName, applicationName and engineName select device sections. */ * kernelDriverName, applicationName and engineName select device sections. */
void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info, void driParseConfigFiles(driOptionCache *cache, const driOptionCache *info,
int screenNum, const char *driverName, int screenNum, const char *driverName,
const char *kernelDriverName, const char *kernelDriverName,
const char *applicationName, uint32_t applicationVersion, const char *applicationName, uint32_t applicationVersion,
const char *engineName, uint32_t engineVersion); const char *engineName, uint32_t engineVersion);
/** \brief Destroy option info /** \brief Destroy option info
* *
* To be called in <driver>DestroyScreen */ * To be called in <driver>DestroyScreen */
void driDestroyOptionInfo (driOptionCache *info); void driDestroyOptionInfo(driOptionCache *info);
/** \brief Destroy option cache /** \brief Destroy option cache
* *
* To be called in <driver>DestroyContext */ * To be called in <driver>DestroyContext */
void driDestroyOptionCache (driOptionCache *cache); void driDestroyOptionCache(driOptionCache *cache);
/** \brief Check if there exists a certain option */ /** \brief Check if there exists a certain option */
unsigned char driCheckOption (const driOptionCache *cache, const char *name, unsigned char driCheckOption(const driOptionCache *cache, const char *name,
driOptionType type); driOptionType type);
/** \brief Query a boolean option value */ /** \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 */ /** \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 */ /** \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 */ /** \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. * Returns a hash of the options for this application.