]> pd.if.org Git - pdclib/blob - platform/gandr/functions/_PDCLIB/_PDCLIB_allocpages.c
PDCLib includes with quotes, not <>.
[pdclib] / platform / gandr / functions / _PDCLIB / _PDCLIB_allocpages.c
1 /* _PDCLIB_allocpages( int const )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdint.h>
8 #include <stddef.h>
9 #include "_PDCLIB_glue.h"
10 #include <errno.h>
11 #include <gd_bal.h>
12
13 void * _PDCLIB_allocpages( size_t n )
14 {
15     void *p = NULL;
16     int rv = gd_alloc_pages( gd_loader_data, &p, n );
17
18     if (rv) {
19         errno = rv;
20         return NULL;
21     } else {
22         return p;
23     }
24 }
25
26 #ifdef TEST
27 #include "_PDCLIB_test.h"
28
29 int main( void )
30 {
31     return TEST_RESULTS;
32 }
33
34 #endif