OpenCores
URL https://opencores.org/ocsvn/usb_fpga_2_04/usb_fpga_2_04/trunk

Subversion Repositories usb_fpga_2_04

[/] [usb_fpga_2_04/] [trunk/] [bmp/] [src/] [bmpsys.pas] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
{*!
2
   bmp -- babel macro processor
3
   Copyright (C) 2009-2014 ZTEX GmbH.
4
   http://www.ztex.de
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License version 3 as
8
   published by the Free Software Foundation.
9
 
10
   This program is distributed in the hope that it will be useful, but
11
   WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
   General Public License for more details.
14
 
15
   You should have received a copy of the GNU General Public License
16
   along with this program; if not, see http://www.gnu.org/licenses/.
17
!*}
18
 
19
{$mode objfpc}
20
unit bmpsys;
21
 
22
interface
23
 
24
const bmp_exit_error      = 1;
25
      bmp_exit_faterror   = 2;
26
      bmp_exit_paramerror = 3;
27
      bmp_exit_usererror  = 100;  { //error[...] }
28
 
29
const bmp_exit    : longint = 0;
30
 
31
procedure bmp_warning(const s:ansistring);
32
procedure bmp_error(const s:ansistring);
33
procedure bmp_faterror(const s:ansistring);
34
function min(i,j:longint):longint;
35
function max(i,j:longint):longint;
36
function int2str(i:longint):shortstring;
37
 
38
implementation
39
 
40
procedure bmp_warning(const s:ansistring);
41
begin
42
writeln(stderr,'Warning: ',s);
43
end;
44
 
45
procedure bmp_error(const s:ansistring);
46
begin
47
writeln(stderr,'Error: ',s);
48
bmp_exit:=1;
49
end;
50
 
51
procedure bmp_faterror(const s:ansistring);
52
begin
53
writeln(stderr,'Fatal error: ',s);
54
halt(2);
55
end;
56
 
57
function min(i,j:longint):longint;
58
begin
59
if i<j then min:=i
60
       else min:=j;
61
end;
62
 
63
function max(i,j:longint):longint;
64
begin
65
if i>j then max:=i
66
       else max:=j;
67
end;
68
 
69
function int2str(i:longint):shortstring;
70
begin
71
str(i,int2str);
72
end;
73
 
74
 
75
end.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.