jutil.hpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef JUTIL_HPP
  14. #define JUTIL_HPP
  15. #include "jlib.hpp"
  16. #include "jstring.hpp"
  17. #include "jarray.hpp"
  18. #include "jbuff.hpp"
  19. #include <algorithm>
  20. #include <iterator>
  21. #include <functional>
  22. #if defined (__APPLE__)
  23. #include <mach/mach_time.h>
  24. extern mach_timebase_info_data_t timebase_info; // Calibration for nanosecond timer
  25. #endif
  26. //#define NAMEDCOUNTS
  27. interface IPropertyTree;
  28. interface IProperties;
  29. void jlib_decl MilliSleep(unsigned milli);
  30. long jlib_decl atolong_l(const char * s,int l);
  31. int jlib_decl atoi_l(const char * s,int l);
  32. __int64 jlib_decl atoi64_l(const char * s,int l);
  33. inline __int64 atoi64(const char* s) { return atoi64_l(s, (int)strlen(s)); }
  34. #ifndef _WIN32
  35. extern jlib_decl char * itoa(int n, char *str, int b);
  36. extern jlib_decl char * ltoa(long n, char *str, int b);
  37. extern jlib_decl char * ultoa(unsigned long n, char *str, int b);
  38. #define Sleep(milli) MilliSleep(milli)
  39. #endif
  40. bool jlib_decl j_isnan(double x);
  41. bool jlib_decl j_isinf(double x);
  42. void jlib_decl packNumber(char * target, const char * source, unsigned slen);
  43. void jlib_decl unpackNumber(char * target, const char * source, unsigned tlen);
  44. int jlib_decl numtostr(char *dst, char _value);
  45. int jlib_decl numtostr(char *dst, short _value);
  46. int jlib_decl numtostr(char *dst, int _value);
  47. int jlib_decl numtostr(char *dst, long _value);
  48. int jlib_decl numtostr(char *dst, __int64 _value);
  49. int jlib_decl numtostr(char *dst, unsigned char value);
  50. int jlib_decl numtostr(char *dst, unsigned short value);
  51. int jlib_decl numtostr(char *dst, unsigned int value);
  52. int jlib_decl numtostr(char *dst, unsigned long value);
  53. int jlib_decl numtostr(char *dst, unsigned __int64 _value);
  54. // Translate "human readable" size strings like 4G to numbers
  55. extern jlib_decl offset_t friendlyStringToSize(const char *in);
  56. // Write a string as file contents, atomically
  57. extern void jlib_decl atomicWriteFile(const char *fileName, const char *output);
  58. #ifndef _WIN32
  59. /**
  60. * Return full path name of a currently loaded dll that matches the supplied tail
  61. *
  62. * @param ret StringBuffer to receive full path name
  63. * @param match Partial name to be located
  64. * @return True if a matching loaded dll was found
  65. */
  66. extern jlib_decl bool findLoadedModule(StringBuffer &ret, const char *match);
  67. #endif
  68. extern jlib_decl HINSTANCE LoadSharedObject(const char *name, bool isGlobal, bool raiseOnError);
  69. extern jlib_decl void FreeSharedObject(HINSTANCE h);
  70. class jlib_decl SharedObject : public CInterfaceOf<IInterface>
  71. {
  72. public:
  73. SharedObject() { h = 0; bRefCounted = false; }
  74. ~SharedObject() { unload(); }
  75. bool load(const char * dllName, bool isGlobal, bool raiseOnError=false);
  76. bool loadCurrentExecutable();
  77. bool loadResources(const char * dllName);
  78. bool loaded() const { return h != 0; }
  79. void unload();
  80. HINSTANCE getInstanceHandle() const { return h; }
  81. void *getEntry(const char * name) const;
  82. public:
  83. HINSTANCE h;
  84. bool bRefCounted;
  85. };
  86. // Interface for dynamically-loadable plugins
  87. interface IPluggableFactory : extends IInterface
  88. {
  89. virtual bool initializeStore() = 0;
  90. };
  91. typedef IPluggableFactory * (* IPluggableFactoryFactory)(const SharedObject *dll, const IPropertyTree *);
  92. extern jlib_decl IPluggableFactory *loadPlugin(const IPropertyTree* pluginInfo);
  93. //---------------------------------------------------------------------------
  94. //functions for generating unique identifiers consisting of 0..9,A..V
  95. typedef unsigned __int64 unique_id_t;
  96. extern jlib_decl StringBuffer & appendUniqueId(StringBuffer & target, unique_id_t value);
  97. extern jlib_decl unique_id_t getUniqueId();
  98. extern jlib_decl StringBuffer & getUniqueId(StringBuffer & target);
  99. extern jlib_decl void resetUniqueId();
  100. extern jlib_decl unsigned getRandom(); // global
  101. extern jlib_decl void seedRandom(unsigned seed);
  102. interface IRandomNumberGenerator: public IInterface
  103. {
  104. virtual void seed(unsigned seedval)=0;
  105. virtual unsigned next()=0;
  106. };
  107. extern jlib_decl IRandomNumberGenerator *createRandomNumberGenerator();
  108. // functions to populate buffers with randomly generated data
  109. extern jlib_decl void fillRandomData(size32_t writeSz, void *writePtr);
  110. extern jlib_decl void fillRandomData(size32_t writeSz, MemoryBuffer &mb);
  111. #ifdef WIN32
  112. // Reentrant version of the rand() function for use with multithreaded applications.
  113. // rand_r return value between 0 and RAND_R_MAX (exclusive). Not that RAND_MAX is
  114. // implementation dependent: SHORT_MAX on Windows, INT_MAX on Linux.
  115. jlib_decl int rand_r(unsigned int *seed);
  116. #define RAND_R_MAX INT_MAX
  117. #else
  118. #define RAND_R_MAX RAND_MAX
  119. #endif
  120. inline int fastRand()
  121. {
  122. // rand() causes Coverity can issue a 'WEAK_CRYPTO' warning, but we only use fastRand() where deemed safe to do so.
  123. // coverity[DC.WEAK_CRYPTO]
  124. return rand();
  125. }
  126. interface IShuffledIterator: extends IInterface
  127. {
  128. virtual void seed(unsigned seedval)=0; // ony required for repeatability
  129. virtual bool first()=0;
  130. virtual bool isValid() = 0;
  131. virtual bool next() = 0;
  132. virtual unsigned get() = 0;
  133. virtual unsigned lookup(unsigned idx) = 0; // looks up idx'th entry
  134. };
  135. extern jlib_decl IShuffledIterator *createShuffledIterator(unsigned n); // returns iterator that returns 0..n-1 in shuffled order
  136. /* misc */
  137. extern jlib_decl bool isCIdentifier(const char* id);
  138. /* base64 encoder/decoder */
  139. extern jlib_decl void JBASE64_Encode(const void *data, long length, StringBuffer &out, bool addLineBreaks);
  140. extern jlib_decl void JBASE64_Encode(const void *data, long length, IIOStream &out, bool addLineBreaks);
  141. extern jlib_decl StringBuffer &JBASE64_Decode(const char *in, StringBuffer &out);
  142. extern jlib_decl MemoryBuffer &JBASE64_Decode(const char *in, MemoryBuffer &out);
  143. extern jlib_decl StringBuffer &JBASE64_Decode(ISimpleReadStream &in, StringBuffer &out);
  144. extern jlib_decl MemoryBuffer &JBASE64_Decode(ISimpleReadStream &in, MemoryBuffer &out);
  145. /**
  146. * Decode base 64 encoded string.
  147. * It handles forbidden printable and non-printable chars. Space(s) inserted among the valid chars,
  148. * missing pad chars and invalid length.
  149. *
  150. * @param length Length of the input string.
  151. * @param in Pointer to base64 encoded string
  152. * @param out Decoded string if the input is valid
  153. * @return True when success
  154. */
  155. extern jlib_decl bool JBASE64_Decode(size32_t length, const char *in, StringBuffer &out);
  156. extern jlib_decl void JBASE32_Encode(const char *in,StringBuffer &out); // result all lower
  157. extern jlib_decl void JBASE32_Decode(const char *in,StringBuffer &out);
  158. /* URL: http://user:passwd@host:port/path */
  159. extern jlib_decl StringBuffer& encodeUrlUseridPassword(StringBuffer& out, const char* in);
  160. extern jlib_decl StringBuffer& decodeUrlUseridPassword(StringBuffer& out, const char* in);
  161. //--------------------------------------------------------------------------------------------------------------------
  162. class StringPointerArrayMapper : public SimpleArrayMapper<const char *>
  163. {
  164. typedef const char * MEMBER;
  165. public:
  166. static void construct(const char * & member, const char * newValue)
  167. {
  168. member = newValue ? strdup(newValue) : nullptr;
  169. }
  170. static void destruct(MEMBER & member)
  171. {
  172. free(const_cast<char *>(member));
  173. }
  174. static inline bool matches(MEMBER const & member, const char * param)
  175. {
  176. return strcmp(member, param) == 0;
  177. }
  178. };
  179. class jlib_decl StringArray : public ArrayOf<const char *, const char *, StringPointerArrayMapper>
  180. {
  181. struct CCmp
  182. {
  183. static int compare(char const * const *l, char const * const *r) { return strcmp(*l, *r); }
  184. static int compareNC(char const * const *l, char const * const *r) { return stricmp(*l, *r); }
  185. static int revCompare(char const * const *l, char const * const *r) { return strcmp(*r, *l); }
  186. static int revCompareNC(char const * const *l, char const * const *r) { return stricmp(*r, *l); }
  187. };
  188. typedef ArrayOf<const char *, const char *, StringPointerArrayMapper> PARENT;
  189. public:
  190. // Appends a list in a string delimited by 'delim'
  191. void appendList(const char *list, const char *delim, bool trimSpaces = true);
  192. // Appends a list in a string delimited by 'delim' without duplicates
  193. void appendListUniq(const char *list, const char *delim, bool trimSpaces = true);
  194. StringBuffer &getString(StringBuffer &ret, const char *delim); // get CSV string of array contents
  195. void sortAscii(bool nocase=false);
  196. void sortAsciiReverse(bool nocase=false);
  197. void sortCompare(int (*compare)(const char * const * l, const char * const * r));
  198. private:
  199. using PARENT::sort; // prevent access to this function - to avoid ambiguity
  200. };
  201. class CIStringArray : public StringArray, public CInterface
  202. {
  203. };
  204. interface IScmIterator : extends IInterface
  205. {
  206. virtual bool first() = 0;
  207. virtual bool next() = 0;
  208. virtual bool isValid() = 0;
  209. };
  210. interface IStringIterator : extends IScmIterator
  211. {
  212. virtual IStringVal & str(IStringVal & str) = 0;
  213. };
  214. class jlib_decl CStringArrayIterator : implements CInterfaceOf<IStringIterator>
  215. {
  216. unsigned idx = 0;
  217. StringArray strings;
  218. public:
  219. void append(const char *str) { strings.append(str); }
  220. void append_unique(const char *str) { strings.appendUniq(str); }
  221. virtual bool first() { idx = 0; return strings.isItem(idx); }
  222. virtual bool next() { idx ++; return strings.isItem(idx); }
  223. virtual bool isValid() { return strings.isItem(idx); }
  224. virtual IStringVal & str(IStringVal &s) { s.set(strings.item(idx)); return s; }
  225. };
  226. class jlib_decl CEmptyStringIterator : implements CInterfaceOf<IStringIterator>
  227. {
  228. public:
  229. virtual bool first() { return false; }
  230. virtual bool next() { return false; }
  231. virtual bool isValid() { return false; }
  232. virtual IStringVal & str(IStringVal &s) { s.clear(); return s; }
  233. };
  234. extern jlib_decl unsigned msTick();
  235. extern jlib_decl unsigned usTick();
  236. extern jlib_decl int write_pidfile(const char * instance);
  237. extern jlib_decl void doStackProbe();
  238. extern jlib_decl bool isContainerized();
  239. #ifndef arraysize
  240. #define arraysize(T) (sizeof(T)/sizeof(*T))
  241. #endif
  242. extern jlib_decl unsigned runExternalCommand(StringBuffer &output, StringBuffer &error, const char *cmd, const char *input);
  243. extern jlib_decl unsigned runExternalCommand(const char *title, StringBuffer &output, StringBuffer &error, const char *cmd, const char *input);
  244. extern jlib_decl unsigned __int64 greatestCommonDivisor(unsigned __int64 left, unsigned __int64 right);
  245. inline unsigned hex2num(char next)
  246. {
  247. if ((next >= '0') && (next <= '9'))
  248. return next - '0';
  249. if ((next >= 'a') && (next <= 'f'))
  250. return next - 'a' + 10;
  251. if ((next >= 'A') && (next <= 'F'))
  252. return next - 'A' + 10;
  253. return 0;
  254. }
  255. extern jlib_decl void initThreadLocal(int len, void* val);
  256. extern jlib_decl void* getThreadLocalVal();
  257. extern jlib_decl void clearThreadLocal();
  258. extern jlib_decl bool matchesMask(const char *fn, const char *mask, unsigned p, unsigned n);
  259. extern jlib_decl StringBuffer &expandMask(StringBuffer &buf, const char *mask, unsigned p, unsigned n);
  260. extern jlib_decl bool constructMask(StringAttr &attr, const char *fn, unsigned p, unsigned n);
  261. extern jlib_decl bool deduceMask(const char *fn, bool expandN, StringAttr &mask, unsigned &p, unsigned &n); // p is 0 based in these routines
  262. class HashKeyElement;
  263. class jlib_decl NamedCount
  264. {
  265. HashKeyElement *ht;
  266. public:
  267. NamedCount();
  268. ~NamedCount();
  269. void set(const char *name);
  270. };
  271. #ifdef NAMEDCOUNTS
  272. #define DECL_NAMEDCOUNT NamedCount namedCount
  273. #define INIT_NAMEDCOUNT namedCount.set(typeid(*this).name())
  274. #else
  275. #define DECL_NAMEDCOUNT
  276. #define INIT_NAMEDCOUNT {}
  277. #endif
  278. extern jlib_decl StringBuffer &dumpNamedCounts(StringBuffer &str);
  279. interface IAuthenticatedUser: extends IInterface
  280. {
  281. virtual bool login(const char *user, const char *passwd) = 0;
  282. virtual void impersonate()=0;
  283. virtual void revert()=0;
  284. virtual const char *username()=0;
  285. };
  286. interface IAtom;
  287. extern jlib_decl IAuthenticatedUser *createAuthenticatedUser();
  288. extern jlib_decl void serializeAtom(MemoryBuffer & target, IAtom * name);
  289. extern jlib_decl IAtom * deserializeAtom(MemoryBuffer & source);
  290. template <class KEY, class VALUE, class COMPARE>
  291. VALUE * binsearch(KEY key, VALUE * * values, unsigned num, COMPARE * cmp)
  292. {
  293. unsigned l = 0;
  294. unsigned u = num;
  295. while(l<u)
  296. {
  297. unsigned i = l+(u-l)/2;
  298. int c = cmp->compare(key, values[i]);
  299. if(c == 0)
  300. {
  301. return values[i];
  302. }
  303. else if(c < 0)
  304. {
  305. u = i;
  306. }
  307. else
  308. {
  309. l = i+1;
  310. }
  311. }
  312. return NULL;
  313. }
  314. extern jlib_decl StringBuffer &genUUID(StringBuffer &in, bool nocase=false);
  315. // Convert offset_t to string
  316. // Note that offset_t can be 32, 64 bit integers or a structure
  317. class jlib_decl OffsetToString
  318. {
  319. StringBuffer m_buffer;
  320. public:
  321. OffsetToString(offset_t offset);
  322. const char* str() { return m_buffer.str(); }
  323. };
  324. extern jlib_decl StringBuffer & passwordInput(const char* prompt, StringBuffer& passwd);
  325. /**
  326. * Return a reference to a shared IProperties object representing the environment.conf settings.
  327. * The object is loaded when first needed, and freed at program termination. This function is threadsafe.
  328. *
  329. * @return The environment.conf properties
  330. *
  331. */
  332. extern jlib_decl const IProperties &queryEnvironmentConf();
  333. /**
  334. * Return an owned copy of the local environment.xml file
  335. *
  336. * @return The environment.xml property tree
  337. *
  338. */
  339. extern jlib_decl IPropertyTree *getHPCCEnvironment();
  340. extern jlib_decl bool getConfigurationDirectory(const IPropertyTree *dirtree, // NULL to use HPCC config
  341. const char *category,
  342. const char *component,
  343. const char *instance,
  344. StringBuffer &dirout);
  345. extern jlib_decl bool querySecuritySettings(DAFSConnectCfg *_connectMethod,
  346. unsigned short *_port,
  347. const char * * _certificate,
  348. const char * * _privateKey,
  349. const char * * _passPhrase);
  350. extern jlib_decl bool queryDafsSecSettings(DAFSConnectCfg *_connectMethod,
  351. unsigned short *_port,
  352. unsigned short *_sslport,
  353. const char * * _certificate,
  354. const char * * _privateKey,
  355. const char * * _passPhrase);
  356. //Queries environment.conf file
  357. extern jlib_decl bool queryHPCCPKIKeyFiles(const char * * _certificate,//HPCCCertificateFile
  358. const char * * _publicKey, //HPCCPublicKeyFile
  359. const char * * _privateKey, //HPCCPrivateKeyFile
  360. const char * * _passPhrase);//HPCCPassPhrase, encrypted
  361. extern jlib_decl const char * matchConfigurationDirectoryEntry(const char *path,const char *mask,StringBuffer &name, StringBuffer &component, StringBuffer &instance);
  362. extern jlib_decl bool replaceConfigurationDirectoryEntry(const char *path,const char *frommask,const char *tomask,StringBuffer &out);
  363. extern jlib_decl const char *queryCurrentProcessPath();
  364. extern jlib_decl StringBuffer &getFileAccessUrl(StringBuffer &out);
  365. /**
  366. * Locate the 'package home' directory - normally /opt/HPCCSystems - by detecting the current executable's location
  367. *
  368. * @param path Returns the package home location
  369. * @return True if the home directory was located
  370. */
  371. extern jlib_decl bool getPackageFolder(StringBuffer & path);
  372. extern jlib_decl int parseCommandLine(const char * cmdline, MemoryBuffer &mb, const char** &argvout); // parses cmdline into argvout returning arg count (mb used as buffer)
  373. extern jlib_decl bool safe_ecvt(size_t len, char * buffer, double value, int numDigits, int * decimal, int * sign);
  374. extern jlib_decl bool safe_fcvt(size_t len, char * buffer, double value, int numPlaces, int * decimal, int * sign);
  375. extern jlib_decl StringBuffer &getTempFilePath(StringBuffer & target, const char * component, IPropertyTree * pTree);
  376. interface jlib_thrown_decl ICorruptDllException: extends IException
  377. {
  378. };
  379. struct EnumMapping { int val; const char *str; };
  380. extern jlib_decl const char *getEnumText(int value, const EnumMapping *map); // fails if no match
  381. extern jlib_decl int getEnum(const char *v, const EnumMapping *map); //fails if no match
  382. extern jlib_decl const char *getEnumText(int value, const EnumMapping *map, const char * defval);
  383. extern jlib_decl int getEnum(const char *v, const EnumMapping *map, int defval);
  384. class jlib_decl QuantilePositionIterator
  385. {
  386. public:
  387. QuantilePositionIterator(size_t _numRows, unsigned _numDivisions, bool roundUp)
  388. : numRows(_numRows), numDivisions(_numDivisions)
  389. {
  390. assertex(numDivisions);
  391. step = numRows / numDivisions;
  392. stepDelta = (unsigned)(numRows % numDivisions);
  393. initialDelta = roundUp ? (numDivisions)/2 : (numDivisions-1)/2;
  394. first();
  395. }
  396. bool first()
  397. {
  398. curRow = 0;
  399. curDelta = initialDelta;
  400. curQuantile = 0;
  401. return true;
  402. }
  403. bool next()
  404. {
  405. if (curQuantile >= numDivisions)
  406. return false;
  407. curQuantile++;
  408. curRow += step;
  409. curDelta += stepDelta;
  410. if (curDelta >= numDivisions)
  411. {
  412. curRow++;
  413. curDelta -= numDivisions;
  414. }
  415. assertex(curRow <= numRows);
  416. return true;
  417. }
  418. size_t get() { return curRow; }
  419. protected:
  420. size_t numRows;
  421. size_t curRow;
  422. size_t step;
  423. unsigned numDivisions;
  424. unsigned stepDelta;
  425. unsigned curQuantile;
  426. unsigned curDelta;
  427. unsigned initialDelta;
  428. };
  429. class jlib_decl QuantileFilterIterator
  430. {
  431. public:
  432. QuantileFilterIterator(size_t _numRows, unsigned _numDivisions, bool roundUp)
  433. : numRows(_numRows), numDivisions(_numDivisions)
  434. {
  435. assertex(numDivisions);
  436. initialDelta = roundUp ? (numDivisions-1)/2 : (numDivisions)/2;
  437. first();
  438. }
  439. bool first()
  440. {
  441. curRow = 0;
  442. curDelta = initialDelta;
  443. curQuantile = 0;
  444. isQuantile = true;
  445. return true;
  446. }
  447. bool next()
  448. {
  449. if (curRow > numRows)
  450. return false;
  451. curRow++;
  452. curDelta += numDivisions;
  453. isQuantile = false;
  454. if (curDelta >= numRows)
  455. {
  456. curDelta -= numRows;
  457. isQuantile = true;
  458. }
  459. return true;
  460. }
  461. size_t get() { return isQuantile; }
  462. protected:
  463. size_t numRows;
  464. size_t curRow;
  465. size_t step;
  466. size_t curDelta;
  467. unsigned numDivisions;
  468. unsigned curQuantile;
  469. unsigned initialDelta;
  470. bool isQuantile;
  471. };
  472. template <typename Container, typename Value>
  473. inline bool stdContains(Container&& container, Value &&v)
  474. {
  475. return container.end() != std::find(container.begin(), container.end(), std::forward<Value>(v));
  476. }
  477. class jlib_decl COnScopeExit
  478. {
  479. const std::function<void()> exitFunc;
  480. public:
  481. inline COnScopeExit(const std::function<void()> &_exitFunc) : exitFunc(_exitFunc) { }
  482. inline ~COnScopeExit()
  483. {
  484. exitFunc();
  485. }
  486. };
  487. struct HPCCBuildInfo
  488. {
  489. const char *buildTag;
  490. const char *dirName;
  491. const char *prefix;
  492. const char *execPrefix;
  493. const char *configPrefix;
  494. const char *installDir;
  495. const char *libDir;
  496. const char *execDir;
  497. const char *componentDir;
  498. const char *configDir;
  499. const char *configSourceDir;
  500. const char *adminDir;
  501. const char *pluginsDir;
  502. const char *runtimeDir;
  503. const char *lockDir;
  504. const char *pidDir;
  505. const char *logDir;
  506. const char *envXmlFile;
  507. const char *envConfFile;
  508. unsigned buildVersionMajor;
  509. unsigned buildVersionMinor;
  510. unsigned buildVersionPoint;
  511. const char *buildVersion;
  512. };
  513. extern jlib_decl HPCCBuildInfo hpccBuildInfo;
  514. #endif