3 (Linux Access Control List Management)
5 Copyright (C) 1999-2002
6 Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 /* object creation, destruction, conversion and validation */
34 __new_var_obj_p(int magic, size_t size)
36 obj_prefix *obj_p = (obj_prefix *)malloc(size);
38 obj_p->p_magic = (long)magic;
39 obj_p->p_flags = OBJ_MALLOC_FLAG;
46 __new_obj_p_here(int magic, void *here)
48 obj_prefix *obj_p = here;
49 obj_p->p_magic = (long)magic;
55 __free_obj_p(obj_prefix *obj_p)
58 if (obj_p->p_flags & OBJ_MALLOC_FLAG)
64 __check_obj_p(obj_prefix *obj_p, int magic)
66 if (!obj_p || obj_p->p_magic != (long)magic) {
76 __ext2int_and_check(void *ext_p, int magic, const char *typename)
79 __ext2int_and_check(void *ext_p, int magic)
82 obj_prefix *obj_p = ((obj_prefix *)ext_p)-1;
85 fprintf(stderr, "invalid %s object at %p\n",
91 return __check_obj_p(obj_p, magic);