/*****************************************************************************/
/*
                                 Support.h
*/
/*****************************************************************************/

#ifndef SUPPORT_H_LOADED
#define SUPPORT_H_LOADED 1

/* standard C header files */
#include <time.h>

/* VMS related header files */
#include <fab.h>
#include <nam.h>

/* application related header files */
#include "wasd.h"

/**********/
/* macros */
/**********/

/* the current size determined by the The Apache Group */
#define UNIQUE_ID_SIZE 19

/***********************/
/* function prototypes */
/***********************/

LIST_ENTRY* ListAddHead (LIST_HEAD*, LIST_ENTRY*, ulong);
LIST_ENTRY* ListAddTail (LIST_HEAD*, LIST_ENTRY*, ulong);
LIST_ENTRY* ListAddBefore (LIST_HEAD*, LIST_ENTRY*, LIST_ENTRY*, ulong);
LIST_ENTRY* ListRemove (LIST_HEAD*, LIST_ENTRY*);
LIST_ENTRY* ListRemoveTail (LIST_HEAD*);
LIST_ENTRY* ListRemoveHead (LIST_HEAD*);
ListDebug (LIST_HEAD*);

#ifdef __x86_64
void x86ASTs (char*, int);
#endif

char* AverageDurationString (REQUEST_STRUCT*, int64*, ulong);
int BytesPerSecond (ulong*, ulong*, ulong*);
char* ClientHostString (REQUEST_STRUCT*);
int ConvertFromUtf8 (char*, int, char);
int ConvertToUtf8 (char*, int, int);
int ConvertUtf8ToEscape (char*, char*, int);
int CopyTextIntoHtml (char*, char*, int);
char* DayOfWeekName (int64*);
char* DateTime (ulong*, int);
char* DigitDayTime (int64*);
char* DurationString (REQUEST_STRUCT*, int64*);
float FloatDeltaTime (ulong*);
int FormatProtection (ushort, char*);
char* GenerateCspNone (REQUEST_STRUCT*);
char* GenerateUniqueId (REQUEST_STRUCT*);
int GetVmsVersion ();
char* HtmlMetaInfo (REQUEST_STRUCT*, char*);
char* HttpStatusCodeText (int);
char* HttpStatusCodeExplanation (REQUEST_STRUCT*, int);
int HttpGetTime (char*, int64*);
int HttpGmTime (char*, int64*);
int HttpGmTimeString (char*, int64*);
int HttIsoTime (char*, int64*);
int HttpIsoTimeString (BOOL, char*, int64*);
BOOL HttpIfModifiedSince (REQUEST_STRUCT*, int64*, int);
void HttpIfRange (REQUEST_STRUCT*, int64*);
BOOL HttpIfUnModifiedSince (REQUEST_STRUCT*, int64*);
int ipow (int, int);
int MatchPerf ();
int PercentOf32 (ulong, ulong);
int PercentOf64 (uint64*, uint64*);
void SetAnyTime (char*, ulong*);
int SetGlobalSymbol (char*, char*);
char* ServerSignature (REQUEST_STRUCT*, char*, int);
char* SysTrnLnm (char*);
void TimeAdjustToGMT (int64*);
void TimeAdjustFromGMT (int64*);
void TimeSansYear (ulong*, char*);
void TimeSetHttpdUTC ();
void TimeUnix32ToVms64 (ulong, uint64*);
int TimeVmsToUnix (int64*, struct tm*);
void ThisLongAgo (int64*, char*);
char* UserAtClient (REQUEST_STRUCT *rqptr);
int VmsToHttpStatus (int);
#endif /* SUPPORT_H_LOADED */

/*****************************************************************************/
