~ubuntu-branches/ubuntu/raring/ncbi-tools6/raring

« back to all changes in this revision

Viewing changes to connect/ncbi_util.h

  • Committer: Package Import Robot
  • Author(s): Aaron M. Ucko
  • Date: 2011-09-05 18:55:02 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: package-import@ubuntu.com-20110905185502-iuvmoe65ytljhckn
Tags: 6.1.20110713-1
* New upstream release.
* debian/*.symbols: update accordingly.
* make/makeshlb.unx: link libcn3dOGL.so against -lm for sqrt.
* doc/man/*.1: update for new release.
* debian/rules:
  - (VIB): add asnmacro, as upstream takes care to publish binaries thereof.
  - Retire obsolete multiarch-unaware checks for libpthread.
  - Fully modernize Debhelper usage; in particular, transition to overrides.
* debian/compat: advance to 9 per rules modernization.
* debian/ncbi-tools-bin.install: add asnmacro.
* make/makenet.unx: link asnmacro only against libraries it directly needs.
* doc/man/asnmacro.1: give asnmacro a man page.
* doc/man/Psequin.1: list it in SEE ALSO.
* network/id1arch/idfetch.c: revert redundant change (from #295110).
* Convert to multiarch.
  - debian/rules: Install libraries (and ncbithr.o) to multiarch directories.
  - debian/lib*.install: match multiarch library paths.
  - debian/control:
    + Build-Depends: debhelper (>= 8.1.3~), implying a recent dpkg-dev.
    + Set Multi-Arch: as appropriate across the board, and specify
      Pre-Depends: ${misc:Pre-Depends} for runtime libraries.
* debian/*.lintian-overrides: drop leading slashes for Lintian 2.5.x.
* debian/control: Standards-Version: 3.9.2 (already compliant).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef CONNECT___NCBI_UTIL__H
2
2
#define CONNECT___NCBI_UTIL__H
3
3
 
4
 
/* $Id: ncbi_util.h,v 6.39 2010/02/04 15:17:12 kazimird Exp $
 
4
/* $Id: ncbi_util.h,v 6.44 2011/02/17 18:09:33 kazimird Exp $
5
5
 * ===========================================================================
6
6
 *
7
7
 *                            PUBLIC DOMAIN NOTICE
174
174
 
175
175
 
176
176
/** Same as CORE_SetLOGFILE_Ex() with last parameter passed as 0
177
 
 * (all messages pass).
 
177
 * (all messages get posted).
178
178
 * @sa
179
179
 *   CORE_SetLOGFILE_Ex, CORE_SetLOG
180
180
 */
216
216
 */
217
217
typedef enum {
218
218
    fLOG_Default       = 0x0,    /**< fLOG_Short if NDEBUG, else fLOG_Full   */
219
 
 
220
219
    fLOG_Level         = 0x1,
221
220
    fLOG_Module        = 0x2,
222
 
    fLOG_FileLine      = 0x4,    /**< always here for eLOG_Trace level       */
 
221
    fLOG_FileLine      = 0x4,
223
222
    fLOG_DateTime      = 0x8,
224
223
    fLOG_FullOctal     = 0x2000, /**< do not do reduction in octal data bytes*/
225
224
    fLOG_OmitNoteLevel = 0x4000, /**< do not add NOTE if eLOG_Note is level  */
385
384
extern NCBI_XCONNECT_EXPORT const char* CORE_GetPlatform(void);
386
385
 
387
386
 
 
387
/** Obtain current application name (toolkit dependent).
 
388
 * @return
 
389
 *  Return 0 when the application name cannot be determined;
 
390
 *  otherwise, return a NULL-terminated string
 
391
 *
 
392
 * NOTE that setting an application name concurrently with this
 
393
 * call can cause undefined behavior or a stale pointer returned.
 
394
 */
 
395
extern NCBI_XCONNECT_EXPORT const char* CORE_GetAppName(void);
 
396
 
 
397
 
388
398
/** Obtain and store current user's name in the buffer provided.
389
399
 * Note that resultant strlen(buf) is always guaranteed to be less
390
400
 * than "bufsize", extra non-fit characters discarded.
490
500
 *  Hostname to shorten (if possible)
491
501
 * @return 0 if the hostname wasn't modified, otherwise return "hostname".
492
502
 */
493
 
extern char* UTIL_NcbiLocalHostName
 
503
extern NCBI_XCONNECT_EXPORT char* UTIL_NcbiLocalHostName
494
504
(char* hostname
495
505
 );
496
506
 
505
515
 * @return the buffer size needed (0 for NULL or empty (size==0) block).
506
516
 * @sa UTIL_PrintableString
507
517
 */
508
 
extern size_t UTIL_PrintableStringSize
 
518
extern NCBI_XCONNECT_EXPORT size_t UTIL_PrintableStringSize
509
519
(const char* data,
510
520
 size_t      size
511
521
 );
532
542
 * @return next position in the buffer past the last stored character.
533
543
 * @sa UTIL_PrintableStringSize
534
544
 */
535
 
extern char* UTIL_PrintableString
 
545
extern NCBI_XCONNECT_EXPORT char* UTIL_PrintableString
536
546
(const char* data,
537
547
 size_t      size,
538
548
 char*       buf,
540
550
 );
541
551
 
542
552
 
 
553
/**
 
554
 *  Conversion from Unicode to UTF8, and back.
 
555
 *  Microsoft Windows - specific.
 
556
 *  NOTE:
 
557
 *    The caller should use UTIL_ReleaseBufferOnHeap function
 
558
 *    to free the buffer returned from UTIL_TcharToUtf8OnHeap;
 
559
 *    and ReleaseBuffer to free the one returned from UTIL_TcharToUtf8
 
560
 */
 
561
 
 
562
#if defined(NCBI_OS_MSWIN)  &&  defined(_UNICODE)
 
563
extern const char*    UTIL_TcharToUtf8OnHeap(const wchar_t* buffer);
 
564
extern const char*    UTIL_TcharToUtf8      (const wchar_t* buffer);
 
565
extern const wchar_t* UTIL_Utf8ToTchar      (const    char* buffer);
 
566
#  define             UTIL_ReleaseBuffer(x)  UTIL_ReleaseBufferOnHeap(x)
 
567
#else
 
568
#  define             UTIL_TcharToUtf8OnHeap(x)  (x)
 
569
#  define             UTIL_TcharToUtf8(x)        (x)
 
570
#  define             UTIL_Utf8ToTchar(x)        (x)
 
571
#  define             UTIL_ReleaseBuffer(x)      /*void*/
 
572
#endif /*NCBI_OS_MSWIN && _UNICODE*/
 
573
 
 
574
#ifdef NCBI_OS_MSWIN
 
575
extern void           UTIL_ReleaseBufferOnHeap(const void* buffer);
 
576
#else
 
577
#  define             UTIL_ReleaseBufferOnHeap(x)  /*void*/
 
578
#endif /*NCBI_OS_MSWIN*/
 
579
 
 
580
 
543
581
#ifdef __cplusplus
544
582
}  /* extern "C" */
545
583
#endif