~ubuntu-branches/ubuntu/lucid/9base/lucid

« back to all changes in this revision

Viewing changes to lib9/fmt/fmtnull.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-08-20 17:34:06 UTC
  • mfrom: (6.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090820173406-xpwqa9ruyevvc0ut
Tags: 1:3-3
* Updating maintainer field.
* Updating vcs fields.
* Updating package to standards version 3.8.3.
* Updatin variables writing in rules to consistent style.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2004 Google Inc.; see LICENSE */
 
2
#include <stdarg.h>
 
3
#include <string.h>
 
4
#include "plan9.h"
 
5
#include "fmt.h"
 
6
#include "fmtdef.h"
 
7
 
 
8
/*
 
9
 * Absorb output without using resources.
 
10
 */
 
11
static Rune nullbuf[32];
 
12
 
 
13
static int
 
14
__fmtnullflush(Fmt *f)
 
15
{
 
16
        f->to = nullbuf;
 
17
        f->nfmt = 0;
 
18
        return 0;
 
19
}
 
20
 
 
21
int
 
22
fmtnullinit(Fmt *f)
 
23
{
 
24
        memset(f, 0, sizeof *f);
 
25
        f->runes = 1;
 
26
        f->start = nullbuf;
 
27
        f->to = nullbuf;
 
28
        f->stop = nullbuf+nelem(nullbuf);
 
29
        f->flush = __fmtnullflush;
 
30
        fmtlocaleinit(f, nil, nil, nil);
 
31
        return 0;
 
32
}
 
33