Home | History | Annotate | Download | only in UefiStrGather
      1 /*++
      2 
      3 Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
      4 This program and the accompanying materials
      5 are licensed and made available under the terms and conditions of the BSD License
      6 which accompanies this distribution.  The full text of the license may be found at
      7 http://opensource.org/licenses/bsd-license.php
      8 
      9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 
     12 Module Name:
     13 
     14   StrGather.h
     15 
     16 Abstract:
     17 
     18   Common defines and prototypes for StrGather.
     19 
     20 --*/
     21 
     22 #ifndef _STR_GATHER_H_
     23 #define _STR_GATHER_H_
     24 
     25 #define MALLOC(size)  malloc (size)
     26 #define FREE(ptr)     do { if ((ptr) != NULL) { free (ptr); } } while (0)
     27 
     28 typedef CHAR16  WCHAR;
     29 
     30 #define UNICODE_TO_ASCII(w)   (INT8) ((w) & 0xFF)
     31 #define ASCII_TO_UNICODE(a)   (WCHAR) ((UINT8) (a))
     32 
     33 #define UNICODE_HASH          L'#'
     34 #define UNICODE_BACKSLASH     L'\\'
     35 #define UNICODE_SLASH         L'/'
     36 #define UNICODE_EQUAL_SIGN    L'='
     37 #define UNICODE_PLUS_SIGN     L'+'
     38 
     39 #define UNICODE_FILE_START    0xFEFF
     40 #define UNICODE_CR            0x000D
     41 #define UNICODE_LF            0x000A
     42 #define UNICODE_NULL          0x0000
     43 #define UNICODE_SPACE         L' '
     44 #define UNICODE_SLASH         L'/'
     45 #define UNICODE_DOUBLE_QUOTE  L'"'
     46 #define UNICODE_OPEN_PAREN    L'('
     47 #define UNICODE_CLOSE_PAREN   L')'
     48 #define UNICODE_Z             L'Z'
     49 #define UNICODE_z             L'z'
     50 #define UNICODE_A             L'A'
     51 #define UNICODE_a             L'a'
     52 #define UNICODE_F             L'F'
     53 #define UNICODE_f             L'f'
     54 #define UNICODE_UNDERSCORE    L'_'
     55 #define UNICODE_MINUS         L'-'
     56 #define UNICODE_0             L'0'
     57 #define UNICODE_9             L'9'
     58 #define UNICODE_TAB           L'\t'
     59 #define UNICODE_NBR_STRING    L"\\nbr"
     60 #define UNICODE_BR_STRING     L"\\br"
     61 #define UNICODE_WIDE_STRING   L"\\wide"
     62 #define UNICODE_NARROW_STRING L"\\narrow"
     63 
     64 //
     65 // This is the length of a valid string identifier
     66 //
     67 #define LANGUAGE_IDENTIFIER_NAME_LEN  128
     68 
     69 typedef struct _TEXT_STRING_LIST {
     70   struct _TEXT_STRING_LIST  *Next;
     71   UINT8                     *Str;
     72 } TEXT_STRING_LIST;
     73 
     74 typedef struct _WCHAR_STRING_LIST {
     75   struct _WCHAR_STRING_LIST *Next;
     76   WCHAR                     *Str;
     77 } WCHAR_STRING_LIST;
     78 
     79 typedef struct _WCHAR_MATCHING_STRING_LIST {
     80   struct _WCHAR_MATCHING_STRING_LIST  *Next;
     81   WCHAR                               *Str1;
     82   WCHAR                               *Str2;
     83 } WCHAR_MATCHING_STRING_LIST;
     84 
     85 #endif // #ifndef _STR_GATHER_H_
     86