来源:cppblog
extern "C" {
#include "system.h"
}
注解:
int GCT_send(unsigned int task_id, HDR *h);
......
int GCT_send();
#endif
~
in file MapBaseReq.cpp 文件中
{
#include "sysgct.h"
}
MapBaseReq::sendPdu(const BasePdu_var& thePduP)
{
{
relm((HDR *)m);
SETERR1(errSWErrorMsg, "sendPdu(): GCT_send() Failed");
}
...
#include <iostream>
#include <iomanip>
#include "TTDebug.h"
using namespace std;
extern "C"
{
#include "Utility.h"
}
static int display_hex_buffer(unsigned char* buffer, unsigned char* ptr,int len);
extern "C" void tDebug_traceFunc(int level, char* trace)
{
TDEBUG_TRACEFUNC(level,trace);
}
extern "C" void nDebug(int level, unsigned char* args, int iLen, int cid)
{
unsigned char buf[512];
if(0 != TTDebug::instance() && TTDebug::instance()->isTTDebugOn(level))
{
/* Check whether the current thread already holds the mutex lock */
LockGuard<MutexWrapper> guard(TTDebug::instance()->mutex());
TTDebug::instance()->traceStart(level, __FILE__, __LINE__);
memset(buf,0,512);
display_hex_buffer(buf,args,iLen);
TTDebug::instance()->outStream() << "Send Msg(0-0x" << setw(4) << setfill('0') << hex << cid <<"):0x" << buf;
TTDebug::instance()->traceEnd();
}
}
#ifndef __UTILITY_H
#define __UTILITY_H
extern void tDebug_traceFunc(int level, char* trace);
extern void nDebug(int level, unsigned char* args,int iLen, int cid);
...
int ctu_ent(msg,pInt)
MSG* msg;
int *pInt;
{
tDebug_traceFunc(10,"ctu ctu_ent");
HDR *h;
MSG *m;
...
}
...