📄 dlinfo.c
字号:
/* *---------------------------------------------------------------------- * T-Kernel / Standard Extension * * Copyright (C) 2006 by Ken Sakamura. All rights reserved. * T-Kernel / Standard Extension is distributed * under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* * @(#)dlinfo.c (solib) * * Shared object(SO)support library * DLInfo management */#include <string.h>#include "so.h"/* * Generation of the shared object management information */EXPORT DLInfo* __newDLInfo( SOBJ_HDR *soHdr, DLInfo *loader ){ DLInfo *dlp; dlp = calloc(1, sizeof(DLInfo)); if ( dlp == NULL ) { goto err_ret; } /* Initial setting */ dlp->soHdr = *soHdr; dlp->loader = loader; /* Connect to the management queue */ QueInsert(&dlp->q, &__dlInfo.q); /* Standard symbol scope setting */ dlp->scope[0] = &__dlInfo.search; /* Global symbol */ if ( loader != NULL ) { dlp->scope[1] = &loader->search;/* Local symbol */ } else { dlp->scope[1] = &dlp->search; /* Local symbol */ } /* Local symbol scope setting */ dlp->lscope[0] = dlp->scope[1]; return dlp;err_ret: DEBUG_PRINT(("newDLInfo err = %d\n", E_NOMEM)); return NULL;}/* * Deletion of the shared object management information */EXPORT void __freeDLInfo( DLInfo *dlp ){ QueRemove(&dlp->q); if ( dlp->search.ent != NULL ) { free(dlp->search.ent); } free(dlp);}/* * Search of the shared object management information */EXPORT DLInfo* __searchDLInfo( SOBJ_HDR *pohdr ){ QUEUE *q; DLInfo *dlp; for ( q = __dlInfo.q.next; q != &__dlInfo.q; q = q->next ) { dlp = (DLInfo*)q; if ( dlp->count <= 0 ) { continue; } if (strncmp(pohdr->src.path, dlp->soHdr.src.path, L_FPATH) == 0 ) { return dlp; } } return NULL;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -