#ifndef _TEXT_H_
#define _TEXT_H_


typedef unsigned long ulong;
typedef enum {
	_textErrorNoError, _textErrorNoMemory, _textErrorInternal, 
	_textErrorArguments, _textErrorSystem = 100
} _textErrorType;


#import <sys/stat.h>
#import <sys/param.h>

#import "text/fileutil.h"
#import "text/pathutil.h"
#import "text/search.h"
#import "text/spell.h"
#import "text/strutil.h"
#import "text/webster.h"
#import "text/wftable.h"
#import "text/ix.h"



#define countArray(a)	(sizeof(a) / sizeof((a)[0]))


extern int _textErrors;
extern _textErrorType _textErrorNo;


/* functions for error reporting */
extern void textError(const char *fmt, ...);
extern int _textError(_textErrorType errNo, const char *fmt, ...);


/* functions for generating arrays of strings */
extern FreeStringArray(char **a);
extern char **ArrayFromString(char *s);
extern char **ArrayFromFile(char *file);


/* pipe and file management functions */
extern isapipe(int fd);
extern FILE *sopen(char *name, char *mode);
extern iwait(int fd, unsigned long timeout);


#endif
