OpenSslSupport.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Root include file to support building OpenSSL Crypto Library.
Copyright (c) 2010 - 2011, 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.
**/
#ifndef __OPEN_SSL_SUPPORT_H__
#define __OPEN_SSL_SUPPORT_H__
#include <Base.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
//
// File operations are not required for building Open SSL,
// so FILE is mapped to VOID * to pass build
//
//
//
#if !defined(__CC_ARM) // if va_list is not already defined
#else // __CC_ARM
#endif
//
// #defines from EFI Application Toolkit required to buiild Open SSL
//
#define LOG_EMERG 0 /* system is unusable */
//
// Macros from EFI Application Toolkit required to buiild Open SSL
//
/* The offsetof() macro calculates the offset of a structure member
in its structure. Unfortunately this cannot be written down
portably, hence it is provided by a Standard C header file.
For pre-Standard C compilers, here is a version that usually works
(but watch out!): */
//
// Basic types from EFI Application Toolkit required to buiild Open SSL
//
typedef long time_t;
typedef unsigned long clock_t;
typedef int pid_t;
typedef void *DIR;
typedef void __sighandler_t (int);
//
// Structures from EFI Application Toolkit required to buiild Open SSL
//
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from CUT in seconds */
char *tm_zone; /* timezone abbreviation */
};
struct dirent {
};
struct stat {
long st_atimensec; /* nsec of last access */
long st_mtimensec; /* nsec of last data modification */
long st_ctimensec; /* nsec of last file status change */
};
//
// Externs from EFI Application Toolkit required to buiild Open SSL
//
extern int errno;
//
// Function prototypes from EFI Application Toolkit required to buiild Open SSL
//
void free (void *);
int isdigit (int);
int isspace (int);
int tolower (int);
int isupper (int);
int isxdigit (int);
int isalnum (int);
int strcmp (const char *, const char *);
char *strcpy (char *, const char *);
char *strcat (char *, const char *);
char *strchr (const char *, int);
int strcasecmp (const char *, const char *);
int strncasecmp (const char *, const char *, size_t);
char *strrchr (const char *, int);
unsigned long strtoul (const char *, char **, int);
long strtol (const char *, char **, int);
int printf (const char *, ...);
int sscanf (const char *, const char *, ...);
int open (const char *, int, ...);
int close (int);
void openlog (const char *, int, int);
void closelog (void);
void syslog (int, const char *, ...);
char *getenv (const char *);
void exit (int);
void abort (void);
//
// Global variables from EFI Application Toolkit required to buiild Open SSL
//
//
// Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions
//
#define strcmp AsciiStrCmp
#define assert(expression)
#endif