ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static void proclog ( FILE inf,
FILE outf,
int  maxpending,
int  opts 
) [static]

Definition at line 171 of file adnslogres.c.

Referenced by main().

                                                                     {
  int eof, err, len;
  adns_state adns;
  adns_answer *answer;
  logline *head, *tail, *line;
  adns_initflags initflags;

  initflags= (opts & OPT_DEBUG) ? adns_if_debug : 0;
  if (config_text) {
    errno= adns_init_strcfg(&adns, initflags, stderr, config_text);
  } else {
    errno= adns_init(&adns, initflags, 0);
  }
  if (errno) aargh("adns_init");
  head= tail= readline(inf, adns, opts);
  len= 1; eof= 0;
  while (head) {
    while (head) {
      if (opts & OPT_DEBUG)
    msg("%d in queue; checking %.*s", len,
        head->rest-head->addr, guard_null(head->addr));
      if (eof || len >= maxpending) {
#ifdef HAVE_POLL
    if (opts & OPT_POLL)
      err= adns_wait_poll(adns, &head->query, &answer, NULL);
    else
#endif
      err= adns_wait(adns, &head->query, &answer, NULL);
      } else {
    err= adns_check(adns, &head->query, &answer, NULL);
      }
      if ((err == EAGAIN) || (EWOULDBLOCK == err)) break;
      if (err) {
    fprintf(stderr, "%s: adns_wait/check: %s", progname, strerror(err));
    exit(1);
      }
      printline(outf, head->start, head->addr, head->rest,
        answer->status == adns_s_ok ? *answer->rrs.str : NULL);
      line= head; head= head->next;
      free(line);
      free(answer);
      len--;
    }
    if (!eof) {
      line= readline(inf, adns, opts);
      if (line) {
        if (!head) head= line;
        else tail->next= line;
        tail= line; len++;
      } else {
    eof= 1;
      }
    }
  }
  adns_finish(adns);
}

Generated on Sun May 27 2012 05:58:49 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.