ReactOS  0.4.13-dev-1165-gd2976ca
arcsupp.c
Go to the documentation of this file.
1 /*
2  * PROJECT: FreeLoader
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Generic ARC Support Functions
5  * COPYRIGHT: Copyright 2019 Hermes Belusca-Maito
6  */
7 
8 /* INCLUDES ******************************************************************/
9 
10 #include <freeldr.h>
11 
12 /* FUNCTIONS *****************************************************************/
13 
14 PCHAR
16  IN ULONG Argc,
17  IN PCHAR Argv[],
18  IN OUT PULONG LastIndex OPTIONAL,
19  IN PCHAR ArgumentName)
20 {
21  ULONG i;
22  SIZE_T ArgNameLen = strlen(ArgumentName);
23 
24  for (i = (LastIndex ? *LastIndex : 0); i < Argc; ++i)
25  {
26  if (strlen(Argv[i]) >= ArgNameLen + 1 /* Count the '=' sign */ &&
27  _strnicmp(Argv[i], ArgumentName, ArgNameLen) == 0 &&
28  Argv[i][ArgNameLen] == '=')
29  {
30  /* Found it, return the value */
31  if (LastIndex) *LastIndex = i;
32  return &Argv[i][ArgNameLen + 1];
33  }
34  }
35 
36  if (LastIndex) *LastIndex = (ULONG)-1;
37  return NULL;
38 }
39 
40 PCHAR
42  IN ULONG Argc,
43  IN PCHAR Argv[],
44  IN PCHAR ArgumentName)
45 {
46  return GetNextArgumentValue(Argc, Argv, NULL, ArgumentName);
47 }
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:38
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PCHAR GetNextArgumentValue(IN ULONG Argc, IN PCHAR Argv[], IN OUT PULONG LastIndex OPTIONAL, IN PCHAR ArgumentName)
Definition: arcsupp.c:15
_Check_return_ _CRTIMP int __cdecl _strnicmp(_In_reads_or_z_(_MaxCount) const char *_Str1, _In_reads_or_z_(_MaxCount) const char *_Str2, _In_ size_t _MaxCount)
smooth NULL
Definition: ftsmooth.c:416
ULONG_PTR SIZE_T
Definition: typedefs.h:78
PCHAR GetArgumentValue(IN ULONG Argc, IN PCHAR Argv[], IN PCHAR ArgumentName)
Definition: arcsupp.c:41
unsigned int * PULONG
Definition: retypes.h:1
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68