本文整理汇总了C++中PrintInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ PrintInfo函数的具体用法?C++ PrintInfo怎么用?C++ PrintInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrintInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sprintf
CBool CScene::ReverseExecuteAction(CInt id )
{
if( m_numClips == 0 )
{
CChar temp[MAX_NAME_SIZE];
sprintf( temp, "\n%s%s%s", "scene '", GetName(), "' has no animation" );
PrintInfo( temp, COLOR_RED );
return CFalse;
}
if( id > m_numClips - 1 || id < 0 )
{
CChar temp[MAX_NAME_SIZE];
sprintf( temp, "\n%s%s%s", "Invalid animation ID for scene '", GetName(), "'" );
PrintInfo( temp, COLOR_RED );
return CFalse;
}
if( m_animationClips[id]->GetAnimationStatus() == eANIM_BLEND_CYCLE || m_animationClips[id]->GetAnimationStatus() == eANIM_CLEAR_CYCLE )
return CFalse;
if( m_animationClips[id]->GetAnimationStatus() != eANIM_EXECUTE_ACTION )
return CFalse;
if( m_animationClips[id]->GetReverse() )
return CFalse;
m_animationClips[id]->SetReverse(CTrue);
m_updateAnimationLists = CTrue;
return CTrue;
}
示例2: Arguments
/* Main driver.
Arguments (may be any combination):
-sstring - digests string
-t - runs time trial
-ct - runs time trial in convert number mode
-x - runs test script
-h - print help info
--help - print help info
filename - digests file
(none) - digests standard input
*/
int main (int argc, char *argv[])
{
if (argc > 1) {
if (strcmp(argv[1], "-s") == 0) {
if (argc == 3)
MDString(argv[2]);
else
MDString("");
} else if (strcmp(argv[1], "-t") == 0)
//MDTimeTrial();
MDWordTime();
else if (strcmp(argv[1], "-ct") == 0)
MDWordTimeConvert();
else if (strcmp(argv[1], "-x") == 0)
MDTestSuite();
else if (strcmp(argv[1], "-c") == 0)
MDCrypt("8f14e45fceea167a5a36dedd4bea2543");
else if (strcmp(argv[1], "-h") == 0)
PrintInfo();
else if (strcmp(argv[1], "--help") == 0)
PrintInfo();
else
MDFile(argv[1]);
} else
MDFilter();
return 0;
}
示例3: pattern_fill
static void pattern_fill(unsigned char *buffer, unsigned int pattern,
size_t n)
{
unsigned int i, nb;
unsigned char bpattern[sizeof(pattern)], *ptr;
if (pattern == (unsigned int) ~0) {
PrintInfo(3500, MSG_236);
srand((unsigned int)GetTickCount64());
for (ptr = buffer; ptr < buffer + n; ptr++) {
// coverity[dont_call]
(*ptr) = rand() % (1 << (8 * sizeof(char)));
}
} else {
PrintInfo(3500, MSG_237, pattern);
bpattern[0] = 0;
for (i = 0; i < sizeof(bpattern); i++) {
if (pattern == 0)
break;
bpattern[i] = pattern & 0xFF;
pattern = pattern >> 8;
}
nb = i ? (i-1) : 0;
for (ptr = buffer, i = nb; ptr < buffer + n; ptr++) {
*ptr = bpattern[i];
if (i == 0)
i = nb;
else
i--;
}
cur_pattern++;
}
}
示例4: recv
void SocketClient::ReceiveData()
{
int res = 0;
char* recvBuf = new char[DEFAULT_BUFLEN];
int receiveBufLen = DEFAULT_BUFLEN;
res = recv(ConnectSocket, recvBuf, receiveBufLen, 0);
if (res > 0)
{
PrintInfo("Bytes received: %d", res);
NetworkMessage* msg = new NetworkMessage();
msg->TimeStamp = time(NULL);
msg->Message = recvBuf;
this->data->Push(msg);
}
else if (res == 0)
{
PrintInfo("Connection closed");
}
else
{
PrintInfo("recv failed: %d", WSAGetLastError());
}
}
示例5: listen
void SocketServer::ListenAndAccept()
{
int res = 0;
res = listen(ListenSocket, SOMAXCONN);
if (res == SOCKET_ERROR) {
int err = WSAGetLastError();
PrintInfo("listen failed with error: %d", err);
closesocket(ListenSocket);
//WSACleanup();
return;
}
SOCKET currentClientSocket = INVALID_SOCKET;
currentClientSocket = accept(ListenSocket, NULL, NULL);
if (currentClientSocket == INVALID_SOCKET) {
PrintInfo("accept failed with error: %d", WSAGetLastError());
closesocket(ListenSocket);
//WSACleanup();
return;
}
StartReadingFromSocket(currentClientSocket);
}
示例6: go
void go(void)
{
GFLW_LIBRARY::Initialise();
GFLW_LIBRARY::EnableLZW(GFL_TRUE);
GFLW_FORMAT
format;
GFL_ERROR
ret;
format.FindByName("jpeg");
PrintInfo(format);
format.FindByFilename("toto.tif");
PrintInfo(format);
format.FindByIndex(10);
PrintInfo(format);
ret = GFLW_FORMAT::FindFirst(format);
while ( ret == GFL_NO_ERROR )
{
ret = GFLW_FORMAT::FindNext(format);
PrintInfo(format);
}
GetInfo( DIR"test1" );
TestFile( DIR"test1", DIR"test1.bmp", -1 );
GetInfo( DIR"test1.bmp" );
TestFile( DIR"test2", DIR"test2.bmp", -1 );
GetInfo( DIR"test2.bmp" );
GetInfo( DIR"test3" );
TestFile( DIR"test3", DIR"test3.bmp", GFLW_FORMAT("jpeg").GetIndex() );
GetInfo( DIR"test2.bmp" );
TestFile( DIR"test4", DIR"test.bmp", -1 );
Test2File( DIR"test2", DIR"test4.bmp", GFLW_FORMAT("bmp").GetIndex() );
GetInfo( DIR"test4.bmp" );
Test3File( DIR"test2", DIR"test5.bmp", GFLW_FORMAT("bmp").GetIndex() );
GetInfo( DIR"test5.bmp" );
Test4File( DIR"test2", DIR"test6.jpg", GFLW_FORMAT("jpeg").GetIndex(), 5 );
Test4File( DIR"test2", DIR"test7.jpg", GFLW_FORMAT("jpeg").GetIndex(), 80 );
Test5File( DIR"test2", DIR"test10.gif", GFLW_FORMAT("gif").GetIndex(), GFL_MODE_TO_BINARY, GFL_MODE_FLOYD_STEINBERG );
Test5File( DIR"test2", DIR"test11.gif", GFLW_FORMAT("gif").GetIndex(), GFL_MODE_TO_64GREY, GFL_MODE_PATTERN_DITHER );
Test5File( DIR"test2", DIR"test12.gif", GFLW_FORMAT("gif").GetIndex(), GFL_MODE_TO_64GREY, GFL_MODE_ADAPTIVE );
Test5File( DIR"test2", DIR"test13.gif", GFLW_FORMAT("gif").GetIndex(), GFL_MODE_TO_216COLORS, GFL_MODE_PATTERN_DITHER );
Test5File( DIR"test2", DIR"test14.gif", GFLW_FORMAT("gif").GetIndex(), GFL_MODE_TO_216COLORS, GFL_MODE_ADAPTIVE );
Test5File( DIR"test10.gif", DIR"test15.jpg", GFLW_FORMAT("jpeg").GetIndex(), GFL_MODE_TO_RGB, 0 );
Test6File( DIR"test1", DIR"test16.png" );
Test7File( "jpeg" );
Test8File();
GFLW_LIBRARY::Exit();
}
示例7: StartNetworkComponent
void SocketServer::Init()
{
int res = 0;
res = StartNetworkComponent(&wsaData);// WSAStartup(MAKEWORD(2, 2), &wsaData);
if (res != 0)
{
DWORD err = GetLastError();
PrintInfo("WinSock Startup error %d", res);
return;
}
ZeroMemory(&hints, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = AI_PASSIVE;
res = getaddrinfo(NULL, ServerPort.c_str(), &hints, &result);
if (res != 0) {
PrintInfo("getaddrinfo failed with error: %d", res);
//WSACleanup();
serverValid = false;
return;
}
ListenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
if (ListenSocket == INVALID_SOCKET) {
PrintInfo("socket failed with error: %ld", WSAGetLastError());
freeaddrinfo(result);
//WSACleanup();
serverValid = false;
return;
}
res = bind(ListenSocket, result->ai_addr, (int)result->ai_addrlen);
if (res == SOCKET_ERROR) {
PrintInfo("bind failed with error: %d", WSAGetLastError());
freeaddrinfo(result);
closesocket(ListenSocket);
//WSACleanup();
serverValid = false;
return;
}
freeaddrinfo(result);
}
示例8: energy_init
void energy_init ()
{
/*
* readmemorysizesfromparmfile_ -- fortran function reads first part of parm file, calculates size memory
* readfromparmfile_ -- fortran function reads second part of parm file after allocation of memory
*/
// int num_file = 8;
int len_name = 0;
int lastr = 1;
int lasti = 1;
int lasth = 1;
int lastpr = 1;
int lastrst = 1;
int lastist = 1;
// int atomsMaskLength=0;
char *coordFileName, *refcFileName, sysCommand[500];
len_name = strlen(proteinFileNameNoExt );
PrintInfo(("\n\n Reading memory sizes from file \n"));
// readmemorysizesfromparmfile_(&lastr,&lasti,&lasth,&lastpr,&lastrst,&lastist, proteinFileNameNoExt, &len_name, NULL, &atomsMaskLength);
readmemorysizesfromparmfile_(&lastr,&lasti,&lasth,&lastpr,&lastrst,&lastist, proteinFileNameNoExt, &len_name, &keepLigandFixedDuringMinimization);
//DoPause();
parmet = (PARAMET*) malloc (sizeof(PARAMET));
parmet->px = (double*) malloc( (lastr) * sizeof(double));
parmet->pix = (int*) malloc( (lasti) * sizeof(int));
parmet->pih = (STRING*) malloc( (lasth) * sizeof(STRING));
parmet->pipairs = (int*) malloc( (lastpr) * sizeof(int));
parmet->pr_stack = (double*) malloc( (lastrst) * sizeof(double));
parmet->pi_stack = (int*) malloc( (lastist) * sizeof(int));
//Actually, here, before starting the reading of the parm file
// we have to copy the ".coord" file into the ".refc" file because
// we need the ligand to be kept fixed
coordFileName = (char*)malloc( len_name + 10 );
refcFileName = (char*)malloc( len_name + 10 );
strcpy( coordFileName, proteinFileNameNoExt );
strcat( coordFileName, ".coord" );
strcpy( refcFileName, proteinFileNameNoExt );
strcat( refcFileName, ".refc" );
strcpy( file_coord, coordFileName);
sprintf(sysCommand, "cp %s %s", coordFileName, refcFileName);
PrintInfo(("\n\n Executing: %s \n", sysCommand));
system( sysCommand );
PrintInfo(("\n\n Reading from the parm file \n"));
//rdparm2_(parmet->px,parmet->pix,parmet->pih,parmet->pipairs,parmet->pr_stack,&num_file,parmet->pi_stack);
readfromparmfile_(parmet->px,parmet->pix,parmet->pih,parmet->pipairs,parmet->pr_stack,parmet->pi_stack);
// stef
//PARMpt = &PARM;
}
示例9: StartNetworkComponent
void SocketClient::Init()
{
int res = 0;
res = StartNetworkComponent(&wsaData);
if (res != 0)
{
DWORD err = GetLastError();
PrintInfo("WinSock Startup error %d", res);
return;
}
PrintInfo("WinSock Startup success !");
ZeroMemory(&hints, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
res = getaddrinfo(ServerAddress.c_str(), ServerPort.c_str(), &hints, &result);
if (res != 0)
{
DWORD err = GetLastError();
//WSACleanup();
PrintInfo("WinSock GetAddrInfo error %d", res);
return;
}
PrintInfo("WinSock GetAddrInfo success !");
ptr = result;
ConnectSocket = socket(ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol);
if (ConnectSocket == INVALID_SOCKET)
{
res = WSAGetLastError();
PrintInfo("Error at socket() %ld", res);
freeaddrinfo(result);
//WSACleanup();
return;
}
}
示例10: AnalyzeCommand
void AnalyzeCommand(const udtCuCommandMessage& command, s32 serverTimeMs)
{
if(!command.IsConfigString)
{
return;
}
const s32 clientNumber = command.ConfigStringIndex - _protocolFirstPlayerCsIdx;
if(clientNumber < 0 || clientNumber >= ID_MAX_CLIENTS)
{
// Not a player config string.
return;
}
// Config string update commands always have 3 tokens:
// 1. "cs"
// 2. The index of the config string to update.
// 3. The actual content, in quotes.
if(command.TokenCount != 3)
{
// Not a proper config string command.
return;
}
std::string serverTime;
FormatServerTime(serverTime, serverTimeMs);
const std::string configString = command.CommandTokens[2];
std::string playerName;
Player& player = _players[clientNumber];
if(configString.empty() || !ExtractPlayerName(playerName, configString, _protocol))
{
PrintInfo("%s Player %s left (client %u)", serverTime.c_str(), player.Name.c_str(), (u32)clientNumber);
player.Name = "";
player.Valid = false;
return;
}
const bool wasValid = player.Valid;
player.Valid = true;
if(!wasValid)
{
PrintInfo("%s Player %s joined (client %u)", serverTime.c_str(), playerName.c_str(), (u32)clientNumber);
player.Name = playerName;
}
else if(playerName != player.Name)
{
PrintInfo("%s Player %s renamed to %s (client %u)", serverTime.c_str(), player.Name.c_str(), playerName.c_str(), (u32)clientNumber);
player.Name = playerName;
}
}
示例11: PrintProfileInformation
void PrintProfileInformation(cmsHPROFILE hInput)
{
PrintInfo(hInput, cmsInfoDescription);
PrintInfo(hInput, cmsInfoManufacturer);
PrintInfo(hInput, cmsInfoModel);
PrintInfo(hInput, cmsInfoCopyright);
if (Verbose > 2) {
PrintColorantTable(hInput, cmsSigColorantTableTag, "Input colorant table");
PrintColorantTable(hInput, cmsSigColorantTableOutTag, "Input colorant out table");
}
printf("\n");
}
示例12: DriverEntry
extern "C" NTSTATUS DriverEntry (
IN PDRIVER_OBJECT pDriverObject,
IN PUNICODE_STRING pRegistryPath )
{
NTSTATUS status = STATUS_SUCCESS;
KdPrint(("Enter DriverEntry\n"));
//注册其他驱动调用函数入口
pDriverObject->DriverUnload = HelloDDKUnload;
pDriverObject->MajorFunction[IRP_MJ_CREATE] = HelloDDKDispatchRoutine;
pDriverObject->MajorFunction[IRP_MJ_CLOSE] = HelloDDKDispatchRoutine;
pDriverObject->MajorFunction[IRP_MJ_WRITE] = HelloDDKDispatchRoutine;
pDriverObject->MajorFunction[IRP_MJ_READ] = HelloDDKDispatchRoutine;
//创建驱动设备对象
status = CreateDevice(pDriverObject);
UNICODE_STRING devName;
RtlInitUnicodeString(&devName,L"\\Device\\MyDDKDevice");//浅拷贝
UNICODE_STRING tTestUnicode;
RtlInitUnicodeString(&tTestUnicode,devName.Buffer);
PrintInfo(pDriverObject);
KdPrint(("DriverEntry end\n"));
TestList();
TestLookaside();
return status;
}
示例13: PrintInfo
void
LayerManager::LogSelf(const char* aPrefix)
{
nsCAutoString str;
PrintInfo(str, aPrefix);
MOZ_LAYERS_LOG(("%s", str.get()));
}
示例14: fork
void
Messenger::StartAcquisition()
{
fPID = fork();
std::ostringstream os; int ret;
try {
switch (fPID) {
case -1:
throw Exception(__PRETTY_FUNCTION__, "Failed to fork the current process!", JustWarning);
case 0:
PrintInfo("Launching the daughter acquisition process");
ret = execl("ppsFetch", "", (char*)NULL);
os.str("");
os << "Failed to launch the daughter process!" << "\n\t"
<< "Return value: " << ret << "\n\t"
<< "Errno: " << errno;
throw Exception(__PRETTY_FUNCTION__, os.str(), JustWarning);
default:
break;
}
SendAll(DAQ, SocketMessage(ACQUISITION_STARTED));
// Send the run number to DQMonitors
int last_run = -1;
try { last_run = OnlineDBHandler().GetLastRun(); } catch (Exception& e) { last_run = -1; }
try { SendAll(DQM, SocketMessage(RUN_NUMBER, last_run)); } catch (Exception& e) { e.Dump(); }
throw Exception(__PRETTY_FUNCTION__, "Acquisition started!", Info, 30000);
} catch (Exception& e) { e.Dump(); }
}
示例15: energy_calcul
void energy_calcul (double *px_coo, double *energy, int number_at )
{
// m_coo -- coordinates of atoms after minimization
double *pm_coo = NULL;
pm_coo = (double*) malloc(number_at * 3 * sizeof(double));
// fortrancodeenergyminimisation_ -- fortran function to run energy calculation, minimization calculations or MD.
PrintInfo(("\n\n Starting energy minimization: "));
fortrancodeenergyminimisation_(px_coo, parmet->px,parmet->pix,parmet->pih,parmet->pipairs,parmet->pr_stack, parmet->pi_stack,
energy, pm_coo, &number_at);
PrintInfo(("\n\n Finished minimization: "));
}