/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* standalone mini ast+sfio interface
*/
#ifndef _AST_H
#include <ast_sa.h>
#include <ast_common.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
typedef int (*Error_f)(void*, void*, int, ...);
typedef struct
{
char* id;
struct
{
unsigned int serial;
unsigned int set;
} locale;
long tmp_long;
short tmp_short;
char tmp_char;
int (*collate)(const char*, const char*);
int tmp_int;
void* tmp_pointer;
int mb_cur_max;
unsigned int env_serial;
} _Ast_info_t;
#define elementsof(x) (sizeof(x)/sizeof(x[0]))
#define integralof(x) (((char*)(x))-((char*)0))
#define newof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)calloc(1,sizeof(t)*(n)+(x)))
#define oldof(p,t,n,x) ((p)?(t*)realloc((char*)(p),sizeof(t)*(n)+(x)):(t*)malloc(sizeof(t)*(n)+(x)))
#define pointerof(x) ((void*)((char*)0+(x)))
#ifndef offsetof
#endif
#define NiL 0
#define NoP(x) (void)(x)
#else
#define NiL ((char*)0)
#endif
#define mbchar(s) (*s++)
#define setlocale(a,b)
#define sfset(f,v,n)
#include <sfstr.h>
extern _Ast_info_t ast;
extern int astwinsize(int, int*, int*);
extern int chresc(const char*, char**);
extern char* strcopy(char*, const char*);
extern int strmatch(const char*, const char*);
#endif