~a-j-delaney/libamore/cunit-dev

« back to all changes in this revision

Viewing changes to src/libAMoRE/ext.h

  • Committer: buraq
  • Date: 2004-04-16 17:04:28 UTC
  • Revision ID: vcs-imports@canonical.com-20040416170428-ko6l3kyx1c5jyrll
initial

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* @name    ext.h
 
2
 *  this file has to be included from sourcefiles to access global variables
 
3
 *    declared in 'vars.h'. The decision to equally include all useful 
 
4
 *    header files potentially useful here is a pragmatic decision, though 
 
5
 *    questionable.
 
6
 *  Copyright (c) ?    - 2000 Lehrstuhl fuer Informatik VII, RWTH Aachen
 
7
 *  Copyright (c) 2000 - 2002 Burak Emir
 
8
 *  This file is part of the libAMoRE library.
 
9
 *
 
10
 *  libAMoRE is  free software; you can redistribute it and/or
 
11
 *  modify it under the terms of the GNU Lesser General Public
 
12
 *  License as published by the Free Software Foundation; either
 
13
 *  version 2.1 of the License, or (at your option) any later version.
 
14
 *  You should have received a copy of the GNU Lesser General Public
 
15
 *  License along with the GNU C Library; if not, write to the Free
 
16
 *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
17
 *  02111-1307 USA. 
 
18
 */
 
19
 
 
20
#ifndef _EXT_H_
 
21
#define _EXT_H_
 
22
 
 
23
#include <setjmp.h>
 
24
#include <stdio.h>
 
25
#include <ctype.h> 
 
26
#include <string.h>
 
27
 
 
28
#ifdef UNIX     
 
29
#ifndef LIBAMORE
 
30
#include <curses.h> 
 
31
#endif
 
32
#include <sys/param.h>
 
33
#endif        
 
34
 
 
35
#ifdef DOS
 
36
#include <malloc.h>
 
37
#include <conio.h>
 
38
#include <stdlib.h>
 
39
#endif
 
40
 
 
41
 
 
42
#include "cons.h"
 
43
#include "typedefs.h"
 
44
 
 
45
#ifdef UNIX
 
46
#include "unix.h"
 
47
#endif
 
48
 
 
49
#ifndef AMORE
 
50
 
 
51
extern char itoc[28];
 
52
 
 
53
extern char dummy[PILEN];
 
54
 
 
55
/* these were used in the curses version */
 
56
/* extern int plines; */
 
57
/* extern int pcols; */
 
58
/* extern char *lpdest;*/
 
59
 
 
60
 
 
61
extern FILE *amrp;
 
62
/* extern char line[LINELEN1]; MOVED TO READAMR */
 
63
extern char *text[];
 
64
 
 
65
#endif
 
66
 
 
67
 
 
68
/* memory management with the buffer */
 
69
 
 
70
/** <b>(array)newbuf((posint)(A),(posint)sizeof(posint))
 
71
 *  @memo allocates new {@link array array} of posint via newbuf
 
72
 */
 
73
#define newarray(A)             (array)newbuf((posint)(A),(posint)sizeof(posint))
 
74
/** <b>(mrkfin)newbuf((posint)(A),(posint)sizeof(boolx))
 
75
 *  @memo allocates new {@link mrkfin mrkfin} via newbuf
 
76
 */
 
77
#define newfin(A)               (mrkfin)newbuf((posint)(A),(posint)sizeof(boolx))
 
78
/** <b>(b_array)newbuf((posint)(A),(posint)sizeof(boole))
 
79
 *  @memo allocates new {@link b_array b_array} via newbuf
 
80
 */
 
81
#define newb_array(A)           (b_array)newbuf((posint)(A),(posint)sizeof(boole))
 
82
/** <b>(arrayofarray)newbuf((posint)(A),(posint)sizeof(array))
 
83
 *  @memo allocates new {@link arrayofarray arrayofarray} via newbuf
 
84
 */
 
85
#define newarrayofarray(A)      (arrayofarray)newbuf((posint)(A),(posint)sizeof(array))
 
86
/** <b>(arrayofb_array)newbuf((posint)(A),(posint)sizeof(b_array))
 
87
 *  @memo allocates new {@link arrayofb_array arrayofb_array} via newbuf
 
88
 */
 
89
#define newarrayofb_array(A)    (arrayofb_array)newbuf((posint)(A),(posint)sizeof(b_array))
 
90
/** <b>(string)newbuf((posint)(A),(posint)sizeof(char))
 
91
 *  @memo allocates new {@link string string} via newbuf
 
92
 */
 
93
#define newstring(A)            (string)newbuf((posint)(A),(posint)sizeof(char))
 
94
/** <b>(arrayofstring)newbuf((posint)(A),(posint)sizeof(string))
 
95
 *  @memo allocates {@link new arrayofstring arrayofstring} via newbuf
 
96
 */
 
97
#define newarrayofstring(A)     (arrayofstring)newbuf((posint)(A),(posint)sizeof(string))
 
98
 
 
99
/** FIXME (ext.h */
 
100
#define newdlist() (d_list)newbuf((posint)1,(posint)sizeof(struct dlist))
 
101
 
 
102
 
 
103
#ifdef DOS
 
104
#define  cbreak()               /* Lu-Go 29.11.91 */
 
105
#define  crmode()
 
106
#define  echo()                 /* Lu-Go 29.11.91 */
 
107
#define  endwin()
 
108
#define  gtyx(A,B,C)  getyx(&B,&C)
 
109
#define  initscr()  clear()
 
110
#define  nocbreak()             /* Lu-Go 29.11.91 */
 
111
#define  nocrmode()
 
112
#define  noecho()
 
113
#define  nonl()
 
114
#define  refresh()
 
115
#define  sleep(A)
 
116
#endif
 
117
 
 
118
#ifdef UNIX
 
119
#define gtyx(A,B,C)  getyx(A,B,C)
 
120
#endif
 
121
 
 
122
#endif