这篇教程C++ CRIT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CRIT函数的典型用法代码示例。如果您正苦于以下问题:C++ CRIT函数的具体用法?C++ CRIT怎么用?C++ CRIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CRIT函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: oh_uid_map_to_file/** * oh_uid_map_to_file: saves current uid and entity path mappings * to file, first element in file is 4 bytes for resource id, * then repeat EP_XREF structures holding uid and entity path pairings * * Return value: success 0, failed -1. **/SaErrorT oh_uid_map_to_file(void){ FILE *fp; if (!oh_uid_map_file) { return SA_OK; } uid_lock(&oh_uid_lock); fp = fopen(oh_uid_map_file, "wb"); if(!fp) { CRIT("Configuration file '%s' could not be opened", oh_uid_map_file); uid_unlock(&oh_uid_lock); return SA_ERR_HPI_ERROR; } /* write resource id */ if (fwrite((void *)&resource_id, sizeof(resource_id), 1, fp) != 1) { CRIT("write resource_id failed"); fclose(fp); uid_unlock(&oh_uid_lock); return SA_ERR_HPI_ERROR; } /* write all EP_XREF data records */ g_hash_table_foreach(oh_resource_id_table, write_ep_xref, fp); fclose(fp); uid_unlock(&oh_uid_lock); return SA_OK;}
开发者ID:openhpi1,项目名称:testrepo,代码行数:41,
示例2: mainint main(int argc, char **argv){ oh_el *el; SaErrorT retc; /* test failure of oh_el_map_from_file with nonexistant filename */ el = oh_el_create(20); retc = oh_el_map_from_file(el, "./notthere.data"); if (retc == SA_OK) { CRIT("oh_el_map_from_file failed."); return 1; } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { CRIT("oh_el_close on el failed."); return 1; } return 0;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:25,
示例3: oh_el_map_to_file/* write a EL entry list to a file */SaErrorT oh_el_map_to_file(oh_el *el, char *filename){ FILE *fp; GList *node = NULL; if (el == NULL || filename == NULL) { return SA_ERR_HPI_INVALID_PARAMS; } fp = fopen(filename, "wb"); if (!fp) { CRIT("EL file '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } for (node = el->list; node; node = node->next) { if (fwrite((void *)node->data, sizeof(oh_el_entry), 1, fp) != 1) { CRIT("Couldn't write to file '%s'.", filename); fclose(fp); return SA_ERR_HPI_ERROR; } } fclose(fp); return SA_OK;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:28,
示例4: mainint main(int argc, char **argv){ oh_el *el; SaErrorT retc; /* test oh_el_info with info == NULL */ el = oh_el_create(20); retc = oh_el_info(el, NULL); if (retc == SA_OK) { CRIT("oh_el_info failed."); return 1; } /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { CRIT("oh_el_close on el failed."); return 1; } return 0;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:25,
示例5: mainint main(int argc, char **argv){ oh_el *el; SaHpiTimeT timestamp = 0; SaErrorT retc; /* tests oh_el_timeset when el != NULL */ el = oh_el_create(20); retc = oh_el_timeset(el, timestamp + 20); if (retc != SA_OK){ CRIT("oh_el_timeset failed"); return 1; } /* close el without saving to file*/ retc = oh_el_close(el); if (retc != SA_OK) { CRIT("oh_el_close on el failed."); return 1; } return 0;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:27,
示例6: test_audiovoid test_audio(void){ struct aes_data aes_data; struct audio_stream audio_stream; char pcm_testdata[] = "pcm_testfile"; CRIT("Testing audio send routines; no connections " "will be made to the server/n"); lt_set_level(LT_AUDIO_STREAM, LT_INFO); lt_set_level(LT_RAOP_PLAY_SEND_AUDIO, LT_INFO); generate_aes_data(&aes_data); syscalls_strncpy(audio_stream.pcm_data_file, pcm_testdata, sizeof(audio_stream.pcm_data_file)); audio_stream.session_fd = syscalls_open("./fake_session", O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); if (-1 == audio_stream.session_fd) { ERRR("Failed to open fake session file descriptor/n"); goto out; } init_audio_stream(&audio_stream); send_audio_stream(&audio_stream, &aes_data);out: CRIT("Audio test done; exiting/n"); exit (1);}
开发者ID:dparnell,项目名称:raopd,代码行数:34,
示例7: exechandlerdestroystatic SaErrorT exechandlerdestroy(oHpiHandlerIdT handlerid){ SaErrorT rv = SA_OK; if (copt.debug) DBG("Go and unload handler %u in domain %u", handlerid, copt.domainid); rv = oHpiHandlerDestroy ( sessionid, handlerid ); if (copt.debug) DBG("oHpiHandlerDestroy returned %s", oh_lookup_error(rv)); if (rv==SA_OK) { printf("Handler %u successfully unloaded./n/n", handlerid); return rv; } else if (rv==SA_ERR_HPI_NOT_PRESENT) { if (copt.domainid==SAHPI_UNSPECIFIED_DOMAIN_ID) CRIT("Handler %u is not existing in default domain.", handlerid); else CRIT("Handler %u is not existing in domain %u.", handlerid, copt.domainid); return rv; } else CRIT("/nHandler %u couldn't be unloaded, Returncode %s", handlerid, oh_lookup_error(rv)); return rv;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:26,
示例8: config_init/** * Initialize the configuration. Have to be called befor using the config variable. * * @return 0 on success, otherwise something else. */int config_init() { strncpy(config.mqtt_client_id, CONF_DEFAULT_MQTT_CLIENT_ID, CONF_MAX_LENGTH_MQTT_CLIENT_ID); strncpy(config.mqtt_broker, CONF_DEFAULT_MQTT_BROKER, CONF_MAX_LENGTH_MQTT_BROKER); strncpy(config.mqtt_topic, CONF_DEFAULT_MQTT_TOPIC, CONF_MAX_LENGTH_MQTT_TOPIC); strncpy(config.log_file, CONF_DEFAULT_LOG_FILE, CONF_MAX_LENGTH_LOG_FILE); config.mqtt_port = CONF_DEFAULT_MQTT_PORT; config.mqtt_clean_session = CONF_DEFAULT_MQTT_CLEAN_SESSION; config.mqtt_keepalive = CONF_DEFAULT_MQTT_KEEPALIVE; config.verbose = CONF_DEFAULT_VERBOSE; config.start_time.tv_sec = CONF_DEFAULT_SEC; config.start_time.tv_usec = CONF_DEFAULT_USEC; config.record_start_time.tv_sec = CONF_DEFAULT_RECORD_SEC; config.record_start_time.tv_usec = CONF_DEFAULT_RECORD_USEC; config.ignore_timing = CONF_DEFAULT_IGNORE_TIMING; config.repeat = CONF_DEFAULT_REPEAT; config.mosq = NULL; if( 0 > sigemptyset(&config.sigset) ) { CRIT("sigemptyset()"); } if( 0 > sigaddset(&config.sigset, SIGINT) ) { CRIT("sigaddset()"); } return 0;}
开发者ID:der-b,项目名称:mqttutils,代码行数:36,
示例9: oh_ssl_init/** * oh_ssl_init * * Intialize the OpenSSL library. Note that the calls used in this routine * set up global data and are only to be called once for an SSL-based program. * To enforce this while allowing multiple callers (plugins) to initialize * the library, we use a static global variable to mark when we've done the * initialization. * * Note that the thread-safe initialization portion requires that * g_thread_init() has already been called, so don't call this routine * before then. * * Return value: 0 for success, -1 for failure **/int oh_ssl_init(void){ if (! oh_ssl_init_done) { /* Do this only once */ oh_ssl_init_done = 1; /* Load error strings to provide human-readable error * messages */ SSL_load_error_strings(); ERR_load_BIO_strings(); /* Initialize the SSL library */ if (! SSL_library_init()) { CRIT("SSL_library_init() failed"); return(-1); }#ifndef NO_SSL_RAND_SEED /* In case this isn't portable */ /* Actions to seed PRNG */ RAND_load_file("/dev/urandom", 1024);#endif /* Set up multi-thread protection functions */ if (thread_setup() ) { CRIT("SSL multi-thread protection setup call failed"); return(-1); } } return(0); /* Successful return */}
开发者ID:openhpi1,项目名称:testrepo,代码行数:47,
示例10: exechandlercreatestatic SaErrorT exechandlercreate (int argc, char **argv, int i){ SaErrorT rv = SA_OK; oHpiHandlerIdT handlerid = 0; GHashTable * createparams = g_hash_table_new_full ( g_str_hash, g_str_equal, g_free, g_free); SaHpiBoolT pluginnamegiven = SAHPI_FALSE; if (copt.debug) DBG ("createhandler started/n"); while (i<argc){ if (strcmp(argv[i],"-f")==0) { CRIT("input from file not implemented yet"); return (SA_OK); } else if (++i<argc) { if (strcmp(argv[i-1],"plugin")==0) pluginnamegiven = SAHPI_TRUE; g_hash_table_insert( createparams, g_strdup( argv[i-1] ), g_strdup( argv[i] )); if (copt.debug) DBG ("Pair of arguments: %s - %s/n", g_strdup( argv[i-1] ), g_strdup( argv[i] )); } else // parameters not in pairs return (SA_ERR_HPI_INVALID_PARAMS); i++; } if (!pluginnamegiven) { CRIT("You must enter a valid plugin name"); return (SA_ERR_HPI_INVALID_PARAMS); } rv = ohc_session_open_by_option ( &copt, &sessionid); if (rv != SA_OK) return rv; if (copt.debug) DBG("Calling oHpiHandlerCreate!"); rv = oHpiHandlerCreate(sessionid, createparams, &handlerid ); if ( rv != SA_OK ) { CRIT("oHpiHandlerCreate returned %s", oh_lookup_error(rv)); saHpiSessionClose(sessionid); return(rv); } printf("Handler %u successfully created!/n", handlerid); rv = saHpiSessionClose(sessionid); return(SA_OK);}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:53,
示例11: main/** * main: Announcement test * * This test adds one announcement to the list * * Return value: 0 on success, 1 on failure **/int main(int argc, char **argv){ oh_announcement *ann; SaHpiAnnouncementT announ; SaErrorT rc; announ.EntryId = 0; // modified by oh_announcement_append announ.Timestamp = 0; // modified by oh_announcement_append announ.AddedByUser = FALSE; // modified by oh_announcement_append announ.Severity = SAHPI_CRITICAL; announ.Acknowledged = FALSE; announ.StatusCond.Type= SAHPI_STATUS_COND_TYPE_SENSOR; announ.StatusCond.Entity.Entry[0].EntityType = SAHPI_ENT_SYSTEM_BOARD; announ.StatusCond.Entity.Entry[0].EntityLocation = 1; announ.StatusCond.Entity.Entry[1].EntityType = SAHPI_ENT_ROOT; announ.StatusCond.Entity.Entry[1].EntityLocation = 0; announ.StatusCond.DomainId = 1; announ.StatusCond.ResourceId = 1; announ.StatusCond.SensorNum = 1; announ.StatusCond.EventState = SAHPI_ES_UNSPECIFIED; announ.StatusCond.Name.Length = 5; memcpy(&announ.StatusCond.Name.Value,"announ", 5); announ.StatusCond.Mid = 123; /* we will not worry about the Data field for this test */ ann = oh_announcement_create(); rc = oh_announcement_append(ann, &announ); announ.Severity = SAHPI_MAJOR; rc = oh_announcement_append(ann, &announ); announ.Severity = SAHPI_MINOR; rc = oh_announcement_append(ann, &announ); rc = oh_announcement_ack(ann, 2, SAHPI_MAJOR); if(rc != SA_OK) { CRIT("on_announcement_ack returned %d.", rc); return 1; } rc = oh_announcement_get(ann, 2, &announ); if(rc != SA_OK) { CRIT("on_announcement_get returned %d.", rc); return 1; } if(announ.Acknowledged != TRUE) { CRIT("announ.Acknowledged invalid"); return 1; } return 0;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:60,
示例12: mainint main(int argc, char **argv){ oh_el *el; SaErrorT retc; int x; SaHpiEventT event; static char *data[5] = { "Test data one", "Test data two", "Test data three", "Test data four", "Test data five" }; /* test oh_el_prepend with existing EL*/ el = oh_el_create(20); /* get EL from file (el) */ retc = oh_el_map_from_file(el, "./elTest.data"); if (retc != SA_OK) { CRIT("oh_el_map_from_file failed."); return 1; } /* add 5 more events to el */ for(x=0;x<5;x++){ event.Source = 1; event.EventType = SAHPI_ET_USER; event.Timestamp = SAHPI_TIME_UNSPECIFIED; event.Severity = SAHPI_DEBUG; strcpy((char *) &event.EventDataUnion.UserEvent.UserEventData.Data, data[x]); retc = oh_el_prepend(el, &event, NULL, NULL); if (retc != SA_OK) { CRIT("oh_el_append failed."); return 1; } } /* close el */ retc = oh_el_close(el); if (retc != SA_OK) { CRIT("oh_el_close on el failed."); return 1; } return 0;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:52,
示例13: IsSimpleTypestatic gbooleanIsSimpleType( tMarshalType type ){ switch( type ) { case eMtVoid: case eMtInt8: case eMtUint8: case eMtInt16: case eMtUint16: case eMtInt32: case eMtUint32: case eMtInt64: case eMtUint64: case eMtFloat32: case eMtFloat64: return TRUE; case eMtArray: case eMtVarArray: case eMtStruct: case eMtStructElement: case eMtUnion: case eMtUnionElement: case eMtUserDefined: return FALSE; default: CRIT( "Unknown marshal type %d!", type ); return FALSE; }}
开发者ID:openhpi1,项目名称:testrepo,代码行数:32,
示例14: process_hpi_eventstatic int process_hpi_event(struct oh_domain *d, struct oh_event *e){ int i; GArray *sessions = NULL; SaHpiSessionIdT sid; SaHpiEventT *event = NULL; SaHpiRptEntryT *resource = NULL; SaHpiRdrT *rdr = NULL; if (!d || !e) return -1; event = &e->event; resource = &e->resource; rdr = (e->rdrs) ? (SaHpiRdrT *)e->rdrs->data : NULL; if (event->EventType == SAHPI_ET_USER) { resource->ResourceCapabilities = 0; if (rdr) rdr->RdrType = SAHPI_NO_RECORD; } oh_add_event_to_del(d, e); DBG("Added event to EL"); /* * Here is the SESSION MULTIPLEXING code */ sessions = oh_list_sessions(d->id); if (!sessions) { CRIT("Error: Got an empty session list on domain id %u", d->id); return -2; } DBG("Got session list for domain %u", d->id); /* Drop events if there are no sessions open to receive them. */ if (sessions->len < 1) { g_array_free(sessions, TRUE); DBG("No sessions open for event's domain %u. " "Dropping hpi_event", d->id); return 0; } /* multiplex event to the appropriate sessions */ for (i = 0; i < sessions->len; i++) { SaHpiBoolT is_subscribed = SAHPI_FALSE;#if defined(__sparc) || defined(__sparc__) sid = ((SaHpiSessionIdT *)((void *)(sessions->data)))[i];#else sid = g_array_index(sessions, SaHpiSessionIdT, i);#endif oh_get_session_subscription(sid, &is_subscribed); if (is_subscribed) { oh_queue_session_event(sid, e); } } g_array_free(sessions, TRUE); DBG("done multiplexing event into sessions"); return 0;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:60,
示例15: build_uid_map_data/* * build_uid_map_data: used by uid_map_from_file(), recursively * reads map file and builds two hash tables and EP_XREF data * structures * * @file: key into a GHashTable * * Return value: success 0, error -1. */static gint build_uid_map_data(FILE *fp){ EP_XREF *ep_xref; EP_XREF ep_xref1; gpointer value; gpointer key; while (fread(&ep_xref1, sizeof(EP_XREF), 1, fp) == 1) { /* copy read record from ep_xref1 to malloc'd ep_xref */ ep_xref = g_new0(EP_XREF, 1); if (!ep_xref) return -1; memcpy(ep_xref, &ep_xref1, sizeof(EP_XREF)); value = (gpointer)ep_xref; /* entity path based key */ key = (gpointer)&ep_xref->entity_path; g_hash_table_insert(oh_ep_table, key, value); /* resource id based key */ key = (gpointer)&ep_xref->resource_id; g_hash_table_insert(oh_resource_id_table, key, value); } if ((feof(fp) == 0) || (ferror(fp) != 0)) { CRIT("error building ep xref from map file"); return -1; } return 0;}
开发者ID:openhpi1,项目名称:testrepo,代码行数:41,
示例16: serial_initint serial_init(char *port) { struct termios options; int fd; INFO(1, "Opening serial port %s/n", port); fd = open(port, O_RDWR | O_NOCTTY | O_NDELAY); if (!fd) { CRIT(1, "Error opening serial port: %d (%s)", errno, strerror(errno)); } /* set raw input, 1 second timeout */ fcntl(fd, F_SETFL, 0); tcgetattr(fd, &options); options.c_cflag |= (CLOCAL | CREAD); options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); options.c_oflag &= ~OPOST; options.c_cc[VMIN] = 0; options.c_cc[VTIME] = 10; options.c_cflag &= ~PARENB; options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE; options.c_cflag |= CS8; cfsetispeed(&options, B19200); cfsetospeed(&options, B19200); tcsetattr(fd, TCSANOW, &options); return fd;}
开发者ID:purcaro,项目名称:hotpi,代码行数:32,
示例17: oh_el_map_from_file/* read a EL entry list from a file */SaErrorT oh_el_map_from_file(oh_el *el, char *filename){ FILE *fp; oh_el_entry entry; /* check el params and state */ if (el == NULL || filename == NULL) { return SA_ERR_HPI_INVALID_PARAMS; } else if (el->info.Enabled == FALSE) { return SA_ERR_HPI_INVALID_REQUEST; } fp = fopen(filename, "rb"); if (!fp) { CRIT("EL file '%s' could not be opened", filename); return SA_ERR_HPI_ERROR; } oh_el_clear(el); // ensure list is empty while (fread(&entry, sizeof(oh_el_entry), 1, fp) == 1) { oh_el_entry *elentry = g_new0(oh_el_entry, 1); el->nextid = entry.event.EntryId; el->nextid++; *elentry = entry; el->list = g_list_append(el->list, elentry); } fclose(fp); return SA_OK;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:32,
示例18: log_output_testvoid log_output_test(const char *file, Base::LOGLEVEL level){ int i = 5; float f = 9.5; char str[] = "test"; if(file != NULL) { Base::LogInit(file, level); } EMERG("---------log level: %d-----------/n", level); DEBUG("Log for Debug i=%d f=%f str=%s /n", i, f, str); INFO("Log for Info i=%d f=%f str=%s /n", i, f, str); NOTICE("Log for Notice i=%d f=%f str=%s /n", i, f, str); WARN("Log for Warning i=%d f=%f str=%s /n", i, f, str); ERROR("Log for Error i=%d f=%f str=%s /n", i, f, str); CRIT("Log for Crit i=%d f=%f str=%s /n", i, f, str); ALERT("Log for Alert i=%d f=%f str=%s /n", i, f, str); EMERG("Log for Emerg i=%d f=%f str=%s /n", i, f, str); if(file != NULL) { Base::LogUninit(); } return;}
开发者ID:RobotsBrain,项目名称:robrain,代码行数:27,
示例19: exechandlerinfostatic SaErrorT exechandlerinfo(oHpiHandlerIdT handlerid){ oHpiHandlerInfoT handlerinfo; SaErrorT rv = SA_OK; GHashTable *handlerconfig = g_hash_table_new_full( g_str_hash, g_str_equal, g_free, g_free ); if (copt.debug) DBG("Go and display handler info for %u", handlerid); rv = oHpiHandlerInfo ( sessionid, handlerid, &handlerinfo, handlerconfig ); if (rv==SA_ERR_HPI_NOT_PRESENT) { if (copt.domainid==SAHPI_UNSPECIFIED_DOMAIN_ID) CRIT("Handler %u is not existing in default domain.", handlerid); else CRIT("Handler %u is not existing in domain %u.", handlerid, copt.domainid); g_hash_table_destroy(handlerconfig); return SA_OK; } else if (rv!=SA_OK) { CRIT("oHpiHandlerInfo returned %s", oh_lookup_error(rv)); g_hash_table_destroy(handlerconfig); return rv; } if (copt.domainid==SAHPI_UNSPECIFIED_DOMAIN_ID) printf("/n/nInfo for handler %u in default domain:/n/n",handlerid); else printf("/n/nInfo for handler %u in domain %u:/n/n",handlerid, copt.domainid); printf("Plugin name: %s/n",(const char *)handlerinfo.plugin_name); printf("Root "); oh_print_ep (&(handlerinfo.entity_root),0); printf("Failed attempts to load handler: %u/n",handlerinfo.load_failed); printf("/nHandler configuration:/n"); printf (" plugin %s/n", (const char *)handlerinfo.plugin_name); printf (" entity_root /"%s/"/n",(const char *) g_hash_table_lookup(handlerconfig, "entity_root")); g_hash_table_foreach(handlerconfig, print_pair, NULL); printf("/n/n"); g_hash_table_destroy(handlerconfig); return rv;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:46,
示例20: CRITbool cHandler::Init(){ bool rc; rc = cConsole::Init(); if ( !rc ) { CRIT( "cannot initialize console" ); return false; } rc = m_timers.Start(); if ( !rc ) { CRIT( "cannot start timers" ); return false; } return true;}
开发者ID:openhpi1,项目名称:testrepo,代码行数:17,
示例21: set_maxfdstatic voidset_maxfd(void){ struct rlimit rl; if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { CRIT("can't get file limit"); } else { rl.rlim_cur = maxfd; if (rl.rlim_cur > rl.rlim_max) { rl.rlim_cur = rl.rlim_max; maxfd = rl.rlim_cur; } if (setrlimit(RLIMIT_NOFILE, &rl) < 0) { CRIT("setrlimit() error! "); } }}
开发者ID:maczpc,项目名称:csf,代码行数:18,
示例22: SSL_CTX_new/** * oh_ssl_ctx_init * * Create a new SSL_CTX object as a framework for TLS/SSL enabled functions. * In particular: * - Creates a new CTX object with default option values * - Sets common compatibility options * - Sets the default locations for trusted CA certificates. * SSL_CTX_set_default_verify_paths() is used to add system-wide default * certificate paths to the verify CApath without having to specify a * default location. The intent is that the distribution's configured * location will be used. * * Return value: pointer to SSL_CTX or NULL for failure **/SSL_CTX *oh_ssl_ctx_init(){ SSL_CTX *ctx; ctx = SSL_CTX_new(SSLv23_client_method()); if (ctx == NULL) { CRIT("SSL_CTX_new() failed"); return(NULL); } SSL_CTX_set_options(ctx, SSL_OP_TLS_ROLLBACK_BUG | SSL_OP_ALL); if (! SSL_CTX_set_default_verify_paths(ctx)) { CRIT("SSL_CTX_set_default_verify_paths() failed"); return(NULL); } return(ctx);}
开发者ID:openhpi1,项目名称:testrepo,代码行数:34,
示例23: evas_debug_errorvoidevas_debug_error(void){ if (!_evas_debug_init) { _evas_debug_init_from_env(); } if (_evas_debug_show == _EVAS_DEBUG_SHOW) CRIT("Evas Magic Check Failed!!!");}
开发者ID:Limsik,项目名称:e17,代码行数:10,
示例24: locate_cmpint locate_cmp(sxi_hdist_t *model1, sxi_hdist_t *model2, uint64_t hash, int replica, int bidx){ sx_nodelist_t *nodelist1, *nodelist2; int i; nodelist1 = sxi_hdist_locate(model1, hash, replica, bidx); if(!nodelist1) { CRIT("Can't locate hash with model1"); return 1; } nodelist2 = sxi_hdist_locate(model2, hash, replica, bidx); if(!nodelist1) { CRIT("Can't locate hash with model2"); sx_nodelist_delete(nodelist1); return 1; } if(sx_nodelist_count(nodelist1) != sx_nodelist_count(nodelist2) || sx_nodelist_count(nodelist1) != replica) { CRIT("Numbers of target nodes don't match"); sx_nodelist_delete(nodelist1); sx_nodelist_delete(nodelist2); return 1; } if(dbg) fprintf(stderr, "Locate (hash: %llx, replica: %u, bidx: %d) = ", (unsigned long long) hash, replica, bidx); for(i = 0; i < sx_nodelist_count(nodelist1); i++) { if(strcmp(sx_node_uuid_str(sx_nodelist_get(nodelist1, i)), sx_node_uuid_str(sx_nodelist_get(nodelist2, i)))) { CRIT("Different nodes reported for duplicate models"); sx_nodelist_delete(nodelist1); sx_nodelist_delete(nodelist2); return 1; } if(dbg) fprintf(stderr, "%s ", sx_node_addr(sx_nodelist_get(nodelist1, i))); } if(dbg) fprintf(stderr, "/n"); sx_nodelist_delete(nodelist1); sx_nodelist_delete(nodelist2); return 0;}
开发者ID:michals,项目名称:sx,代码行数:43,
示例25: oh_ssl_ctx_free/** * oh_ssl_ctx_free * @ctx: pointer to SSL_CTX as returned by oh_ssl_ctx_init() * * Free an SSL_CTX object * * Return value: 0 for success, -1 for failure **/int oh_ssl_ctx_free(SSL_CTX *ctx){ if (ctx == NULL) { CRIT("unexpected NULL ctx pointer"); return(-1); } SSL_CTX_free(ctx); return(0);}
开发者ID:openhpi1,项目名称:testrepo,代码行数:19,
示例26: evas_debug_input_nullvoidevas_debug_input_null(void){ if (!_evas_debug_init) { _evas_debug_init_from_env(); } if (_evas_debug_show == _EVAS_DEBUG_SHOW) CRIT("Input object pointer is NULL!"); if (_evas_debug_abort) abort();}
开发者ID:Limsik,项目名称:e17,代码行数:11,
示例27: lxc_monitord_sockfd_removestatic void lxc_monitord_sockfd_remove(struct lxc_monitor *mon, int fd) { int i; if (lxc_mainloop_del_handler(&mon->descr, fd)) CRIT("fd:%d not found in mainloop", fd); close(fd); for (i = 0; i < mon->clientfds_cnt; i++) { if (mon->clientfds[i] == fd) break; } if (i >= mon->clientfds_cnt) { CRIT("fd:%d not found in clients array", fd); lxc_monitord_cleanup(); exit(EXIT_FAILURE); } memmove(&mon->clientfds[i], &mon->clientfds[i+1], (mon->clientfds_cnt - i - 1) * sizeof(mon->clientfds[0])); mon->clientfds_cnt--;}
开发者ID:ArikaChen,项目名称:lxc,代码行数:21,
示例28: mainint main(int argc, char **argv){ oh_el *el; SaErrorT retc; /* map el from file*/ el = oh_el_create(20); retc = oh_el_map_from_file(el, "./elTest.data"); if (retc != SA_OK) { CRIT("oh_el_map_from_file failed."); return 1; } retc = oh_el_overflowreset(el); if (retc != SA_OK) { CRIT("el info.OverflowFlagreset failed."); return 1; } return 0;}
开发者ID:openhpi1,项目名称:openhpitest,代码行数:21,
注:本文中的CRIT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CRITICAL_REGION_EXIT函数代码示例 C++ CREATE_VECTOR3函数代码示例 |