1*da2e3ebdSchin /*********************************************************************** 2*da2e3ebdSchin * * 3*da2e3ebdSchin * This software is part of the ast package * 4*da2e3ebdSchin * Copyright (c) 1992-2007 AT&T Knowledge Ventures * 5*da2e3ebdSchin * and is licensed under the * 6*da2e3ebdSchin * Common Public License, Version 1.0 * 7*da2e3ebdSchin * by AT&T Knowledge Ventures * 8*da2e3ebdSchin * * 9*da2e3ebdSchin * A copy of the License is available at * 10*da2e3ebdSchin * http://www.opensource.org/licenses/cpl1.0.txt * 11*da2e3ebdSchin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 12*da2e3ebdSchin * * 13*da2e3ebdSchin * Information and Software Systems Research * 14*da2e3ebdSchin * AT&T Research * 15*da2e3ebdSchin * Florham Park NJ * 16*da2e3ebdSchin * * 17*da2e3ebdSchin * Glenn Fowler <gsf@research.att.com> * 18*da2e3ebdSchin * David Korn <dgk@research.att.com> * 19*da2e3ebdSchin * * 20*da2e3ebdSchin ***********************************************************************/ 21*da2e3ebdSchin #pragma prototyped 22*da2e3ebdSchin /* 23*da2e3ebdSchin * David Korn 24*da2e3ebdSchin * AT&T Bell Laboratories 25*da2e3ebdSchin * 26*da2e3ebdSchin * header for wc library interface 27*da2e3ebdSchin */ 28*da2e3ebdSchin 29*da2e3ebdSchin #ifndef _WC_H 30*da2e3ebdSchin #define _WC_H 31*da2e3ebdSchin 32*da2e3ebdSchin #include <ast.h> 33*da2e3ebdSchin 34*da2e3ebdSchin #define WC_LINES 0x01 35*da2e3ebdSchin #define WC_WORDS 0x02 36*da2e3ebdSchin #define WC_CHARS 0x04 37*da2e3ebdSchin #define WC_MBYTE 0x08 38*da2e3ebdSchin #define WC_LONGEST 0x10 39*da2e3ebdSchin #define WC_QUIET 0x20 40*da2e3ebdSchin 41*da2e3ebdSchin typedef struct 42*da2e3ebdSchin { 43*da2e3ebdSchin signed char space[1<<CHAR_BIT]; 44*da2e3ebdSchin Sfoff_t words; 45*da2e3ebdSchin Sfoff_t lines; 46*da2e3ebdSchin Sfoff_t chars; 47*da2e3ebdSchin Sfoff_t longest; 48*da2e3ebdSchin int mode; 49*da2e3ebdSchin } Wc_t; 50*da2e3ebdSchin 51*da2e3ebdSchin #define wc_count _cmd_wccount 52*da2e3ebdSchin #define wc_init _cmd_wcinit 53*da2e3ebdSchin 54*da2e3ebdSchin extern Wc_t* wc_init(int); 55*da2e3ebdSchin extern int wc_count(Wc_t*, Sfio_t*, const char*); 56*da2e3ebdSchin 57*da2e3ebdSchin #endif /* _WC_H */ 58