/* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * $Source: /home/cvs/cvsroot/onelan/onelan/src/mplib1/libsrc/bpo_res_2.c,v $ * $Author: mpoole $ * $Date: 2002/10/07 09:37:37 $ * $Revision: 1.2 $ * ******************************************************************************* * * Change History * * $Log: bpo_res_2.c,v $ * Revision 1.2 2002/10/07 09:37:37 mpoole * Initial checkin of mplib1-3.1.0 * * Revision 1.1 2002/10/07 09:36:54 mpoole * Initial checkin of mplib1-3.1.0 * * ******************************************************************************* */ #ident "$Header: /home/cvs/cvsroot/onelan/onelan/src/mplib1/libsrc/bpo_res_2.c,v 1.2 2002/10/07 09:37:37 mpoole Exp $" /* ------------------------------------------------------------------ Include files ------------------------------------------------------------------ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../include/bpo_init_internal.h" #include "../include/bpo_alloc_private.h" #include #include /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ structures ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ static variables ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ Code starts here ------------------------------------------------------------------ */ void * Fetch_SODB_Resource( const void *hint, const char *name, size_t s_size, Fetch_SODB_Resource_t s_init ) { void *rv,*nrv; off_t noff, *ofp; rv = Find_SODB_Resource( hint, name ); if (rv==NULL) { ofp = shalloc( hint, s_size + sizeof(off_t) ); if (ofp) { *ofp = 0; nrv = (void *)(ofp+1); if (s_init) (* s_init)( nrv ); noff = Add_SODB_Resource( nrv, name ); if (noff== (off_t)0) { shfree(ofp); nrv=NULL; } rv = Find_SODB_Resource( hint, name ); } } return(rv); } /* -- End of File -- */