Initial import.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
2531
Tools/Source/TianoTools/StrGather/StrGather.c
Normal file
2531
Tools/Source/TianoTools/StrGather/StrGather.c
Normal file
File diff suppressed because it is too large
Load Diff
84
Tools/Source/TianoTools/StrGather/StrGather.h
Normal file
84
Tools/Source/TianoTools/StrGather/StrGather.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. 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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
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:
|
||||
|
||||
StrGather.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Common defines and prototypes for StrGather.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _STR_GATHER_H_
|
||||
#define _STR_GATHER_H_
|
||||
|
||||
#define MALLOC(size) malloc (size)
|
||||
#define FREE(ptr) free (ptr)
|
||||
|
||||
#define PROGRAM_NAME "StrGather"
|
||||
|
||||
typedef CHAR16 WCHAR;
|
||||
|
||||
#define UNICODE_TO_ASCII(w) (INT8) ((w) & 0xFF)
|
||||
#define ASCII_TO_UNICODE(a) (WCHAR) ((UINT8) (a))
|
||||
|
||||
#define UNICODE_HASH L'#'
|
||||
#define UNICODE_BACKSLASH L'\\'
|
||||
#define UNICODE_SLASH L'/'
|
||||
#define UNICODE_EQUAL_SIGN L'='
|
||||
#define UNICODE_PLUS_SIGN L'+'
|
||||
|
||||
#define UNICODE_FILE_START 0xFEFF
|
||||
#define UNICODE_CR 0x000D
|
||||
#define UNICODE_LF 0x000A
|
||||
#define UNICODE_NULL 0x0000
|
||||
#define UNICODE_SPACE L' '
|
||||
#define UNICODE_SLASH L'/'
|
||||
#define UNICODE_DOUBLE_QUOTE L'"'
|
||||
#define UNICODE_Z L'Z'
|
||||
#define UNICODE_z L'z'
|
||||
#define UNICODE_A L'A'
|
||||
#define UNICODE_a L'a'
|
||||
#define UNICODE_F L'F'
|
||||
#define UNICODE_f L'f'
|
||||
#define UNICODE_UNDERSCORE L'_'
|
||||
#define UNICODE_0 L'0'
|
||||
#define UNICODE_9 L'9'
|
||||
#define UNICODE_TAB L'\t'
|
||||
#define UNICODE_NBR_STRING L"\\nbr"
|
||||
#define UNICODE_BR_STRING L"\\br"
|
||||
#define UNICODE_WIDE_STRING L"\\wide"
|
||||
#define UNICODE_NARROW_STRING L"\\narrow"
|
||||
|
||||
//
|
||||
// This is the length of a valid string identifier
|
||||
//
|
||||
#define LANGUAGE_IDENTIFIER_NAME_LEN 3
|
||||
|
||||
typedef struct _TEXT_STRING_LIST {
|
||||
struct _TEXT_STRING_LIST *Next;
|
||||
UINT8 *Str;
|
||||
} TEXT_STRING_LIST;
|
||||
|
||||
typedef struct _WCHAR_STRING_LIST {
|
||||
struct _WCHAR_STRING_LIST *Next;
|
||||
WCHAR *Str;
|
||||
} WCHAR_STRING_LIST;
|
||||
|
||||
typedef struct _WCHAR_MATCHING_STRING_LIST {
|
||||
struct _WCHAR_MATCHING_STRING_LIST *Next;
|
||||
WCHAR *Str1;
|
||||
WCHAR *Str2;
|
||||
} WCHAR_MATCHING_STRING_LIST;
|
||||
|
||||
#endif // #ifndef _STR_GATHER_H_
|
2751
Tools/Source/TianoTools/StrGather/StringDB.c
Normal file
2751
Tools/Source/TianoTools/StrGather/StringDB.c
Normal file
File diff suppressed because it is too large
Load Diff
136
Tools/Source/TianoTools/StrGather/StringDB.h
Normal file
136
Tools/Source/TianoTools/StrGather/StringDB.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation
|
||||
All rights reserved. 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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
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:
|
||||
|
||||
StringDB.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Common defines and prototypes for string database management
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _STRING_DB_H_
|
||||
#define _STRING_DB_H_
|
||||
|
||||
#define LANGUAGE_NAME_STRING_NAME L"$LANGUAGE_NAME"
|
||||
#define PRINTABLE_LANGUAGE_NAME_STRING_NAME L"$PRINTABLE_LANGUAGE_NAME"
|
||||
|
||||
void
|
||||
StringDBConstructor (
|
||||
void
|
||||
)
|
||||
;
|
||||
void
|
||||
StringDBDestructor (
|
||||
void
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBAddString (
|
||||
WCHAR *LanguageName,
|
||||
WCHAR *StringIdentifier,
|
||||
WCHAR *Scope,
|
||||
WCHAR *String,
|
||||
BOOLEAN Format,
|
||||
UINT16 Flags
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBSetScope (
|
||||
WCHAR *Scope
|
||||
)
|
||||
;
|
||||
|
||||
#define STRING_FLAGS_REFERENCED 0x0001 // if referenced somewhere
|
||||
#define STRING_FLAGS_UNDEFINED 0x0002 // if we added it for padding purposes
|
||||
#define STRING_FLAGS_INDEX_ASSIGNED 0x0004 // so don't change the index value
|
||||
#define STRING_ID_INVALID 0xFFFF
|
||||
#define STRING_ID_LANGUAGE_NAME 0x0000
|
||||
#define STRING_ID_PRINTABLE_LANGUAGE_NAME 0x0001
|
||||
|
||||
STATUS
|
||||
StringDBAddStringIdentifier (
|
||||
WCHAR *StringIdentifier,
|
||||
UINT16 *NewId,
|
||||
UINT16 Flags
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBReadDatabase (
|
||||
INT8 *DBFileName,
|
||||
BOOLEAN IgnoreIfNotExist,
|
||||
BOOLEAN Verbose
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBWriteDatabase (
|
||||
INT8 *DBFileName,
|
||||
BOOLEAN Verbose
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBDumpDatabase (
|
||||
INT8 *DBFileName,
|
||||
INT8 *OutputFileName,
|
||||
BOOLEAN Verbose
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBAddLanguage (
|
||||
WCHAR *LanguageName,
|
||||
WCHAR *PrintableLanguageName
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBDumpCStrings (
|
||||
INT8 *FileName,
|
||||
INT8 *BaseName,
|
||||
WCHAR_STRING_LIST *LanguagesOfInterest,
|
||||
WCHAR_MATCHING_STRING_LIST *IndirectionList
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBDumpStringDefines (
|
||||
INT8 *FileName,
|
||||
INT8 *BaseName
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBSetCurrentLanguage (
|
||||
WCHAR *LanguageName
|
||||
)
|
||||
;
|
||||
|
||||
STATUS
|
||||
StringDBSetStringReferenced (
|
||||
INT8 *StringIdentifierName,
|
||||
BOOLEAN IgnoreNotFound
|
||||
)
|
||||
;
|
||||
|
||||
void
|
||||
StringDBFormatString (
|
||||
WCHAR *String
|
||||
)
|
||||
;
|
||||
|
||||
#endif // #ifndef _STRING_DB_H_
|
1
Tools/Source/TianoTools/StrGather/build.gcc
Normal file
1
Tools/Source/TianoTools/StrGather/build.gcc
Normal file
@@ -0,0 +1 @@
|
||||
gcc -mno-cygwin -mno-cygwin -I "$WORKSPACE/MdePkg/Include/" -I"$WORKSPACE/MdePkg/Include/Ia32/" -I"../Common/" -I$WORKSPACE/MdePkg/Include/Protocol/ -I$WORKSPACE/MdePkg/Include/Common/ StrGather.c StringDB.c -o StrGather -L../Library-mingw -lCommon
|
119
Tools/Source/TianoTools/StrGather/build.xml
Normal file
119
Tools/Source/TianoTools/StrGather/build.xml
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
-->
|
||||
<project default="GenTool" basedir=".">
|
||||
<!--
|
||||
EDK StrGather Tool
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
-->
|
||||
<property name="ToolName" value="StrGather"/>
|
||||
<property name="FileSet" value="*.c *.h"/>
|
||||
|
||||
<taskdef resource="cpptasks.tasks"/>
|
||||
<typedef resource="cpptasks.types"/>
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
|
||||
|
||||
<property environment="env"/>
|
||||
|
||||
<property name="LINK_OUTPUT_TYPE" value="static"/>
|
||||
<property name="BUILD_DIR" value="${PACKAGE_DIR}/${ToolName}/tmp"/>
|
||||
|
||||
<target name="GenTool" depends="init, Tool">
|
||||
<echo message="Building the EDK Tool: ${ToolName}"/>
|
||||
</target>
|
||||
|
||||
<target name="init">
|
||||
<echo message="The EDK Tool: ${ToolName}"/>
|
||||
<mkdir dir="${BUILD_DIR}"/>
|
||||
<if>
|
||||
<equals arg1="${GCC}" arg2="cygwin"/>
|
||||
<then>
|
||||
<echo message="Cygwin Family"/>
|
||||
<property name="ToolChain" value="gcc"/>
|
||||
</then>
|
||||
<elseif>
|
||||
<os family="dos"/>
|
||||
<then>
|
||||
<echo message="Windows Family"/>
|
||||
<property name="ToolChain" value="msvc"/>
|
||||
</then>
|
||||
</elseif>
|
||||
<elseif>
|
||||
<os family="unix"/>
|
||||
<then>
|
||||
<echo message="UNIX Family"/>
|
||||
<property name="ToolChain" value="gcc"/>
|
||||
</then>
|
||||
</elseif>
|
||||
|
||||
<else>
|
||||
<echo>
|
||||
Unsupported Operating System
|
||||
Please Contact Intel Corporation
|
||||
</echo>
|
||||
</else>
|
||||
</if>
|
||||
<if>
|
||||
<equals arg1="${ToolChain}" arg2="msvc"/>
|
||||
<then>
|
||||
<property name="ext_static" value=".lib"/>
|
||||
<property name="ext_dynamic" value=".dll"/>
|
||||
<property name="ext_exe" value=".exe"/>
|
||||
</then>
|
||||
<elseif>
|
||||
<equals arg1="${ToolChain}" arg2="gcc"/>
|
||||
<then>
|
||||
<property name="ext_static" value=".a"/>
|
||||
<property name="ext_dynamic" value=".so"/>
|
||||
<property name="ext_exe" value=""/>
|
||||
</then>
|
||||
</elseif>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="Tool" depends="init">
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR}"
|
||||
outfile="${BIN_DIR}/${ToolName}"
|
||||
outtype="executable"
|
||||
libtool="${haveLibtool}"
|
||||
optimize="speed">
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet}"
|
||||
defaultexcludes="TRUE"
|
||||
excludes="*.xml *.inf"/>
|
||||
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<linkerarg value="${LIB_DIR}/CommonTools.lib"/>
|
||||
<linkerarg value="${LIB_DIR}/CustomizedCompress.lib"/>
|
||||
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
<target name="clean" depends="init">
|
||||
<echo message="Removing Intermediate Files Only"/>
|
||||
<delete>
|
||||
<fileset dir="${BUILD_DIR}" includes="*.obj"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="cleanall" depends="init">
|
||||
<echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>
|
||||
<delete dir="${BUILD_DIR}">
|
||||
<fileset dir="${BIN_DIR}" includes="${ToolName}${ext_exe}"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
</project>
|
Reference in New Issue
Block a user