//-----------------------------------------------------------------------------
//
//  $Logfile:: /Source/client.h                                               $
// $Revision:: 6                                                              $
//   $Author:: Burgermac                                                      $
//     $Date:: 2/5/02 7:35 PM                                                 $
//
// Copyright (C) 1998 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source is may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// DESCRIPTION:
// primary header for client
//

//define	PARANOID			// speed sapping error checking

#ifndef __CLIENT_H__
#define __CLIENT_H__

#include <math.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif

#include "ref.h"
#include "vid.h"
#include "screen.h"
#include "snd_sound.h"
#include "input.h"
#include "keys.h"
#include "cl_console.h"
#include "cdaudio.h"
#include "console3d.h"
#include "alias.h"

//=============================================================================

typedef struct
{
	qboolean		valid;			// cleared if delta parsing was invalid
	int				serverframe;
	int				servertime;		// server time the message is valid for (in msec)
	int				deltaframe;
	byte			areabits[MAX_MAP_AREAS/8];		// portalarea visibility bits
	player_state_t	playerstate;
	int				num_entities;
	int				parse_entities;	// non-masked index into cl_parse_entities array
} frame_t;

typedef struct
{
	entity_state_t	baseline;		// delta from this if not from a previous frame
	entity_state_t	current;
	entity_state_t	prev;			// will always be valid, but might just be a copy of current

	int			serverframe;		// if not current, this ent isn't in the frame

	int			trailcount;			// for diminishing grenade trails
	vec3_t		lerp_origin;		// for trails (variable hz)

	//
	// for client side commands
	//
	byte	last_frame;
	byte	last_anim;
	byte	last_gunframe;
	byte	last_gunanim;
	int	last_cmdtime;
} centity_t;


typedef struct
{
	char	name[MAX_QPATH];
	struct image_s	*skin;
	struct image_s	*icon;
	struct model_t	*model;
	struct image_s *damageskin;
	char	 iconname[MAX_QPATH];
} clientinfo_t;

// 2015 code
// this holds the bike model & skin info for each player
typedef struct
{
	struct image_s *skin;
	struct model_t *model;
} bikeinfo_t;

#define	CMD_BACKUP		64	// allow a lot of command backups for very fast systems

typedef struct inventory_s
{
	int icon;
	int amount;
} inventory_t;

//
// the client_state_t structure is wiped completely at every
// server map change
//
typedef struct
{
	int			timeoutcount;

	int			timedemo_frames;
	int			timedemo_start;

	qboolean	refresh_prepped;	// false if on new level or new ref dll
	qboolean	sound_prepped;		// ambient sounds can start
	qboolean	force_refdef;		// vid has changed, so we can't use a paused refdef

	int			parse_entities;		// index (not anded off) into cl_parse_entities[]

	usercmd_t	cmd;
	usercmd_t	cmds[CMD_BACKUP];	// each mesage will send several old cmds
	int			cmd_time[CMD_BACKUP];   // time sent, for calculating pings
	short		predicted_origins[CMD_BACKUP][3];   // for debug comparing against server

	float		predicted_step;            // for stair up smoothing
	unsigned	predicted_step_time;

	vec3_t		predicted_origin;	// generated by CL_PredictMovement
	vec3_t		predicted_angles;
	vec3_t		prediction_error;

	frame_t		frame;				// received from server
	int			surpressCount;    // number of messages rate supressed

	frame_t		frames[UPDATE_BACKUP];

	// the client maintains its own idea of view angles, which are
	// sent to the server each frame.  It is cleared to 0 upon entering each level.
	// the server sends a delta each frame which is added to the locally
	// tracked view angles to account for standing on rotating objects,
	// and teleport direction changes
	vec3_t		viewangles;

	int			time;			// this is the time value that the client
								// is rendering at.  allways <= cls.realtime
	int			initial_server_frame; /* FS */
	float		lerpfrac;		// between oldframe and frame

	refdef_t	refdef;

	vec3_t		v_forward, v_right, v_up;	// set when refdef.angles is set

	//
	// transient data from server
	//
	char		layout[1024];		// general 2D overlay
	inventory_t inventory[MAX_ITEMS];

	//
	// non-gameserver infornamtion
	// FIXME: move this cinematic stuff into the cin_t structure
	FILE		*cinematic_file;
	int			cinematictime;		// cls.realtime for first cinematic frame
	int			cinematicframe;
	char		cinematicpalette[768];
	qboolean	cinematicpalette_active;

	//
	// server state information
	//
	qboolean	attractloop;		// running the attract loop, any key will menu
	int			servercount;	// server identification for prespawns
	char		gamedir[MAX_QPATH];
	int			playernum;

	char		configstrings[MAX_CONFIGSTRINGS][MAX_QPATH];

	//
	// locally derived information from server state
	//
	struct model_t	*model_draw[MAX_MODELS];
	struct cmodel_s	*model_clip[MAX_MODELS];

	struct sfx_s	*sound_precache[MAX_SOUNDS];
	struct image_s	*image_precache[MAX_IMAGES];

	clientinfo_t	clientinfo[MAX_CLIENTS];
	clientinfo_t	baseclientinfo;
	int				map_sequence_number;
	int				hit_by_debris;
	// 2015 code
	bikeinfo_t		bikeinfo[MAX_CLIENTS];
} client_state_t;

