-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmiscprocs.h
92 lines (84 loc) · 2.68 KB
/
miscprocs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
** This file is part of the Matrix Brandy Basic VI Interpreter.
** Copyright (C) 2000-2014 David Daniels
** Copyright (C) 2018-2024 Michael McConnell and contributors
**
** Brandy is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2, or (at your option)
** any later version.
**
** Brandy is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Brandy; see the file COPYING. If not, write to
** the Free Software Foundation, 59 Temple Place - Suite 330,
** Boston, MA 02111-1307, USA.
**
**
** Miscellaneous functions
*/
#ifndef __miscprocs_h
#define __miscprocs_h
#include <stdio.h>
#ifdef USE_SDL
#include <SDL.h>
#endif
#include "common.h"
#include "basicdefs.h"
#ifdef TARGET_RISCOS
extern int64 llabs(int64);
#endif
extern boolean read_line(char [], int32);
extern boolean amend_line(char [], int32);
//extern boolean isidstart(char);
//extern boolean isidchar(char);
//extern boolean isident(byte);
extern int32 get_integer(size_t);
extern int64 get_int64(size_t);
extern float64 get_float(size_t);
extern void store_integer(size_t, int32);
extern void store_int64(size_t, int64);
extern void store_float(size_t, float64);
#ifdef USE_SDL
extern size_t m7offset(size_t);
#else
#define m7offset(p) (p)
#endif
extern char *skip_blanks(char *);
extern byte *skip(byte *);
extern char *tocstring(char *, int32);
extern byte *find_line(int32);
extern byte *find_linestart(byte *);
extern library *find_library(byte *);
extern void show_byte(size_t, size_t);
extern void show_word(size_t, size_t);
extern void save_current(void);
extern void restore_current(void);
extern FILE *secure_tmpnam(char []);
extern int32 TOINT(float64);
extern int32 INT64TO32(int64);
extern int64 TOINT64(float64);
extern size_t TONATIVEADDR(float64);
extern void set_fpu(void);
extern void decimaltocomma(char *, int32);
extern int32 sgni(int64);
extern int32 sgnf(float64);
extern void string_zeroterm(char *);
extern char *translatefname(char *);
extern int32 get_listo(void);
extern void set_listoption(int32);
#ifndef BRANDY_HAS_STRL_FUNCTIONS
extern char *my_strlcpy(char *dest, const char *src, size_t n);
#endif
#ifdef USE_SDL
extern Uint8 mode7frame[26][40];
#endif
#define ISIDSTART(ch) (isalpha(ch) || ch=='_' || ch=='`')
#define ISIDCHAR(ch) (isalnum(ch) || ch=='_' || ch=='`')
#define MAX(a,b) ((a > b) ? a : b)
#define MIN(a,b) ((a < b) ? a : b)
#endif