variator__common_8c.tex 5.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. \hypertarget{variator__common_8c}{\section{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/variator\-\_\-common.c File Reference}
  2. \label{variator__common_8c}\index{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/variator\-\_\-common.\-c@{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/variator\-\_\-common.\-c}}
  3. }
  4. {\ttfamily \#include $<$S\-D\-L\-\_\-test.\-h$>$}\\*
  5. {\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-variator\-\_\-common.\-h\char`\"{}}\\*
  6. \subsection*{Functions}
  7. \begin{DoxyCompactItemize}
  8. \item
  9. int \hyperlink{variator__common_8c_aafcecc06c8feb24b6f6a509bfa9db681}{S\-D\-L\-Visual\-Test\-\_\-\-Next\-Value} (\hyperlink{union_s_d_l_visual_test___s_u_t_option_value}{S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Option\-Value} $\ast$var, \hyperlink{struct_s_d_l_visual_test___s_u_t_option}{S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Option} $\ast$opt)
  10. \item
  11. int \hyperlink{variator__common_8c_ad981c2efab849e76dc878ef8da9d6017}{S\-D\-L\-Visual\-Test\-\_\-\-Make\-Str\-From\-Variation} (\hyperlink{struct_s_d_l_visual_test___variation}{S\-D\-L\-Visual\-Test\-\_\-\-Variation} $\ast$variation, \hyperlink{struct_s_d_l_visual_test___s_u_t_config}{S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Config} $\ast$config, char $\ast$buffer, int size)
  12. \item
  13. int \hyperlink{variator__common_8c_ac87934906c51364778dc910ebca47b6c}{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Variation} (\hyperlink{struct_s_d_l_visual_test___variation}{S\-D\-L\-Visual\-Test\-\_\-\-Variation} $\ast$variation, \hyperlink{struct_s_d_l_visual_test___s_u_t_config}{S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Config} $\ast$config)
  14. \end{DoxyCompactItemize}
  15. \subsection{Detailed Description}
  16. Source file for some common functionality used by variators.
  17. \subsection{Function Documentation}
  18. \hypertarget{variator__common_8c_ac87934906c51364778dc910ebca47b6c}{\index{variator\-\_\-common.\-c@{variator\-\_\-common.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Init\-Variation@{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Variation}}
  19. \index{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Variation@{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Variation}!variator_common.c@{variator\-\_\-common.\-c}}
  20. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Variation}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Init\-Variation (
  21. \begin{DoxyParamCaption}
  22. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Variation} $\ast$}]{variation, }
  23. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Config} $\ast$}]{config}
  24. \end{DoxyParamCaption}
  25. )}}\label{variator__common_8c_ac87934906c51364778dc910ebca47b6c}
  26. Initializes the variation using the following rules\-:
  27. \begin{DoxyItemize}
  28. \item Boolean options are initialized to S\-D\-L\-\_\-\-F\-A\-L\-S\-E.
  29. \item Integer options are initialized to the minimum valid value they can hold.
  30. \item Enum options are initialized to the first element in the list of values they can take.
  31. \item String options are initialized to the name of the option.
  32. \end{DoxyItemize}
  33. \begin{DoxyReturn}{Returns}
  34. 1 on success, 0 on failure.
  35. \end{DoxyReturn}
  36. \hypertarget{variator__common_8c_ad981c2efab849e76dc878ef8da9d6017}{\index{variator\-\_\-common.\-c@{variator\-\_\-common.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Make\-Str\-From\-Variation@{S\-D\-L\-Visual\-Test\-\_\-\-Make\-Str\-From\-Variation}}
  37. \index{S\-D\-L\-Visual\-Test\-\_\-\-Make\-Str\-From\-Variation@{S\-D\-L\-Visual\-Test\-\_\-\-Make\-Str\-From\-Variation}!variator_common.c@{variator\-\_\-common.\-c}}
  38. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Make\-Str\-From\-Variation}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Make\-Str\-From\-Variation (
  39. \begin{DoxyParamCaption}
  40. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Variation} $\ast$}]{variation, }
  41. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Config} $\ast$}]{config, }
  42. \item[{char $\ast$}]{buffer, }
  43. \item[{int}]{size}
  44. \end{DoxyParamCaption}
  45. )}}\label{variator__common_8c_ad981c2efab849e76dc878ef8da9d6017}
  46. Converts a variation object into a string of command line arguments.
  47. \begin{DoxyParams}{Parameters}
  48. {\em variation} & Variation object to be converted. \\
  49. \hline
  50. {\em config} & Config object for the S\-U\-T. \\
  51. \hline
  52. {\em buffer} & Pointer to the buffer the arguments string will be copied into. \\
  53. \hline
  54. {\em size} & Size of the buffer.\\
  55. \hline
  56. \end{DoxyParams}
  57. \begin{DoxyReturn}{Returns}
  58. 1 on success, 0 on failure
  59. \end{DoxyReturn}
  60. \hypertarget{variator__common_8c_aafcecc06c8feb24b6f6a509bfa9db681}{\index{variator\-\_\-common.\-c@{variator\-\_\-common.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Next\-Value@{S\-D\-L\-Visual\-Test\-\_\-\-Next\-Value}}
  61. \index{S\-D\-L\-Visual\-Test\-\_\-\-Next\-Value@{S\-D\-L\-Visual\-Test\-\_\-\-Next\-Value}!variator_common.c@{variator\-\_\-common.\-c}}
  62. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Next\-Value}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Next\-Value (
  63. \begin{DoxyParamCaption}
  64. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Option\-Value} $\ast$}]{var, }
  65. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-S\-U\-T\-Option} $\ast$}]{opt}
  66. \end{DoxyParamCaption}
  67. )}}\label{variator__common_8c_aafcecc06c8feb24b6f6a509bfa9db681}
  68. \char`\"{}\-Increments\char`\"{} the value of the option by one and returns the carry. We wrap around to the initial value on overflow which makes the carry one. For example\-: \char`\"{}incrementing\char`\"{} an S\-D\-L\-\_\-\-F\-A\-L\-S\-E option makes it S\-D\-L\-\_\-\-T\-R\-U\-E with no carry, and \char`\"{}incrementing\char`\"{} an S\-D\-L\-\_\-\-T\-R\-U\-E option makes it S\-D\-L\-\_\-\-F\-A\-L\-S\-E with carry one. For integers, a random value in the valid range for the option is used.
  69. \begin{DoxyParams}{Parameters}
  70. {\em var} & Value of the option \\
  71. \hline
  72. {\em opt} & Object with metadata about the option\\
  73. \hline
  74. \end{DoxyParams}
  75. \begin{DoxyReturn}{Returns}
  76. 1 if there is a carry for enum and bool type options, 0 otherwise. 1 is always returned for integer and string type options. -\/1 is returned on error.
  77. \end{DoxyReturn}