[Mesa-dev] [PATCH v3 1/6] xmlconfig: refine driParseConfigFiles to use parseOneConfigFile

Michel Dänzer michel at daenzer.net
Wed Aug 15 08:18:45 UTC 2018


On 2018-08-06 05:19 AM, Qiang Yu wrote:
> Also prepare for the usage of following parseConfigDir patch.
> 
> Signed-off-by: Qiang Yu <Qiang.Yu at amd.com>
> ---
>  src/util/xmlconfig.c | 62 ++++++++++++++++++++++++----------------------------
>  1 file changed, 28 insertions(+), 34 deletions(-)
> 
> diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
> index d384791..50beede 100644
> --- a/src/util/xmlconfig.c
> +++ b/src/util/xmlconfig.c
> @@ -866,9 +866,8 @@ initOptionCache(driOptionCache *cache, const driOptionCache *info)
>      }
>  }
>  
> -/** \brief Parse the named configuration file */
>  static void
> -parseOneConfigFile(XML_Parser p)
> +_parseOneConfigFile(XML_Parser p)
>  {
>  #define BUF_SIZE 0x1000
>      struct OptConfData *data = (struct OptConfData *)XML_GetUserData (p);
> @@ -907,6 +906,28 @@ parseOneConfigFile(XML_Parser p)
>  #undef BUF_SIZE
>  }
>  
> +/** \brief Parse the named configuration file */
> +static void
> +parseOneConfigFile(struct OptConfData *data, const char *filename)
> +{
> +    XML_Parser p;
> +
> +    p = XML_ParserCreate (NULL); /* use encoding specified by file */
> +    XML_SetElementHandler (p, optConfStartElem, optConfEndElem);
> +    XML_SetUserData (p, data);
> +    data->parser = p;
> +    data->name = filename;
> +    data->ignoringDevice = 0;
> +    data->ignoringApp = 0;
> +    data->inDriConf = 0;
> +    data->inDevice = 0;
> +    data->inApp = 0;
> +    data->inOption = 0;
> +
> +    _parseOneConfigFile (p);
> +    XML_ParserFree (p);
> +}

What's the point of having the separate _parseOneConfigFile function?
It's not used outside of parseOneConfigFile AFAICT.


Apart from this, the series is

Acked-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list