X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=Common%2Frt%20api%2FPublic.h;fp=Common%2Frt%20api%2FPublic.h;h=6708d3ad70815b33745fc2b6e31657b7f3e9f918;hb=0fb676244827a448dc60118d6558c4a4e346ffee;hp=b3103f7d3dda3cedba6f0f9037081448af467967;hpb=59bc65eea1e9a2cab6b1d51f4567cffc033fe938;p=freerainbowtables diff --git a/Common/rt api/Public.h b/Common/rt api/Public.h index b3103f7..6708d3a 100644 --- a/Common/rt api/Public.h +++ b/Common/rt api/Public.h @@ -10,8 +10,7 @@ * * freerainbowtables is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. + * the Free Software Foundation, either version 2 of the License. * * freerainbowtables is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -52,8 +51,8 @@ struct RainbowChainCP struct IndexChain { uint64 nPrefix; - UINT4 nFirstChain; - UINT4 nChainCount; + uint32 nFirstChain; + uint32 nChainCount; }; struct FoundRainbowChain { @@ -85,7 +84,32 @@ typedef struct #define MAX_HASH_LEN 256 #define MAX_SALT_LEN 256 -unsigned int GetFileLen(FILE* file); +// XXX nmap is GPL2, will check newer releases regarding license +// Code comes from nmap, used for the linux implementation of kbhit() +#ifndef _WIN32 +#include +#include +#include + +int tty_getchar(); +void tty_done(); +void tty_init(); +void tty_flush(void); +// end nmap code + +#endif + +#if defined(_WIN32) && !defined(__GNUC__) + int gettimeofday( struct timeval *tv, struct timezone *tz ); +#endif + +#if !defined(_WIN32) || defined(__GNUC__) + #include +#endif + +timeval sub_timeofday( timeval tv2, timeval tv ); + +long GetFileLen(FILE* file); string TrimString(string s); bool boinc_ReadLinesFromFile(string sPathName, vector& vLine); bool ReadLinesFromFile(string sPathName, vector& vLine); @@ -93,10 +117,11 @@ bool SeperateString(string s, string sSeperator, vector& vPart); string uint64tostr(uint64 n); string uint64tohexstr(uint64 n); string HexToStr(const unsigned char* pData, int nLen); -unsigned int GetAvailPhysMemorySize(); +unsigned long GetAvailPhysMemorySize(); string GetApplicationPath(); void ParseHash(string sHash, unsigned char* pHash, int& nHashLen); bool GetHybridCharsets(string sCharset, vector& vCharset); void Logo(); +bool writeResultLineToFile(string sOutputFile, string sHash, string sPlain, string sBinary); #endif