Referência ao ficheiro src/vapiOptionsXML.h

Functions to handle options' xml export and import. Mais...

#include "vapiOptions.h"
#include <libxml/xmlwriter.h>
#include <libxml/xmlreader.h>
#include <stdarg.h>

Diagrama de dependências de inclusão para vapiOptionsXML.h:

Este grafo mostra quais são os ficheiros que incluem directamente ou indirectamente este ficheiro:

Ir para o código fonte deste ficheiro.

Definições de tipos

typedef void(*) vOptionsXMLGetOptionsCustom (xmlTextWriter *xmlOutput, vOptionsSettings *OptionsSettings, vOptions *Options)
 Function to Get the actual option from the options data structure and save them to xml.
typedef int(*) vOptionsXMLSetOptionsCustom (xmlTextReader *xmlInput, vOptions *Options)
 Function that sets custom options from an xml file.

Funções

int vapiOptionsXMLCheckOption (xmlTextReader *xmlInput, int ret)
 checks the options grabbed from the xml file.
void vapiOptionsXMLGetOptions (xmlTextWriter *xmlOutput, vOptionsSettings *OptionsSettings, vOptions *Options, vOptionsXMLGetOptionsCustom OptionsXMLGetOptions)
 This function grabs the options data from the xml file and stores it into the options data structure.
void vapiOptionsXMLOptionsElement (xmlTextWriter *xmlOutput, int NumberOfCustomOptions,...)
 defines the options dtd group. It accepts a list of custom option attributes.
void vapiOptionsXMLSetOptions (xmlTextReader *xmlInput, vOptions *Options, vOptionsXMLSetOptionsCustom OptionsXMLSetOptionsCustom)
 This function grabs the options data and saves it to the xml file.


Descrição detalhada

Functions to handle options' xml export and import.

Definido no ficheiro vapiOptionsXML.h.


Documentação dos tipos

void(* vOptionsXMLGetOptionsCustom)(xmlTextWriter *xmlOutput, vOptionsSettings *OptionsSettings, vOptions *Options)

Function to Get the actual option from the options data structure and save them to xml.

Definido na linha 14 do ficheiro vapiOptionsXML.h.

int(* vOptionsXMLSetOptionsCustom)(xmlTextReader *xmlInput, vOptions *Options)

Function that sets custom options from an xml file.

Definido na linha 22 do ficheiro vapiOptionsXML.h.


Documentação das funções

int vapiOptionsXMLCheckOption ( xmlTextReader *  xmlInput,
int  ret 
)

checks the options grabbed from the xml file.

Parâmetros:
ret previous xml handler state
Retorna:
the operation's state

Definido na linha 188 do ficheiro vapiOptionsXML.c.

Referenciado por vapiOptionsXMLSetOptions() e vapiOptionsXMLSetOptionsOperation().

00189 {
00190         char *nodeType;
00191         if ((nodeType =
00192              (char *) xmlTextReaderGetAttribute (xmlInput,
00193                                                  BAD_CAST "type")) == NULL)
00194         {
00195                 if (ret == 0)
00196                 {
00197                         return -1;
00198                 }
00199                 return 0;
00200         }
00201         return 1;
00202 
00203 }

Here is the caller graph for this function:

void vapiOptionsXMLGetOptions ( xmlTextWriter *  xmlOutput,
vOptionsSettings OptionsSettings,
vOptions Options,
vOptionsXMLGetOptionsCustom  OptionsXMLGetOptions 
)

This function grabs the options data from the xml file and stores it into the options data structure.

Definido na linha 472 do ficheiro vapiOptionsXML.c.

Referências vapiOptionsXMLGetBooleans(), vapiOptionsXMLGetChars(), vapiOptionsXMLGetChoices(), vapiOptionsXMLGetFloats() e vapiOptionsXMLGetInts().

Referenciado por vapiIOConfiguredToXML() e vapiMacroToXML().

