new beta-0.90.0
[luatex.git] / source / texk / web2c / luatexdir / lang / hnjalloc.w
blob91fefec9e5d32830a4e1ee34ff5b4a09d065f20f
1 % hnjalloc.w
3 % LibHnj is dual licensed under LGPL and MPL. Boilerplate for both
4 % licenses follows.
7 % LibHnj - a library for high quality hyphenation and justification
8 % Copyright (C) 1998 Raph Levien, (C) 2001 ALTLinux, Moscow
10 % This library is free software; you can redistribute it and/or
11 % modify it under the terms of the GNU Library General Public
12 % License as published by the Free Software Foundation; either
13 % version 2 of the License, or (at your option) any later version.
15 % This library is distributed in the hope that it will be useful,
16 % but WITHOUT ANY WARRANTY; without even the implied warranty of
17 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 % Library General Public License for more details.
20 % You should have received a copy of the GNU Library General Public
21 % License along with this library; if not, write to the
22 % Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 % Boston, MA 02111-1307 USA.
27 % The contents of this file are subject to the Mozilla Public License
28 % Version 1.0 (the "MPL"); you may not use this file except in
29 % compliance with the MPL. You may obtain a copy of the MPL at
30 % http://www.mozilla.org/MPL/
32 % Software distributed under the MPL is distributed on an "AS IS" basis,
33 % WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL
34 % for the specific language governing rights and limitations under the
35 % MPL.
37 @ wrappers for malloc
40 #include <stdlib.h>
41 #include <stdio.h>
42 #include "lang/hnjalloc.h"
44 void *hnj_malloc(int size)
46 void *p;
48 p = malloc((size_t) size);
49 if (p == NULL) {
50 fprintf(stderr, "can't allocate %d bytes\n", size);
51 exit(1);
53 return p;
56 void *hnj_realloc(void *p, int size)
58 p = realloc(p, (size_t) size);
59 if (p == NULL) {
60 fprintf(stderr, "can't allocate %d bytes\n", size);
61 exit(1);
63 return p;
66 void hnj_free(void *p)
68 free(p);