/*
 *
 * Copyright © 1996 Norlinvest Ltd. All rights reserved.
 * EDComX, EDSpice, EDWin, EE Designer, CompCAD, CAD 1000,
 * CAD ABC and Visionics are trade marks of Norlinvest Ltd.
 * Copyright © 1983 - 2002.
 *
 */

#ifndef _LOGIC_PRIM_

#define _LOGIC_PRIM_

#define BADW 0x5555555555555555
#define set_max(var, new) { if(new > var) var = new; }
#define set_min(var, new) { if(new < var) var = new; }

#define ea 0xffff  

WORD _cdecl Andn(WORD n, ...);
WORD _cdecl Orn (WORD n, ...);
WORD _cdecl And (register WORD x, register WORD y);
WORD _cdecl Or  (register WORD x, register WORD y);
WORD _cdecl Xor (register WORD x, register WORD y);
WORD _cdecl Not (register WORD x);

unsigned long  _cdecl LSTAT_TO_NORM(long a, int n);
unsigned long  _cdecl NORM_TO_LSTAT(long a, int n);
unsigned long  _cdecl CONV_LS_N(long a);
unsigned long  _cdecl CONV_N_LS(long a);
unsigned long  _cdecl CHECK_LS(WORD a);
unsigned long  _cdecl CHECK_LS_WORD(WORD a, int n);
unsigned long  _cdecl CHECK_LS_DWORD(long a, int n);

long _cdecl MK_BAD_LS(WORD a);
long _cdecl MK_BAD_LS_WORD(WORD a, int n);

void  _cdecl M_SIMTIME_ERR(void);
void  _cdecl M_BAD_LS(char *s);
void  _cdecl M_PERIOD_SHORT(char *s);
void  _cdecl M_PULSE_SHORT(char *s);
void  _cdecl M_RECVRY_ERR(char *s, char *p);
void  _cdecl M_SETUP_ERR(char *s, char *p);
void  _cdecl M_BADLS_LOAD(char *s);
void  _cdecl M_BADLS_SETUP(char *s, char *p);
void  _cdecl M_HOLD_ERR(char *s, char *p);

int __cdecl sprintf(char *, const char *, ...);

#endif