00476 {
00477 
00478 
00479         if (OptionsXMLGetOptions != NULL)
00480         {
00481                 OptionsXMLGetOptions (xmlOutput, OptionsSettings, Options);
00482         }
00483 
00484         vapiOptionsXMLGetFloats (OptionsSettings, Options, xmlOutput);
00485 
00486         vapiOptionsXMLGetInts (OptionsSettings, Options, xmlOutput);
00487 
00488         vapiOptionsXMLGetChars (OptionsSettings, Options, xmlOutput);
00489 
00490         vapiOptionsXMLGetChoices (OptionsSettings, Options, xmlOutput);
00491 
00492         vapiOptionsXMLGetBooleans (OptionsSettings, Options, xmlOutput);
00493 
00494 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiOptionsXMLOptionsElement ( xmlTextWriter *  xmlOutput,
int  NumberOfCustomOptions,
  ... 
)

defines the options dtd group. It accepts a list of custom option attributes.

Definido na linha 497 do ficheiro vapiOptionsXML.c.

Referências v_printf() e vapiReturnStringPointer().

Referenciado por vapiIOXMLFileInit() e vapiMacroXMLFileInit().

00499 {
00500         va_list CustomOptions;
00501         char *DTDAttlistStart, *DTDAttlistEnd, *TempString, *TempString2,
00502                 *FinalString;
00503         int i;
00504         DTDAttlistStart = "type (ints | text | floats | choices | booleans";
00505         DTDAttlistEnd = ") #REQUIRED";
00506         TempString = vapiReturnStringPointer ("");
00507         va_start (CustomOptions, NumberOfCustomOptions);
00508         if (NumberOfCustomOptions > 0)
00509         {
00510                 TempString =
00511                         v_printf (" | %s", va_arg (CustomOptions, char *));
00512 
00513                 for (i = 1; i < NumberOfCustomOptions; i++)
00514                 {
00515                         TempString2 =
00516                                 v_printf ("%s | %s", TempString,
00517                                           va_arg (CustomOptions, char *));
00518                         free (TempString);
00519                         TempString = TempString2;
00520                 }
00521                 FinalString =
00522                         v_printf ("%s %s %s",
00523                                   DTDAttlistStart, TempString, DTDAttlistEnd);
00524                 free (TempString);
00525         }
00526         else
00527         {
00528                 FinalString =
00529                         v_printf ("%s %s", DTDAttlistStart, DTDAttlistEnd);
00530         }
00531         va_end (CustomOptions);
00532 
00533         xmlTextWriterWriteDTDElement (xmlOutput, BAD_CAST "option",
00534                                       BAD_CAST "(#PCDATA)");
00535         xmlTextWriterWriteDTDAttlist (xmlOutput, BAD_CAST "option",
00536                                       BAD_CAST FinalString);
00537         free (FinalString);
00538 }

Grafo de chamadas desta função:

Here is the caller graph for this function:

void vapiOptionsXMLSetOptions ( xmlTextReader *  xmlInput,
vOptions Options,
vOptionsXMLSetOptionsCustom  OptionsXMLSetOptionsCustom 
)

This function grabs the options data and saves it to the xml file.

Definido na linha 206 do ficheiro vapiOptionsXML.c.

Referências vapiOptionsXMLCheckOption(), vapiOptionsXMLSetBooleans(), vapiOptionsXMLSetChars(), vapiOptionsXMLSetChoices(), vapiOptionsXMLSetFloats(), vapiOptionsXMLSetInts() e vapiXMLNextElementNamed().

Referenciado por vapiIOConfiguredListFromXML() e vapiMacroFromXML().

00209 {
00210         int ret = 1, bk = 1;
00211 
00212 
00213         if (xmlTextReaderIsEmptyElement (xmlInput))
00214         {
00215                 return;
00216 
00217         }
00218         ret = vapiXMLNextElementNamed (xmlInput, "option");
00219 
00220         while (bk != -1 && ret != 0)
00221         {
00222 
00223                 if ((bk = vapiOptionsXMLCheckOption (xmlInput, ret)) == 0)
00224                 {
00225                         continue;
00226                 }
00227                 if (bk == -1)
00228                 {
00229                         break;
00230                 }
00231                 if (OptionsXMLSetOptionsCustom != NULL)
00232                 {
00233                         bk = OptionsXMLSetOptionsCustom (xmlInput, Options);
00234 
00235                         if (bk == 0)
00236                         {
00237 
00238                                 continue;
00239                         }
00240                         if (bk == -1)
00241                         {
00242                                 break;
00243                         }
00244                 }
00245 
00246                 if (strcmp
00247                     ((char *)
00248                      xmlTextReaderGetAttribute (xmlInput, BAD_CAST "type"),
00249                      "ints") == 0)
00250                 {
00251                         ret = vapiOptionsXMLSetInts (xmlInput, Options);
00252                 }
00253 
00254                 if ((bk = vapiOptionsXMLCheckOption (xmlInput, ret)) == 0)
00255                 {
00256 
00257                         continue;
00258                 }
00259                 if (bk == -1)
00260                 {
00261                         break;
00262                 }
00263 
00264                 if (strcmp
00265                     ((char *)
00266                      xmlTextReaderGetAttribute (xmlInput, BAD_CAST "type"),
00267                      "text") == 0)
00268                 {
00269                         ret = vapiOptionsXMLSetChars (xmlInput, Options);
00270                 }
00271                 if ((bk = vapiOptionsXMLCheckOption (xmlInput, ret)) == 0)
00272                 {
00273 
00274                         continue;
00275                 }
00276                 if (bk == -1)
00277                 {
00278                         break;
00279                 }
00280                 if (strcmp
00281                     ((char *)
00282                      xmlTextReaderGetAttribute (xmlInput, BAD_CAST "type"),
00283                      "floats") == 0)
00284                 {
00285                         ret = vapiOptionsXMLSetFloats (xmlInput, Options);
00286                 }
00287                 if ((bk = vapiOptionsXMLCheckOption (xmlInput, ret)) == 0)
00288                 {
00289 
00290                         continue;
00291                 }
00292                 if (bk == -1)
00293                 {
00294                         break;
00295                 }
00296                 if (strcmp
00297                     ((char *)
00298                      xmlTextReaderGetAttribute (xmlInput, BAD_CAST "type"),
00299                      "choices") == 0)
00300                 {
00301                         ret = vapiOptionsXMLSetChoices (xmlInput, Options);
00302                 }
00303                 if ((bk = vapiOptionsXMLCheckOption (xmlInput, ret)) == 0)
00304                 {
00305 
00306                         continue;
00307                 }
00308                 if (bk == -1)
00309                 {
00310                         break;
00311                 }
00312                 if (strcmp
00313                     ((char *)
00314                      xmlTextReaderGetAttribute (xmlInput, BAD_CAST "type"),
00315                      "booleans") == 0)
00316                 {
00317                         ret = vapiOptionsXMLSetBooleans (xmlInput, Options);
00318                 }
00319 
00320         }
00321 }

Grafo de chamadas desta função:

Here is the caller graph for this function:


Gerado em Tue Jul 24 10:39:33 2007 para Vapi por  doxygen 1.5.1