extern	client_state_t	cl;

/*
==================================================================

the client_static_t structure is persistant through an arbitrary number
of server connections

==================================================================
*/

typedef enum {
	ca_uninitialized,
	ca_disconnected, 	// not talking to a server
	ca_connecting,		// sending request packets to the server
	ca_connected,		// netchan_t established, waiting for svc_serverdata
	ca_active			// game views should be displayed
} connstate_t;

typedef enum {
	dl_none,
	dl_model,
	dl_sound,
	dl_skin,
	dl_single
} dltype_t;		// download type

typedef enum {key_game, key_console, key_message, key_menu, key_console3d, key_menu3d} keydest_t;

typedef struct
{
	connstate_t	state;
	keydest_t	key_dest;

	int			framecount;
	int	spamTime; /* FS: !version reply */
	int	lastSpamTime; /* FS: !version reply */
	int			realtime;			// allways increasing, no clamping, etc
	float		frametime;			// seconds since last frame
	float		netFrametime;
	float		renderFrametime;

// screen rendering information
	float		disable_screen;		// showing loading plaque between levels
									// or changing rendering dlls
									// if time gets > 30 seconds ahead, break it
	int			disable_servercount;	// when we receive a frame and cl.servercount
									// > cls.disable_servercount, clear disable_screen

// connection information
	char		servername[128];	// name of server from original connect
	float		connect_time;		// for connection retransmits

	int			quakePort;		// a 16 bit value that allows quake servers
									// to work around address translating routers
	netchan_t	netchan;
	int			serverProtocol;		// in case we are doing some kind of version hack

	int			challenge;		// from the server to use for connecting

	qboolean	forcePacket;

	FILE		*download;		// file transfer from server
	char		downloadtempname[MAX_OSPATH];
	char		downloadname[MAX_OSPATH];
	int			downloadnumber;
	dltype_t	downloadtype;
	int			downloadpercent;

// demo recording info must be here, so it isn't cleared on level change
	qboolean	demorecording;
	qboolean	demowaiting;	// don't record until a non-delta message is received
	FILE *demofile;
	char		*hud;
	console3d_t	*currentconsole;
	console3d_t	*mainconsole;
	console3d_t	*genconsole;
	float		scaleSensitivity;
	qboolean	intermission_active;

#ifdef GAMESPY /* FS */
	int gamespystarttime;
	int gamespyupdate;
#endif
} client_static_t;

extern client_static_t	cls;

//=============================================================================

//
// cvars
//
extern	cvar_t	*cl_stereo_separation;
extern	cvar_t	*cl_stereo;

extern	cvar_t	*cl_gun;
extern	cvar_t	*cl_add_blend;
extern	cvar_t	*cl_add_lights;
extern	cvar_t	*cl_add_particles;
extern	cvar_t	*cl_add_entities;
extern	cvar_t	*cl_predict;
extern	cvar_t	*cl_footsteps;
extern	cvar_t	*cl_noskins;
extern	cvar_t	*cl_autoskins;
extern	cvar_t	*cl_add_triangles;
extern	cvar_t	*cl_add_detailmodels;
extern	cvar_t	*cl_add_bulletholes;
extern	cvar_t	*cl_add_glows;
extern	cvar_t	*cl_forcecinematic;
extern	cvar_t	*cl_nospeech;
extern	cvar_t	*cl_speechdelay;
extern	cvar_t	*cl_upspeed;
extern	cvar_t	*cl_forwardspeed;
extern	cvar_t	*cl_sidespeed;

