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

« back to all changes in this revision

Viewing changes to connect/ncbi_local.c

  • 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
 
/*  $Id: ncbi_local.c,v 1.15 2008/05/25 01:25:38 kazimird Exp $
 
1
/* $Id: ncbi_local.c,v 1.16 2011/04/01 16:19:31 kazimird Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
87
87
{
88
88
    struct SLOCAL_Data* data = (struct SLOCAL_Data*) iter->data;
89
89
    const TSERV_Type type = iter->type & ~fSERV_Firewall;
 
90
    char key[sizeof(REG_CONN_LOCAL_SERVER) + 10];
90
91
    int/*bool*/ ok = 0/*failed*/;
91
92
    SSERV_Info* info;
92
 
    char* buf;
93
93
    int n;
94
94
 
95
 
    if (!(buf =
96
 
          (char*) malloc(strlen(name) + sizeof(REG_CONN_LOCAL_SERVER) + 80))) {
97
 
        return 0/*failed*/;
98
 
    }
99
 
 
100
95
    info = 0;
 
96
    strcpy(key, REG_CONN_LOCAL_SERVER "_");
101
97
    for (n = 0;  n <= 100;  n++) {
102
 
        char service[1024];
103
 
        const char* c;
 
98
        const char* svc;
 
99
        char buf[1024];
104
100
 
105
101
        if (info) {
106
102
            free((void*) info);
107
103
            info = 0;
108
104
        }
109
 
        sprintf(buf, "%s_" REG_CONN_LOCAL_SERVER "_%d", name, n);
110
 
        if (!(c = getenv(buf))  &&  !(c = getenv(strupr(buf)))) {
111
 
            char*  b = buf + strlen(name);
112
 
            size_t len;
113
 
            *b++ = '\0';
114
 
            CORE_REG_GET(buf, b, service, sizeof(service) - 1, 0);
115
 
            len = strlen(service);
116
 
            if (len > 1  &&  (service[0] == '"'  ||  service[0] == '\'')
117
 
                &&  service[len - 1] == service[0]  &&  (len -= 2) > 0) {
118
 
                memmove(service, service + 1, len);
119
 
                service[len] = '\0';
120
 
            }
121
 
            if (!len)
122
 
                continue;
123
 
            c = service;
124
 
        }
 
105
        sprintf(key + sizeof(REG_CONN_LOCAL_SERVER), "%d", n);
 
106
        if (!(svc = ConnNetInfo_GetValue(name, key, buf, sizeof(buf), 0)))
 
107
            continue;
125
108
        if (!(info = SERV_ReadInfoEx
126
 
              (c, iter->ismask  ||  iter->reverse_dns ? name : ""))) {
 
109
              (svc, iter->ismask  ||  iter->reverse_dns ? name : ""))) {
127
110
            continue;
128
111
        }
129
112
        if (iter->external  &&  info->locl)
157
140
    if (info)
158
141
        free((void*) info);
159
142
 
160
 
    free(buf);
161
143
    return ok/*whatever*/;
162
144
}
163
145