~ubuntu-branches/ubuntu/warty/ncbi-tools6/warty

« back to all changes in this revision

Viewing changes to connect/ncbi_priv.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2002-04-04 22:13:09 UTC
  • Revision ID: james.westby@ubuntu.com-20020404221309-vfze028rfnlrldct
Tags: upstream-6.1.20011220a
ImportĀ upstreamĀ versionĀ 6.1.20011220a

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  $Id: ncbi_priv.c,v 6.1 2000/03/24 22:53:35 vakatov Exp $
 
2
 * ===========================================================================
 
3
 *
 
4
 *                            PUBLIC DOMAIN NOTICE
 
5
 *               National Center for Biotechnology Information
 
6
 *
 
7
 *  This software/database is a "United States Government Work" under the
 
8
 *  terms of the United States Copyright Act.  It was written as part of
 
9
 *  the author's official duties as a United States Government employee and
 
10
 *  thus cannot be copyrighted.  This software/database is freely available
 
11
 *  to the public for use. The National Library of Medicine and the U.S.
 
12
 *  Government have not placed any restriction on its use or reproduction.
 
13
 *
 
14
 *  Although all reasonable efforts have been taken to ensure the accuracy
 
15
 *  and reliability of the software and data, the NLM and the U.S.
 
16
 *  Government do not and cannot warrant the performance or results that
 
17
 *  may be obtained by using this software or data. The NLM and the U.S.
 
18
 *  Government disclaim all warranties, express or implied, including
 
19
 *  warranties of performance, merchantability or fitness for any particular
 
20
 *  purpose.
 
21
 *
 
22
 *  Please cite the author in any work or product based on this material.
 
23
 *
 
24
 * ===========================================================================
 
25
 *
 
26
 * Author:  Denis Vakatov
 
27
 *
 
28
 * File Description:
 
29
 *    Private aux. code for the "ncbi_*.[ch]"
 
30
 *
 
31
 * ---------------------------------------------------------------------------
 
32
 * $Log: ncbi_priv.c,v $
 
33
 * Revision 6.1  2000/03/24 22:53:35  vakatov
 
34
 * Initial revision
 
35
 *
 
36
 * ===========================================================================
 
37
 */
 
38
 
 
39
#include "ncbi_priv.h"
 
40
 
 
41
#include <stdio.h>
 
42
#include <stdarg.h>
 
43
#include <string.h>
 
44
 
 
45
 
 
46
MT_LOCK g_CORE_MT_Lock;
 
47
LOG     g_CORE_Log;
 
48
REG     g_CORE_Registry;
 
49
 
 
50
 
 
51
extern const char* g_CORE_Sprintf(const char* fmt, ...)
 
52
{
 
53
  va_list args;
 
54
  static char str[4096];
 
55
 
 
56
  va_start(args, fmt);
 
57
  *str = '\0';
 
58
  vsprintf(str, fmt, args);
 
59
  assert(strlen(str) < sizeof(str));
 
60
  va_end(args);
 
61
  return str;
 
62
}
 
63
 
 
64
 
 
65
extern char* g_CORE_RegistryGET
 
66
(const char* section,
 
67
 const char* name,
 
68
 char*       value,
 
69
 size_t      value_size,
 
70
 const char* def_value)
 
71
{
 
72
    char* ret_value;
 
73
    CORE_LOCK_READ;
 
74
    ret_value = REG_Get(g_CORE_Registry,
 
75
                        section, name, value, value_size, def_value);
 
76
    CORE_UNLOCK;
 
77
    return ret_value;
 
78
}