extern	cvar_t	*cl_yawspeed;
extern	cvar_t	*cl_pitchspeed;

extern	cvar_t	*cl_run;

extern	cvar_t	*cl_anglespeedkey;

extern	cvar_t	*cl_shownet;
extern	cvar_t	*cl_showmiss;
extern	cvar_t	*cl_showclamp;

extern cvar_t *lookspring;
extern cvar_t *lookstrafe;
extern cvar_t *sensitivity;
extern cvar_t *zoomscale;
extern cvar_t *cl_dumpdemo;
extern cvar_t *cl_document;
extern cvar_t *cl_hudfile;
extern cvar_t *hand;
extern cvar_t *gl_mode;
extern cvar_t *gl_driver;
extern cvar_t *gl_picmip;
extern cvar_t *gl_ext_palettedtexture;
extern cvar_t *gl_finish;
extern cvar_t *vid_ref;
extern cvar_t *vid_gamma;
extern cvar_t *scr_shotname;
extern struct model_t *cl_bullethole;

extern	cvar_t	*m_pitch;
extern	cvar_t	*m_yaw;
extern	cvar_t	*m_forward;
extern	cvar_t	*m_side;

extern	cvar_t	*freelook;

extern	cvar_t	*cl_lightlevel;	// FIXME HACK

extern	cvar_t	*cl_paused;
extern	cvar_t	*cl_timedemo;

extern	cvar_t	*cl_skiplogon; /* FS */
/* Knightmare- whether to adjust fov for wide aspect ratio */
extern	cvar_t	*cl_widescreen_fov;

extern int			cl_status_total;
extern int			cl_status_current;
extern const char	*cl_status_string1;
extern const char	*cl_status_string2;
extern int			cl_total;
extern int			cl_current;

#ifdef SPLIT_NETWORK_FRAME
extern  cvar_t  *cl_async;
#endif

extern	cvar_t	*cl_autorepeat_allkeys; /* FS: Added */

typedef struct
{
	int		key;				// so entities can reuse same entry
	vec3_t	color;
	vec3_t	origin;
	float	radius;
	float	die;				// stop lighting after this time
	float	decay;				// drop this each second
	float	minlight;			// don't add when contributing less
} cdlight_t;

typedef struct particle_s
{
	struct      particle_s	*next;
	float		   time;
	vec3_t		org;
	vec3_t		vel;
	vec3_t		accel;
	int			lightstyle;
	int			index;
	byte		flags;
	// added variable size stuff
	byte		size;
	signed char	growrate;
	byte		pad;
} cparticle_t;

extern	centity_t	cl_entities[MAX_EDICTS];
extern	cdlight_t	cl_dlights[MAX_DLIGHTS];

// the cl_parse_entities must be large enough to hold UPDATE_BACKUP frames of
// entities, so that when a delta compressed message arives from the server
// it can be un-deltad from the original
#define	MAX_PARSE_ENTITIES	1024
extern	entity_state_t	cl_parse_entities[MAX_PARSE_ENTITIES];

//=============================================================================

extern	netadr_t	net_from;
extern	sizebuf_t	net_message;

void SINDrawString (int x, int y, const char *s);
void DrawAltString (int x, int y, const char *s);	// toggle high bit
qboolean	CL_CheckOrDownloadFile (const char *filename);

extern void CL_AddNetgraph (void);
extern int entitycmpfnc( const void *a, const void *b );

void CL_ParticleEffect (vec3_t org, vec3_t dir, int color, int count);
void CL_ParticleEffect2 (vec3_t org, vec3_t dir, int color, int count);
void CL_ParticleStream ( centity_t *ent, int lightstyle, float density, float velocity, float randoffset, float gravity, /*qboolean random*/ int flags, qboolean shockwave );
void CL_ParticleStreamEffect ( vec3_t start, vec3_t end, int lightstyle, float density, float velocity, float randoffset, float gravity, int flags );
void CL_Shockwave( vec3_t org, int life, int scale, float alpha );
void TempShockwave( vec3_t pos, trace_t trace );
// 2015 code
void CL_ParticleStreamEffectSized ( vec3_t start, vec3_t end, int lightstyle, float density, float velocity, float randoffset, float gravity, int flags, byte size, signed char growrate );

