⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classshow.c

📁 vxworks源码源码解读是学习vxworks的最佳途径
💻 C
字号:
/* classShow.c - class object show routines *//* Copyright 1984-1992 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01b,10dec93,smb  changed helpRtn to instRtn01a,04jul92,jcf  created.*//*DESCRIPTIONThis library provides routines to show class related information.INCLUDE FILE: classLib.hSEE ALSO: classLib*/#include "vxWorks.h"#include "string.h"#include "stdio.h"#include "a_out.h"#include "sysSymTbl.h"#include "symLib.h"#include "errno.h"#include "private/funcBindP.h"#include "private/classLibP.h"/* forward declarations */LOCAL void classShowSymbol (int value);/******************************************************************************** classShowInit - initialize class show routine** This routine links the class show routine into the VxWorks system.* These routines are included automatically by defining \%INCLUDE_SHOW_RTNS* in configAll.h.** RETURNS: N/A*/void classShowInit (void)    {    classShowConnect (classClassId, (FUNCPTR)classShow);    }/********************************************************************************* classShow - show the information for the specified class** This routine shows all information associated with the specified class.** RETURNS: OK, or ERROR if invalid class id.** SEE ALSO: symLib, symEach()*/STATUS classShow    (    CLASS_ID	classId, 	/* object class to summarize */    int         level           /* 0 = summary, 1 = details */    )    {    if (OBJ_VERIFY (classId, classClassId) != OK)	return (ERROR);				/* invalid class object */    /* summarize information */    printf ("\n");    printf ("%-20s: 0x%-10x", "Memory Partition Id", classId->objPartId);    classShowSymbol ((int)classId->objPartId);    printf ("%-20s: %-10d\n", "Object Size", classId->objSize);    printf ("%-20s: %-10d\n", "Objects Allocated", classId->objAllocCnt);    printf ("%-20s: %-10d\n", "Objects Deallocated", classId->objFreeCnt);    printf ("%-20s: %-10d\n", "Objects Initialized", classId->objInitCnt);    printf ("%-20s: %-10d\n", "Objects Terminated", classId->objTerminateCnt);    printf ("%-20s: 0x%-10x", "Create Routine", classId->createRtn);    classShowSymbol ((int)classId->createRtn);    printf ("%-20s: 0x%-10x", "Init Routine", classId->initRtn);    classShowSymbol ((int)classId->initRtn);    printf ("%-20s: 0x%-10x", "Destroy Routine", classId->destroyRtn);    classShowSymbol ((int)classId->destroyRtn);    printf ("%-20s: 0x%-10x", "Show Routine", classId->showRtn);    classShowSymbol ((int)classId->showRtn);    printf ("%-20s: 0x%-10x", "Inst Routine", classId->instRtn);    classShowSymbol ((int)classId->instRtn);    return (OK);    }/********************************************************************************* classShowSymbol - print value symbolically if possible*/LOCAL void classShowSymbol    (    int	value		/* value to find in symbol table */    )    {    char     name[MAX_SYS_SYM_LEN + 1];	/* main routine names go here */    SYM_TYPE type;			/* actual symbol type */    int      symValue = -1;		/* actual symbol value */    if (value == 0)	{	printf ("No routine attached.\n");	return;	}    if ((_func_symFindByValueAndType != (FUNCPTR) NULL) && (sysSymTbl != NULL))	(* _func_symFindByValueAndType) (sysSymTbl, value, name, &symValue,					 &type, N_EXT | N_TEXT, N_EXT | N_TEXT);    if (value == symValue)	printf (" (%s)", name);    printf ("\n");    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -