ReactOS 0.4.15-dev-8236-g99f0937
arcsupp.c
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Generic ARC Support Functions
5 * COPYRIGHT: Copyright 2019-2024 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
6 */
7
8/* INCLUDES ******************************************************************/
9
10#include <freeldr.h>
11
12/* FUNCTIONS *****************************************************************/
13
14PSTR
16 _In_ ULONG Argc,
17 _In_ PCHAR Argv[],
18 _Inout_opt_ PULONG LastIndex,
19 _In_ PCSTR ArgumentName)
20{
21 ULONG i;
22 SIZE_T ArgNameLen = strlen(ArgumentName);
23
24 for (i = (LastIndex ? *LastIndex : 0); i < Argc; ++i)
25 {
26 if (Argv[i] /* NULL pointer is a valid entry in Argv: skip it */ &&
27 (strlen(Argv[i]) >= ArgNameLen + 1 /* Count the '=' sign */) &&
28 (_strnicmp(Argv[i], ArgumentName, ArgNameLen) == 0) &&
29 (Argv[i][ArgNameLen] == '='))
30 {
31 /* Found it, return the value */
32 if (LastIndex) *LastIndex = i;
33 return &Argv[i][ArgNameLen + 1];
34 }
35 }
36
37 if (LastIndex) *LastIndex = (ULONG)-1;
38 return NULL;
39}
40
41PSTR
43 _In_ ULONG Argc,
44 _In_ PCHAR Argv[],
45 _In_ PCSTR ArgumentName)
46{
47 return GetNextArgumentValue(Argc, Argv, NULL, ArgumentName);
48}
49
50/* EOF */
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
PSTR GetNextArgumentValue(_In_ ULONG Argc, _In_ PCHAR Argv[], _Inout_opt_ PULONG LastIndex, _In_ PCSTR ArgumentName)
Definition: arcsupp.c:15
PSTR GetArgumentValue(_In_ ULONG Argc, _In_ PCHAR Argv[], _In_ PCSTR ArgumentName)
Definition: arcsupp.c:42
#define NULL
Definition: types.h:112
#define _strnicmp(_String1, _String2, _MaxCount)
Definition: compat.h:23
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
#define _Inout_opt_
Definition: ms_sal.h:379
#define _In_
Definition: ms_sal.h:308
uint32_t * PULONG
Definition: typedefs.h:59
char * PSTR
Definition: typedefs.h:51
ULONG_PTR SIZE_T
Definition: typedefs.h:80
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51