//=================================================

void CL_ClearEffects (void);
void CL_ClearTEnts (void);
void CL_BlasterTrail (vec3_t start, vec3_t end);
void CL_QuadTrail (vec3_t start, vec3_t end);
void CL_RailTrail ( vec3_t start, vec3_t end, int lightstyle );
void TempExplosion ( vec3_t origin, float scale );
void TempPulseExplosion ( vec3_t origin );
void CL_BubbleTrail (vec3_t start, vec3_t end);

int CL_ParseEntityBits (unsigned *bits);
void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int number, int bits);
void CL_ParseFrame (void);

void CL_ParseTEnt (void);
void CL_ParseConfigString (void);
void CL_ParseMuzzleFlash (void);
void CL_ParseMuzzleFlash2 (void);
void SmokeAndFlash(vec3_t origin);

void CL_SetLightstyle (int i);

void CL_RunParticles (void);
void CL_RunDLights (void);
void CL_RunLightStyles (void);

void CL_AddEntities (void);
void CL_AddDLights (void);
void CL_AddTEnts (void);
void CL_AddLightStyles (void);

entity_t *V_FindEntity( int realnum );

// Triangle effects for bullets

#define MIN_TRIANGLE_SIZE     3
#define MAX_TRIANGLE_SIZE     5
#define TRIANGLE_POWER        20
#define TRIANGLE_PERCENTAGE   127
#define TRIANGLE_THICKNESS    8

void CL_ClearTriangles (void);
void CL_AddTriangles (void);
void CL_TriangleEffect ( int ent, int min_size, int max_size,vec3_t dir, float power, float percentage, int thickness,const vec3_t origin, char *surfname, int type, int lightstyle );
void CL_ParseConsoleStates ( void );
void CL_ParseConsoleSingleState ( void );
void CL_ParseSurfaceStates (qboolean single);
qboolean CL_LightStyleColor( int style, int time, float color[4] );
void CL_SinParticleEffect(const vec3_t org,const vec3_t dir, int lightstyle, int count, qboolean scatter, byte flags);
void CL_SinParticleEffect2( vec3_t org, vec3_t dir, int lightstyle, int count, qboolean scatter, byte flags);
extern float CL_Random( float n );
// 2015 code
void CL_SinParticleEffectSized(const vec3_t org,const vec3_t dir, int lightstyle, int count, qboolean scatter, byte flags, byte size, signed char growrate);
void CL_SinParticleEffect2Sized( vec3_t org, vec3_t dir, int lightstyle, int count, qboolean scatter, byte flags, byte size, signed char growrate);
void CL_SinParticleEffectFull( vec3_t org, vec3_t dir, int lightstyle, int count, qboolean scatter, byte flags, byte size, signed char growrate, int speed, int spread, vec3_t accel);
void CL_RicochetSound( vec3_t pos, int surfacetype, float timeofs );
void CL_CMDS_ProcessCommands( int entnum, int defhandle, int argc, const char **argv );
void CL_CMDS_ProcessFile( const char *filename );
void CL_FootStep( centity_t *ent );
trace_t CL_WorldTrace (const vec3_t start,const vec3_t mins,const vec3_t maxs,const vec3_t end, int contents_mask );
trace_t CL_GenericTrace (vec3_t start,const vec3_t mins,const vec3_t maxs, vec3_t end, int contents_mask, qboolean fulltrace, int passentnum);
void CL_UpdateMusic( void );
void CL_NewSoundtrack( const char *name );
void CL_ResetMusic( void );
void CL_RandomLocalSound( const char *name );
void CONSOLE_CheckResize( void );
void CL_AddBeams( void );
void CL_ProcessTexinfoCommand( int surface_number, surface_state_t *state, int flags );
void CL_BuildSurfaceList( void );
void CL_ProcessSurfaces( void );
void CONSOLE_DrawPrintScreen( void );
void CL_Begin_f(void);
void CONSOLE_BeginLevel_f(void);
// 2015 code
void CL_AnimeRocketTrail (vec3_t start, vec3_t end);
void CL_ThrowerParticleEffect(vec3_t org, vec3_t dest);
void CL_ThrowerRowParticleEffect(vec3_t org, vec3_t dest, vec3_t org2, vec3_t dest2);
void CL_ThrowerHitParticleEffect(vec3_t org, vec3_t dir);
void CL_FlameParticleEffect(vec3_t org, vec3_t dira, vec3_t dest, vec3_t dirb, int seperation, int count, int lightstyle, byte flags, byte size, signed char growrate);
void CL_FlameTrail(vec3_t start, vec3_t end);
void CL_DeathFlames(vec3_t start, vec3_t end, centity_t *old);
void CL_NukeEffect(vec3_t org, int size, int lightstyle);
void CL_HoverBoostEffect(vec3_t org, int yawofs);
void CL_HoverEffect(entity_t *ent);
void CL_HoverThrust(vec3_t prevorg, entity_t *ent);
void CL_HoverTurbo(vec3_t prevorg, entity_t *ent);
void CL_PlasmaTrail(vec3_t start, vec3_t end, centity_t *owner);
void CL_PlasmaTrail2(vec3_t start, vec3_t end);
void CL_PlasmaExplosion(vec3_t org, float scale);
void CL_NukeTrailParticles (vec3_t origin);

