#ifndef UTILS_1
#define UTILS_1



#include "constant.h"
#include "aprsString.h"
#include "cpqueue.h"
#include <vector>


#define BADUSER -1
#define BADGROUP -2
#define BADPASSWD -3



int WriteLog(const char *cp, const char *LogFile);
char* strupr(char *cp);
void printhex(const char *cp, int n);
BOOL CmpDest(const char *line, const char *ref);
BOOL CmpPath(const char *line, const char *ref);
BOOL callsign(char *s, const char *call);
BOOL CompareSourceCalls(char *s1, char *s2);
void GetMaxAgeAndCount( int *MaxAge, int *MaxCount);
int  checkpass(const char *szUser, const char *szGroup, const char *szPass);
void RemoveCtlCodes(char *cp);
char* StripPath(char* cp);
BOOL getMsgDestCall(char *data, char* cp, int n);
BOOL getMsgSourceCall(char* data, char* cp, int n);
char checkUserDeny(string& user);

int stricmp(const char* szX, const char* szY);
void removeHTML(string& sp);


int split(  string& s, string sa[],   int saSize,  const char* delim);
int freq(string& s, char c);
void upcase(string& s);
void reformatAndSendMicE(aprsString* inetpacket, cpQueue& sendQueue);
BOOL find_rfcall(const string& s, string* rfcall[]);
BOOL find_rfcall(const string& s, vector<string*>& rfcall);

void strElapsedTime(time_t starttime,  char* timeStr);

unsigned int string_hash(const string& s);
void crc_byte(const char data, unsigned int *crc16);
void makeAlias(string& s);




#endif


