/** @file
Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Abstract:
Function prototypes and defines for string routines.
**/
#include <string.h>
#include <ctype.h>
#include "StringFuncs.h"
//
// Functions implementations
//
)
/*++
Routine Description:
Allocates a new string and copies 'String' to clone it
Arguments:
String The string to clone
Returns:
CHAR8* - NULL if there are not enough resources
--*/
{
}
return NewString;
}
)
/*++
Routine Description:
Remove all comments, leading and trailing whitespace from the string.
Arguments:
String The string to 'strip'
Returns:
EFI_STATUS
--*/
{
return EFI_INVALID_PARAMETER;
}
//
// Remove leading whitespace
//
}
}
//
// Comment BUGBUGs!
//
// What about strings? Comment characters are okay in strings.
// What about multiline comments?
//
*Pos = '\0';
}
*Pos = '\0';
}
//
// Remove trailing whitespace
//
Pos--
) {
}
*Pos = '\0';
return EFI_SUCCESS;
}
)
/*++
Routine Description:
Creates and returns a 'split' STRING_LIST by splitting the string
on whitespace boundaries.
Arguments:
String The string to 'split'
Returns:
EFI_STATUS
--*/
{
return NULL;
}
Output = NewStringList ();
Pos++;
}
for (EndOfSubString=Pos;
) {
}
if (EndOfSubString == Pos) {
break;
}
*EndOfSubString = '\0';
}
return Output;
}
)
/*++
Routine Description:
Creates a new STRING_LIST with 0 strings.
Returns:
STRING_LIST* - Null if there is not enough resources to create the object.
--*/
{
NewList = AllocateStringListStruct (0);
}
return NewList;
}
)
/*++
Routine Description:
Adds String to StringList. A new copy of String is made before it is
added to StringList.
Returns:
EFI_STATUS
--*/
{
OldList = *StringList;
return EFI_OUT_OF_RESOURCES;
}
return EFI_OUT_OF_RESOURCES;
}
memcpy (
);
*StringList = NewList;
return EFI_SUCCESS;
}
)
/*++
Routine Description:
Removes the last string from StringList and frees the memory associated
with it.
Arguments:
StringList The string list to remove the string from
Returns:
EFI_STATUS
--*/
{
if (StringList->Count == 0) {
return EFI_INVALID_PARAMETER;
}
StringList->Count--;
return EFI_SUCCESS;
}
)
/*++
Routine Description:
Allocates a STRING_LIST structure that can store StringCount strings.
Arguments:
StringCount The number of strings that need to be stored
Returns:
EFI_STATUS
--*/
{
}
)
/*++
Routine Description:
Frees all memory associated with StringList.
Arguments:
StringList The string list to free
Returns:
VOID
--*/
{
while (StringList->Count > 0) {
}
free (StringList);
}
)
/*++
Routine Description:
Generates a string that represents the STRING_LIST
Arguments:
StringList The string list to convert to a string
Returns:
CHAR8* - The string list represented with a single string. The returned
string must be freed by the caller.
--*/
{
Length = 2;
if (Count > 0) {
Length += 2;
}
}
return NewString;
}
NewString[0] = '\0';
if (Count > 0) {
}
}
return NewString;
}
)
/*++
Routine Description:
Prints out the string list
Arguments:
StringList The string list to print
Returns:
EFI_STATUS
--*/
{
}
}