#define MAGIC_UNUSED_NUMBER 7777
extern entity_t *current_entity;
extern int sound_started;


void CL_ClearTempmodels( void );
void CL_AddTempmodels( void );
void CL_TempmodelEffect( entity_t *ent, float alphavel, float scalevel, float dietime, vec3_t vel, const char *bouncesound, int flags, float minscale );
void CL_StrikeSurfaceSound( vec3_t pos, int surfacetype );
void CL_ClearTempdlights( void );
void CL_AddTempdlights( void );
void CL_TempdlightEffect( vec3_t origin, float r, float g, float b, float radius, float time, float decay );
void CL_UpdateMood( int current_mood, int fallback_mood );
void CL_ClipMoveToEntities ( vec3_t start,const vec3_t mins,const vec3_t maxs, vec3_t end, trace_t *tr, int contents_mask, qboolean fulltrace, int passent );
void CL_Pause_f( void );
void VectorToAngles( vec3_t vec, vec3_t angles );
void CL_UpdateBarrelPosition( entity_t *ent );
void CL_LaserParticles (vec3_t org, int lightstyle, int count);
void CL_TeleportParticles (vec3_t org, int lightstyle);
void CL_ParseExtraData ( void );
const char *MUSIC_CurrentSong( void );
void CL_SongEnded( const char *songname );
void CL_ShootBullets( centity_t *ent, int num, vec3_t spread, float distance );
void CL_ClipMoveToPlayer ( vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, trace_t *tr, int contents_mask, qboolean fulltrace );
void CL_PrintDefCommands( void );
int  CL_PMpointcontents (vec3_t point);
void CL_DefInfo( void );
void CL_BulletEffect( trace_t trace, float timeofs );
float CL_GetEntityScale( int ent );
int CL_Detect3DNow(void);
void CL_InitTalkSounds( void );
void CL_Talk( const char *talkstring );
qboolean CL_CalculateViewVolume( vec3_t mins, vec3_t maxs );
qboolean CL_ClassifyViewerPosition( int *surfacetype, qboolean *inwater, qboolean *inmutantmode );

//=================================================

void CL_PrepRefresh (void);
void CL_RegisterSounds (qboolean status);

void CL_Quit_f (void);

void IN_Accumulate (void);

void CL_ParseLayout (void);
void CONSOLE_ParseCommandString ( const char *s, int svcop);
void CONSOLE_ProcessInputLine (console3d_t *p);

//
// cl_main
//
extern	refexport_t	re;		// interface to refresh .dll

extern void CL_Init (void);
extern void CL_Disconnect (void);
extern void CL_Disconnect_f (void);
extern void CL_GetChallengePacket (void);
extern void CL_WriteConfiguration (const char *cfgName);
extern void CL_PingServers_f (void);
extern void CL_Snd_Restart_f (void);
extern void CL_RequestNextDownload (void);
extern void CL_WriteConfig_f (void);	/* Knightmare- added writeconfig command */
extern qboolean CL_IsADemoWithTimeDemo(void); /* FS: timedemo only in demos, please */

