本文整理汇总了C++中NOTE函数的典型用法代码示例。如果您正苦于以下问题:C++ NOTE函数的具体用法?C++ NOTE怎么用?C++ NOTE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NOTE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ERROR
void RTMFPServer::start(RTMFPServerParams& params) {
if(running()) {
ERROR("RTMFPServer server is yet running, call stop method before");
return;
}
_port = params.port;
if(_port==0) {
ERROR("RTMFPServer port must have a positive value");
return;
}
if(params.pCirrus) {
_pCirrus = new Target(*params.pCirrus);
NOTE("RTMFPServer started in man-in-the-middle mode with server %s (unstable debug mode)",_pCirrus->address.toString().c_str());
}
_middle = params.middle;
if(_middle)
NOTE("RTMFPServer started in man-in-the-middle mode between peers (unstable debug mode)");
_pSocket = new DatagramSocket();
(UInt32&)udpBufferSize = params.udpBufferSize==0 ? _pSocket->getReceiveBufferSize() : params.udpBufferSize;
_pSocket->setReceiveBufferSize(udpBufferSize);
_pSocket->setSendBufferSize(udpBufferSize);
DEBUG("Socket buffer receving/sending size = %u/%u",udpBufferSize,udpBufferSize);
(UInt32&)keepAliveServer = params.keepAliveServer<5 ? 5000 : params.keepAliveServer*1000;
(UInt32&)keepAlivePeer = params.keepAlivePeer<5 ? 5000 : params.keepAlivePeer*1000;
Startable::start();
setPriority(params.threadPriority);
}
开发者ID:mokerjoke,项目名称:Cumulus,代码行数:30,代码来源:RTMFPServer.cpp
示例2: sigchld_handler
/**@internal
* @brief Handles SIGCHLD signals to avoid zombie processes
*
* When a child process exits, it causes a SIGCHLD to be sent to the
* parent process. This handler catches it and reaps the child process so it
* can exit. Otherwise we'd get zombie processes.
*/
void
sigchld_handler(int s)
{
int status;
pid_t rc;
//NOTE("SIGCHLD handler: Trying to reap a child");
rc = waitpid(-1, &status, WNOHANG | WUNTRACED);
if(rc == -1) {
if(errno == ECHILD) {
NOTE("SIGCHLD handler: waitpid(): No child exists now.");
} else {
ERROR("SIGCHLD handler: Error reaping child (waitpid() returned -1): %s", strerror(errno));
}
return;
}
if(WIFEXITED(status)) {
//DEBUG("SIGCHLD handler: Process PID %d exited normally, status %d", (int)rc, WEXITSTATUS(status));
return;
}
if(WIFSIGNALED(status)) {
NOTE("SIGCHLD handler: Process PID %d exited due to signal %d", (int)rc, WTERMSIG(status));
return;
}
NOTE("SIGCHLD handler: Process PID %d changed state, status %d not exited, ignoring", (int)rc, status);
return;
}
开发者ID:wind0419,项目名称:wind_code,代码行数:39,代码来源:main2.c
示例3: switch
void Daemon::processDisconnected( Channel dead ) {
switch ( _state ) {
case State::Leaving:
break;
case State::Supervising:
NOTE();
if ( _rope == dead )
Logger::log( "working child died" );
else
Logger::log( "internal error happened - other connection than rope to the child has died" );
setDefault();
break;
case State::Free:
case State::Enslaved:
case State::FormingGroup:
NOTE();
Logger::log( "closed connection to " + info( dead ) + " which is weird" );
setDefault();
break;
case State::Running:
case State::Grouped:
NOTE();
Logger::log( "closed connection to " + info( dead ) );
::exit( 0 );
}
}
开发者ID:spito,项目名称:dp,代码行数:26,代码来源:daemon.cpp
示例4: dump_src_AttrType
static void dump_src_AttrType(FILE *output, const char *name, AttrList data, const char **from)
{
int n;
fprintf(output, "static const attr %s_attr_list[] = {\n", name);
if (data != 0) {
for (n = 0; data[n].name != 0; ++n) {
dump_AttrItem(output, data + n);
}
}
fprintf(output, "\t{ 0 T(N) } /* Terminate list */\n");
fprintf(output, "};\n");
NOTE("");
fprintf(output, "static const AttrType %s_attr_type[] = {\n", name);
if (from != 0) {
while (*from != 0) {
fprintf(output, "\t{ ATTR_TYPE(%s) },\n", *from);
++from;
}
} else {
fprintf(output, "\t{ ATTR_TYPE(%s) },\n", name);
}
fprintf(output, "\t{ 0, 0 },\n");
fprintf(output, "};\n");
NOTE("");
}
开发者ID:Distrotech,项目名称:lynx,代码行数:26,代码来源:dtd_util.c
示例5: dnssd_client_cb
static void
dnssd_client_cb(AvahiClient *c, /* I - Client */
AvahiClientState state, /* I - Current state */
void *userdata) /* I - User data (unused) */
{
(void)userdata;
int error; /* Error code, if any */
if (!c)
return;
switch (state) {
default :
NOTE("Ignore Avahi state %d.", state);
break;
case AVAHI_CLIENT_CONNECTING:
NOTE("Waiting for Avahi server.");
break;
case AVAHI_CLIENT_S_RUNNING:
NOTE("Avahi server connection got available, registering printer.");
dnssd_register(c);
break;
case AVAHI_CLIENT_S_REGISTERING:
case AVAHI_CLIENT_S_COLLISION:
NOTE("Dropping printer registration because of possible host name change.");
if (g_options.dnssd_data->ipp_ref)
avahi_entry_group_reset(g_options.dnssd_data->ipp_ref);
break;
case AVAHI_CLIENT_FAILURE:
if (avahi_client_errno(c) == AVAHI_ERR_DISCONNECTED) {
NOTE("Avahi server disappeared, unregistering printer");
dnssd_unregister();
/* Renewing client */
if (g_options.dnssd_data->DNSSDClient)
avahi_client_free(g_options.dnssd_data->DNSSDClient);
if ((g_options.dnssd_data->DNSSDClient =
avahi_client_new(avahi_threaded_poll_get
(g_options.dnssd_data->DNSSDMaster),
AVAHI_CLIENT_NO_FAIL,
dnssd_client_cb, NULL, &error)) == NULL) {
ERR("Error: Unable to initialize DNS-SD client.");
g_options.terminate = 1;
}
} else {
ERR("Avahi server connection failure: %s",
avahi_strerror(avahi_client_errno(c)));
g_options.terminate = 1;
}
break;
}
}
开发者ID:tillkamppeter,项目名称:ippusbxd,代码行数:56,代码来源:dnssd.c
示例6: NOTE
HRESULT CLoadDirectDraw::IsDirectDrawLoaded()
{
NOTE("Entering IsDirectDrawLoaded");
if (m_pDirectDraw == NULL) {
NOTE("DirectDraw not loaded");
return S_FALSE;
}
return NOERROR;
}
开发者ID:kenygia,项目名称:xy-vsfilter,代码行数:10,代码来源:videoctl.cpp
示例7: switch
// advance one cycle
void proc_t::advance_one_cycle() {
int data;
int A = 100 % test_args.addr_range;
int B = 200 % test_args.addr_range;
switch (args.test) {
case 0:
// first Command
// store at cycle 1
if(!command1[0]){
addr = random() % 32 + 16 * proc;
NOTE("proc store A");
response = cache->store(addr, 0, 50, false);
if(response.retry_p == false){
command1[0] = true;
NOTE("proc first store finish");
}
}
// second Command
// load to same address
// should hit
else if(command1[0] && !command1[1]){
NOTE("proc load A");
response = cache->load(addr, 0, &data, false);
if(response.retry_p == false){
command1[1] = true;
NOTE("proc load finish");
if(data != 50){
ERROR("fail this case");
}else{
NOTE_ARGS(("%d: get correct value", proc));
NOTE("pass this case");
}
}
}
break;
default:
ERROR("don't know this test case");
}
}
开发者ID:HackLinux,项目名称:MESI-1,代码行数:54,代码来源:proc.cpp
示例8: main
int main(int argc, const char **argv)
{
utils::log::setfile("tests.log");
NOTE("RUNNING TESTS...");
#include "test_str.h"
#include "test_Variant.h"
NOTE("All tests passed!");
return 0;
}
开发者ID:LibreGames,项目名称:puzzlemoppet,代码行数:12,代码来源:main.cpp
示例9: actionBookmarkAdd
void actionBookmarkAdd(void *data)
{
DVDBookmark_t *bm;
unsigned char id[16];
char *state = NULL;
char volid[33];
int volid_type;
char *disccomment = NULL;
if(DVDGetDiscID(nav, id) != DVD_E_Ok) {
NOTE("%s", "GetDiscID failed\n");
return;
}
if(DVDGetVolumeIdentifiers(nav, 0, &volid_type, volid, NULL) != DVD_E_Ok) {
DNOTE("%s", "GetVolumeIdentifiers failed\n");
volid_type = 0;
}
if(DVDGetState(nav, &state) == DVD_E_Ok) {
if((bm = DVDBookmarkOpen(id, NULL, 1)) == NULL) {
if(errno != ENOENT) {
NOTE("%s", "BookmarkOpen failed: ");
perror("");
}
free(state);
return;
}
if(DVDBookmarkAdd(bm, state, NULL, NULL, NULL) == -1) {
DNOTE("%s", "BookmarkAdd failed\n");
DVDBookmarkClose(bm);
free(state);
return;
}
free(state);
if(volid_type != 0) {
if(DVDBookmarkGetDiscComment(bm, &disccomment) != -1) {
if((disccomment == NULL) || (disccomment[0] == '\0')) {
if(DVDBookmarkSetDiscComment(bm, volid) == -1) {
DNOTE("%s", "SetDiscComment failed\n");
}
}
if(disccomment) {
free(disccomment);
}
}
}
if(DVDBookmarkSave(bm, 0) == -1) {
NOTE("%s", "BookmarkSave failed\n");
}
DVDBookmarkClose(bm);
}
}
开发者ID:BackupTheBerlios,项目名称:ogle,代码行数:53,代码来源:bindings.c
示例10: autoload_bookmark
void autoload_bookmark(void) {
DVDBookmark_t *bm;
unsigned char id[16];
char *state = NULL;
int n;
if(!nav) {
return;
}
if(!bookmarks_autoload) {
return;
}
if(DVDGetDiscID(nav, id) != DVD_E_Ok) {
NOTE("%s", "GetDiscID failed\n");
return;
}
if((bm = DVDBookmarkOpen(id, NULL, 0)) == NULL) {
if(errno != ENOENT) {
NOTE("%s", "BookmarkOpen failed: ");
perror("");
}
return;
}
n = DVDBookmarkGetNr(bm);
if(n == -1) {
NOTE("%s", "DVDBookmarkGetNr failed\n");
} else if(n > 0) {
char *appinfo;
if(DVDBookmarkGet(bm, n-1, &state, NULL,
"common", &appinfo) != -1) {
if(state) {
if(appinfo && !strcmp(appinfo, "autobookmark")) {
if(DVDSetState(nav, state) != DVD_E_Ok) {
NOTE("%s", "DVDSetState failed\n");
}
}
free(state);
}
if(appinfo) {
free(appinfo);
}
} else {
NOTE("%s", "BookmarkGet failed\n");
}
}
DVDBookmarkClose(bm);
}
开发者ID:BackupTheBerlios,项目名称:ogle,代码行数:52,代码来源:main.c
示例11: handle_gps
void* handle_gps(int *arg)
{
char one_line[512] = {0};
// int ret = 0;
// unsigned int count = 0;
char *p = one_line;
char ch = 0;
int valid_flag = 0;
NOTE("GPS Thread start...\n");
int fd = open_gps_com("/dev/ttyS0");
while(!exit_flag) {
ch = get_char(fd);
if(ch <=0)
goto RECONN;
if(ch == '$') {
memset(one_line,0,512);
p = one_line;
*p = ch;
valid_flag = 1;
} else if(ch == '\r' || ch == '\n') {
if(valid_flag) {
//valid data is between '$' to '\r' or '\n'
//tail add ','
*p = ',';
p++;
*p = '\0';
// DEBUG("[%d][%s]\n",++count,one_line);
parse_var(one_line,"/tmp/gps_info");
//the all gps info,can not sleep here
}
valid_flag = 0;
}
if(valid_flag) {
*p = ch;
p++;
}
continue;
RECONN:
ERROR("Read GPS Com Error!%d:%s\n",errno,strerror(errno));
if(fd >= 0) port_close(fd);
sleep_seconds_intr(10);
fd = open_gps_com("/dev/ttyS0");
}
NOTE("GPS Thread exit!\n");
if(fd >= 0) port_close(fd);
system("/bin/echo GPS_thread_EXIT > /tmp/gps_status");
return NULL;
}
开发者ID:wind0419,项目名称:wind_code,代码行数:49,代码来源:main2.c
示例12: NOTE
void RTMFPServer::run() {
try {
_pSocket->bind(SocketAddress("0.0.0.0",_port));
_mainSockets.add(*_pSocket,*this);
NOTE("RTMFP server starts on %u port",_port);
onStart();
RTMFPManager manager(*this);
bool terminate=false;
while(!terminate)
handle(terminate);
} catch(Exception& ex) {
FATAL("RTMFPServer, %s",ex.displayText().c_str());
} catch (exception& ex) {
FATAL("RTMFPServer, %s",ex.what());
} catch (...) {
FATAL("RTMFPServer, unknown error");
}
_mainSockets.remove(*_pSocket);
// terminate handle
terminate();
// clean sessions, and send died message if need
_handshake.clear();
_sessions.clear();
// stop receiving and sending engine (it waits the end of sending last session messages)
poolThreads.clear();
// close UDP socket
delete _pSocket;
sockets.clear();
_mainSockets.clear();
_port=0;
onStop();
if(_pCirrus) {
delete _pCirrus;
_pCirrus = NULL;
}
NOTE("RTMFP server stops");
}
开发者ID:mokerjoke,项目名称:Cumulus,代码行数:49,代码来源:RTMFPServer.cpp
示例13: init_signals
/** @internal
* Registers all the signal handlers
*/
static void init_signals(void) {
struct sigaction sa;
NOTE("Setting SIGCHLD handler to sigchld_handler()");
sa.sa_handler = sigchld_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
if (sigaction(SIGCHLD, &sa, NULL) == -1) {
ERROR("sigaction(): %s", strerror(errno));
exit(1);
}
/* Trap SIGPIPE */
/* This is done so that when libhttpd does a socket operation on
* a disconnected socket (i.e.: Broken Pipes) we catch the signal
* and do nothing. The alternative is to exit. SIGPIPE are harmless
* if not desirable.
*/
NOTE("Setting SIGPIPE handler to SIG_IGN\n");
sa.sa_handler = SIG_IGN;
if (sigaction(SIGPIPE, &sa, NULL) == -1) {
ERROR("sigaction(): %s\n", strerror(errno));
exit(1);
}
NOTE("Setting SIGTERM,SIGQUIT,SIGINT handlers to termination_handler()\n");
sa.sa_handler = termination_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
/* Trap SIGTERM */
if (sigaction(SIGTERM, &sa, NULL) == -1) {
ERROR("sigaction(): %s\n", strerror(errno));
exit(1);
}
/* Trap SIGQUIT */
if (sigaction(SIGQUIT, &sa, NULL) == -1) {
ERROR("sigaction(): %s\n", strerror(errno));
exit(1);
}
/* Trap SIGINT */
if (sigaction(SIGINT, &sa, NULL) == -1) {
ERROR("sigaction(): %s\n", strerror(errno));
exit(1);
}
}
开发者ID:wind0419,项目名称:wind_code,代码行数:51,代码来源:main2.c
示例14: AFX_MANAGE_STATE
STDMETHODIMP CDVSBasePPage::GetPageInfo(LPPROPPAGEINFO pPageInfo)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CString str;
if(!str.LoadString(m_TitleId)) return E_FAIL;
WCHAR wszTitle[STR_MAX_LENGTH];
#ifdef UNICODE
wcscpy(wszTitle, str);
#else
mbstowcs(wszTitle, str, str.GetLength()+1);
#endif
CheckPointer(pPageInfo, E_POINTER);
// Allocate dynamic memory for the property page title
LPOLESTR pszTitle;
HRESULT hr = AMGetWideString(wszTitle, &pszTitle);
if(FAILED(hr)) {NOTE("No caption memory"); return hr;}
pPageInfo->cb = sizeof(PROPPAGEINFO);
pPageInfo->pszTitle = pszTitle;
pPageInfo->pszDocString = NULL;
pPageInfo->pszHelpFile = NULL;
pPageInfo->dwHelpContext = 0;
// Set defaults in case GetDialogSize fails
pPageInfo->size.cx = 340;
pPageInfo->size.cy = 150;
MyGetDialogSize(m_DialogId, DialogProc, 0L, &pPageInfo->size);
return NOERROR;
}
开发者ID:Cyberbeing,项目名称:xy-VSFilter,代码行数:35,代码来源:DirectVobSubPropPage.cpp
示例15: KDA_Map
/** Perform op->name on each node of op->k_closest
or carry out op->service().
*/
void
KDA_Map(KDA_Operation* op)
{
NOTE_F;
if (op->name)
{
printf("map: %s \n", op->name);
for (struct ilist_item* item = op->k_closest->head; item;
item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (n->id == id)
continue;
MPIRPC_Call(n->node, op->name, op->args,
op, op->proceed);
}
}
else if (op->query)
{
NOTE("op->query");
op->query->service(op);
}
else assert(false);
op->returned = list_create();
}
开发者ID:adilansari,项目名称:dht-mpi-apis,代码行数:29,代码来源:kademlia.c
示例16: KDA_Neighbor_node
/**
Return the KDA_Neighbor for this MPIRPC_Node.
Could fail if other_id is not in local neighbor table.
*/
KDA_Neighbor*
KDA_Neighbor_node(MPIRPC_Node node)
{
int i;
struct list_item* item;
NOTE_F;
for (i = 0; i < KDA_SPACE_SIZE; i++)
{
for (item = k_bucket[i]->head;
item; item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (node.comm == n->node.comm)
return n;
}
}
for (item = clients->head;
item; item = item->next)
{
KDA_Neighbor* n = (KDA_Neighbor*) item->data;
if (node.comm == n->node.comm)
return n;
}
NOTE("KDA_Neighbor_node: NULL!");
return NULL;
}
开发者ID:adilansari,项目名称:dht-mpi-apis,代码行数:33,代码来源:kademlia.c
示例17: usb_register_callback
void usb_register_callback(struct usb_sock_t *usb)
{
IGNORE(usb);
int status = libusb_hotplug_register_callback(
NULL,
LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT,
// Note: libusb's enum has no default value
// a bug has been filled with libusb.
// Please switch the below line to 0
// once the issue has been fixed in
// deployed versions of libusb
// https://github.com/libusb/libusb/issues/35
// 0,
LIBUSB_HOTPLUG_ENUMERATE,
g_options.vendor_id,
g_options.product_id,
LIBUSB_HOTPLUG_MATCH_ANY,
&usb_exit_on_unplug,
NULL,
NULL);
if (status == LIBUSB_SUCCESS) {
pthread_t thread_handle;
pthread_create(&thread_handle, NULL, &usb_pump_events, NULL);
NOTE("Registered unplug callback");
} else
ERR("Failed to register unplug callback");
}
开发者ID:GalliumOS,项目名称:cups-filters,代码行数:28,代码来源:usb.c
示例18: NOTE
void Daemon::grouped( Channel channel ) {
NOTE();
OutputMessage response( MessageType::Control );
if ( _state != State::FormingGroup ) {
response.tag( Code::Refuse );
channel->send( response );
return;
}
Channel top, bottom;
std::tie( top, bottom ) = Communicator::socketPair();
response.tag( Code::OK );
channel->send( response );
int pid = ::fork();
if ( pid == -1 )
throw brick::net::SystemException( "fork" );
if ( pid == 0 )
becomeChild( std::move( bottom ) );
else {
_childPid = pid;
becomeParent( std::move( top ) );
}
}
开发者ID:spito,项目名称:dp,代码行数:26,代码来源:daemon.cpp
示例19: Target
Session& RTMFPServer::createSession(const Peer& peer,Cookie& cookie) {
Target* pTarget=_pCirrus;
if(_middle) {
if(!cookie.pTarget) {
cookie.pTarget = new Target(peer.address,&cookie);
memcpy((UInt8*)cookie.pTarget->peerId,peer.id,ID_SIZE);
memcpy((UInt8*)peer.id,cookie.pTarget->id,ID_SIZE);
NOTE("Mode 'man in the middle' : to connect to peer '%s' use the id :\n%s",Util::FormatHex(cookie.pTarget->peerId,ID_SIZE).c_str(),Util::FormatHex(cookie.pTarget->id,ID_SIZE).c_str());
} else
pTarget = cookie.pTarget;
}
ServerSession* pSession;
if(pTarget) {
pSession = new Middle(_sessions.nextId(),cookie.farId,peer,cookie.decryptKey(),cookie.encryptKey(),*this,_sessions,*pTarget);
if(_pCirrus==pTarget)
pSession->pTarget = cookie.pTarget;
DEBUG("Wait cirrus handshaking");
pSession->manage(); // to wait the cirrus handshake
} else {
pSession = new ServerSession(_sessions.nextId(),cookie.farId,peer,cookie.decryptKey(),cookie.encryptKey(),*this);
pSession->pTarget = cookie.pTarget;
}
_sessions.add(pSession);
return *pSession;
}
开发者ID:mokerjoke,项目名称:Cumulus,代码行数:30,代码来源:RTMFPServer.cpp
示例20: cmpi_put
/**
Blocking call.
*/
CMPI_RETURN
//cmpi_put(char* key, char* value, int length)
cmpi_put(char* key, void* value, int length)
{
struct inlist_item* item;
MPIRPC_Node node;
SHOW_FS(key);
int i = inlist_random(contacts);
MPIRPC_Node_make(MPI_COMM_WORLD, i, &node);
MPIRPC* lookup = DENSE_Lookup_k(node, key);
MPIRPC_Wait(lookup);
struct inlist* ranks = inlist_parse(lookup->result);
free(lookup->result);
MPIRPC_Free(lookup);
NOTE("got ranks: ");
DEBUG(inlist_printf(ranks));
for (item = ranks->head; item; item = item->next)
{
SHOW_I(item->data);
MPIRPC_Node_make(MPI_COMM_WORLD, item->data, &node);
MPIRPC* rpc = DENSE_Store(node, key, value, length);
MPIRPC_Wait(rpc);
MPIRPC_Free(rpc);
}
inlist_free(ranks);
DONE;
return CMPI_SUCCESS;
}
开发者ID:adilansari,项目名称:dht-mpi-apis,代码行数:36,代码来源:cmpi_dense.c
注:本文中的NOTE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论