一种用 数组元素 指定 所调函数 的方法
typedef struct mgrHandler { void (*handler) (int *, OperationHdr *); } MgrHandler; static MgrHandler mHandlers[] = { {notSupported}, // dummy {classProvider}, // OPS_GetClass 1 {instProvider}, // OPS_GetInstance 2 {classProvider}, // OPS_DeleteClass 3 {instProvider}, // OPS_DeleteInstance 4 {classProvider}, // OPS_CreateClass 5 {instProvider}, // OPS_CreateInstance 6 {classProvider}, // OPS_ModifyClass 7 {instProvider}, // OPS_ModifyInstance 8 {classProvider}, // OPS_EnumerateClasses 9 {classProvider}, // OPS_EnumerateClassNames 10 {instProviderList}, // OPS_EnumerateInstances 11 {instProviderList}, // OPS_EnumerateInstanceNames 12 {instProviderList}, // OPS_ExecQuery 13 {assocProviderList}, // OPS_Associators 14 {assocProviderList}, // OPS_AssociatorNames 15 {assocProviderList}, // OPS_References 16 {assocProviderList}, // OPS_ReferenceNames 17 {propProvider}, // OPS_GetProperty 18 {propProvider}, // OPS_SetProperty 19 {qualiProvider}, // OPS_GetQualifier 20 {qualiProvider}, // OPS_SetQualifier 21 {qualiProvider}, // OPS_DeleteQualifier 22 {qualiProvider}, // OPS_EnumerateQualifiers 23 {methProvider}, // OPS_InvokeMethod 24 static void instProviderList(int *requestor, OperationHdr * req) { _SFCB_ENTER(TRACE_PROVIDERMGR, "instProviderList"); lookupProviderList(INSTANCE_PROVIDER, requestor, req); _SFCB_EXIT(); }