//
// cl_input
//
typedef struct
{
	int			down[2];		// key nums holding it down
	unsigned	downtime;		// msec timestamp
	unsigned	msec;			// msec down this frame
	int			state;
} kbutton_t;

extern	kbutton_t	in_mlook, in_klook;
extern 	kbutton_t 	in_strafe;
extern 	kbutton_t 	in_speed;

void CL_InitInput (void);
void CL_SendCmd (void);
void CL_SendMove (usercmd_t *cmd);

#ifdef SPLIT_NETWORK_FRAME
void CL_SendCmd_Async (void);
void CL_RefreshCmd (void);
void CL_RefreshMove (void);
#endif

void CL_ClearState (void);

void CL_ReadPackets (void);

int  CL_ReadFromServer (void);
void CL_WriteToServer (usercmd_t *cmd);
void CL_BaseMove (usercmd_t *cmd);

void IN_CenterView (void);

float CL_KeyState (kbutton_t *key);
const char *Key_KeynumToString (int keynum);

//
// cl_demo.c
//
void CL_WriteDemoMessage (void);
void CL_Stop_f (void);
void CL_Record_f (void);

//
// cl_parse.c
//
extern	const char *svc_strings[256];

void CL_ParseServerMessage (void);
void CL_LoadClientinfo (clientinfo_t *ci, const char *s);
void SHOWNET (const char *s);
void CL_ParseClientinfo (int player);
void CL_Download_f (void);
void CL_LoadBikeinfo (bikeinfo_t *ci, const char *s);
void CL_ParseBikeinfo (int player);

//
// cl_view.c
//
extern int gun_frame;
extern struct model_t	*gun_model;

void V_Init (void);
void V_RenderView( float stereo_separation );
void V_AddEntity (entity_t *ent);
void V_AddLight (vec3_t org, float intensity, float r, float g, float b);
void V_AddParticle (vec3_t org, float color[4], byte flags, float size);
void V_AddLightStyle (int style, float r, float g, float b, float a);
void V_AddTriangle ( triangle_t *new_tri );
void V_ResolveOffspring( void );
extern float CalcFov (float fov_x, float width, float height);

//
// cl_tent.c
//
void CL_RegisterTEntSounds (void);
void CL_RegisterTEntModels (void);
void CL_CreateBeam( vec3_t start, vec3_t dir, centity_t *owner, struct model_t *model, float alpha, float scale, int flags, float length, float life, qboolean create, qboolean endpoint, vec3_t end, int min_offset, int max_offset, int overlap );

//
// cl_pred.c
//
void CL_InitPrediction (void);
void CL_PredictMove (void);
void CL_CheckPredictionError (void);

//
// cl_fx.c
//
cdlight_t *CL_AllocDlight (int key);
void CL_RocketTrail (vec3_t start, vec3_t end, centity_t *old);
void CL_DiminishingTrail (vec3_t start, vec3_t end, centity_t *old, int flags);
void CL_AddParticles (void);
#if 0
void CL_EntityEvent (entity_state_t *ent);
#endif
void CL_LensFlareParticles (vec3_t origin);

//
// menus
//
void M_Init (void);
void M_Keydown (int key);
void M_Draw (void);
void M_Menu_Main_f (void);
void M_ForceMenuOff (void);
void M_AddToServerList (netadr_t adr, char *info);

//
// cl_inv.c
//
void CL_ParseInventory (void);
void CL_KeyInventory (int key);
void CL_DrawInventory (void);

//
// cl_pred.c
//
extern void CL_PredictRelease(void);
extern void CL_PredictMovement(void);

//
// cl_gamespy.c
//
void CL_RefreshServerList(void);
void CL_ServerListThink(void);

//
// cmd.c
//
extern void Sort_Possible_Cmds_Cleanup (void);
extern char *Sort_Possible_Cmds (char *partial);

#if (id386) && defined(_MSC_VER)
void x86_TimerStart(void);
void x86_TimerStop(void);
void x86_TimerInit(unsigned long smallest, unsigned longest);
unsigned long *x86_TimerGetHistogram(void);
#endif

extern char *_strtime2(char *str);
extern char *_strdate2(char *str);

#ifdef __cplusplus
}
#endif

#endif
