本文整理汇总了C++中ERR_MSG函数的典型用法代码示例。如果您正苦于以下问题:C++ ERR_MSG函数的具体用法?C++ ERR_MSG怎么用?C++ ERR_MSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ERR_MSG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void)
{
sigset_t pendingset;
struct sigaction act;
act.sa_handler = myhandler;
act.sa_flags = 0;
sigemptyset(&act.sa_mask);
int rc;
rc = sigaction(SIGCHLD, &act, 0);
if (rc) {
ERR_MSG("sigaction()", rc);
return PTS_UNRESOLVED;
}
if (sigset(SIGCHLD, SIG_HOLD) == SIG_ERR) {
perror("Unexpected error while using sigset()");
return PTS_UNRESOLVED;
}
raise(SIGCHLD);
rc = sigpending(&pendingset);
if (rc) {
ERR_MSG("sigpending()", rc);
return PTS_UNRESOLVED;
}
if (sigismember(&pendingset, SIGCHLD) != 1) {
printf("Test FAILED: Signal SIGCHLD wasn't hold.\n");
return PTS_FAIL;
}
printf("Test PASSED\n");
return PTS_PASS;
}
示例2: bma150_read_reg
// ************************************************************************
// Gsensor Code -- BMA150
// ************************************************************************
static int bma150_read_reg(struct i2c_client *clnt, unsigned char reg, unsigned char *data, unsigned char count)
{
unsigned char tmp[10];
if (10 < count)
return -1;
tmp[0] = reg;
if (bma150_i2c_tx(tmp, 1) < 0)
{
ERR_MSG("Set REGISTER address error");
return -EIO;
}
if (bma150_i2c_rx(tmp, count) < 0)
{
ERR_MSG("Read REGISTER content error");
return -EIO;
}
strncpy(data, tmp, count);
return 0;
}
示例3: G_THROW
void
JB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim)
{
if(!gjim)
{
G_THROW( ERR_MSG("JB2Image.bad_number") );
}
JB2Dict &jim=*gjim;
// -------------------------
// THIS IS THE ENCODING PART
// -------------------------
int firstshape = jim.get_inherited_shape_count();
int nshape = jim.get_shape_count();
init_library(jim);
// Code headers.
int rectype = REQUIRED_DICT_OR_RESET;
if (jim.get_inherited_shape_count() > 0)
code_record(rectype, gjim, 0);
rectype = START_OF_DATA;
code_record(rectype, gjim, 0);
// Code Comment.
rectype = PRESERVED_COMMENT;
if (!! jim.comment)
code_record(rectype, gjim, 0);
// Encode every shape
int shapeno;
DJVU_PROGRESS_TASK(jb2code,"jb2 encode", nshape-firstshape);
for (shapeno=firstshape; shapeno<nshape; shapeno++)
{
DJVU_PROGRESS_RUN(jb2code, (shapeno-firstshape)|0xff);
// Code shape
JB2Shape &jshp = jim.get_shape(shapeno);
rectype=(jshp.parent >= 0)
?MATCHED_REFINE_LIBRARY_ONLY:NEW_MARK_LIBRARY_ONLY;
code_record(rectype, gjim, &jshp);
add_library(shapeno, jshp);
// Check numcoder status
if (cur_ncell > CELLCHUNK)
{
rectype = REQUIRED_DICT_OR_RESET;
code_record(rectype, 0, 0);
}
}
// Code end of data record
rectype = END_OF_DATA;
code_record(rectype, gjim, 0);
gzp=0;
}
示例4: formRadvd
void formRadvd(request *wp, char *path, char *query)
{
int pid;
char tmpBuf[256];
char *submitUrl;
char* value;
radvdCfgParam_t radvdCfgParam;
/*Get parameters*/
getRadvdInfo(&radvdCfgParam);
/*Set parameters*/
value=req_get_cstream_var(wp,"submit","");
if(0 == strcmp(value,"Save"))
{
set_RadvdParam(wp, path, query,&radvdCfgParam);
}
/*Set to pMIb*/
apmib_set(MIB_IPV6_RADVD_PARAM,&radvdCfgParam);
/*Update it to flash*/
setOk_radvd:
apmib_update(CURRENT_SETTING);
/*create the config file*/
create_RadvdCfgFile(&radvdCfgParam);
/*start the Daemon*/
#ifndef NO_ACTION
pid = fork();
if (pid) {
waitpid(pid, NULL, 0);
}
else if (pid == 0) {
snprintf(tmpBuf, 100, "%s/%s", _CONFIG_SCRIPT_PATH, _IPV6_RADVD_SCRIPT_PROG);
execl( tmpBuf, _IPV6_RADVD_SCRIPT_PROG, NULL);
exit(1);
}
#endif
submitUrl = req_get_cstream_var(wp, "submit-url", ""); // hidden page
OK_MSG(submitUrl);
return;
setErr_radvd:
ERR_MSG(tmpBuf);
return;
}
示例5: do_transition
static int do_transition(struct state_t* state,void* input)
{
struct transition_t* p;
p = state->trans;
while( p ){
if( p->event.happend(input) ){
state->owner->cur_state = p->next_state;
state->prev = state;
DEBUG_MSG("will transition to another state\n");
return 0;
}
p = p->_next;
}
ERR_MSG("no target to transition to\n");
return -1;
}
示例6: if
const JB2Shape &
JB2Dict::get_shape(const int shapeno) const
{
const JB2Shape *retval;
if(shapeno >= inherited_shapes)
{
retval=&shapes[shapeno - inherited_shapes];
}else if(inherited_dict)
{
retval=&(inherited_dict->get_shape(shapeno));
}else
{
G_THROW( ERR_MSG("JB2Image.bad_number") );
}
return *retval;
}
示例7: GetCurrentThreadId
void
GMonitor::broadcast()
{
if (ok)
{
DWORD self = GetCurrentThreadId();
if (count>0 || self!=locker)
G_THROW( ERR_MSG("GThreads.not_acq_broad") );
for (struct thr_waiting *w=head; w; w=w->next)
if (w->waiting)
{
SetEvent(w->gwait);
w->waiting = FALSE;
}
}
}
示例8: pthread_self
void
GMonitor::leave()
{
static pthread_t pthread_null;
pthread_t self = pthread_self();
if (ok && (count>0 || !pthread_equal(locker, self)))
G_THROW( ERR_MSG("GThreads.not_acq_broad") );
count += 1;
if (count > 0)
{
count = 1;
locker = pthread_null;
if (ok)
pthread_mutex_unlock(&mutex);
}
}
示例9: fsm_release
int fsm_release(struct state_machine_t** fsm)
{
if( !fsm || !(*fsm) ){
return 0;
}
if( (*fsm)->isrunning ){
ERR_MSG("the state machine is still running\n");
return -1;
}
free(*fsm);
*fsm = NULL;
return 0;
}
示例10: test_1
/**
* Test 1 - Installation d'un driver
* Description
* Installer le driver alors qu'il n'est pas installé
* Resultat attendu
* La valeur de retour doit être positive, et correspond au numéro du driver. Il doit être possible
* de le retrouver en utilisant la fonction iosDrvShow.
**/
int test_1()
{
int success = 0;
if(pe_driverInstall(10) >= 0)
{
success++;
iosDrvShow();
getchar();
// Call this to clean the system.
}
else
{
ERR_MSG(1);
}
pe_driverUninstall();
return success;
}
示例11: G_THROW
void
DjVuTXT::encode(const GP<ByteStream> &gbs) const
{
ByteStream &bs=*gbs;
if (! textUTF8 )
G_THROW( ERR_MSG("DjVuText.no_text") );
// Encode text
int textsize = textUTF8.length();
bs.write24( textsize );
bs.writall( (void*)(const char*)textUTF8, textsize );
// Encode zones
if (has_valid_zones())
{
bs.write8(Zone::version);
page_zone.encode(gbs);
}
}
示例12: DEBUG_MSG
void
GIFFManager::load_file(GP<ByteStream> str)
{
DEBUG_MSG("GIFFManager::load_file(): Loading IFF file.\n");
DEBUG_MAKE_INDENT(3);
GP<IFFByteStream> gistr=IFFByteStream::create(str);
IFFByteStream &istr=*gistr;
GUTF8String chunk_id;
if (istr.get_chunk(chunk_id))
{
if (chunk_id.substr(0,5) != "FORM:")
G_THROW( ERR_MSG("GIFFManager.cant_find2") );
set_name(chunk_id);
load_chunk(istr, top_level);
istr.close_chunk();
}
}
示例13: G_THROW
void
GBitmap::compress()
{
if (grays > 2)
G_THROW( ERR_MSG("GBitmap.cant_compress") );
GMonitorLock lock(monitor());
if (bytes)
{
grle.resize(0);
grlerows.resize(0);
rlelength = encode(rle,grle);
if (rlelength)
{
gbytes_data.resize(0);
bytes = 0;
}
}
}
示例14: G_THROW
DjVuProgressTask::~DjVuProgressTask()
{
if (data && data->callback)
{
if (data->head != this)
G_THROW( ERR_MSG("DjVuGlobal.not_compatible") );
data->head = parent;
if (!parent)
{
unsigned long curdate = GOS::ticks();
if((*(data->callback))(data->gtask?data->gtask:"",curdate-startdate, curdate-startdate))
{
G_THROW("INTERRUPT");
}
}
}
delete (GP<Data> *)gdata;
}
示例15: fsm_init
int fsm_init(struct state_machine_t** fsm)
{
if( !fsm ){
ERR_MSG("invalid argument\n");
return -1;
}
*fsm = (struct state_machine_t*)calloc(1,sizeof(struct state_machine_t));
if( *fsm == NULL ){
STD_ERR_MSG("Cant allocate memory");
return -1;
}
(*fsm)->default_entered = default_entered_cb;
(*fsm)->default_exited = default_exited_cb;
return 0;
}