本文整理汇总了C++中err_print函数的典型用法代码示例。如果您正苦于以下问题:C++ err_print函数的具体用法?C++ err_print怎么用?C++ err_print使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了err_print函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: skip_limbo
static void
skip_limbo(void)
#line 1481 "ctangle.w"
{
char c;
while(1){
if(loc> limit&&get_line()==0)return;
*(limit+1)= '@';
while(*loc!='@')loc++;
if(loc++<=limit){
c= *loc++;
if(ccode[(eight_bits)c]==new_section)break;
switch(ccode[(eight_bits)c]){
case translit_code:/*93:*/
#line 1507 "ctangle.w"
while(xisspace(*loc)&&loc<limit)loc++;
loc+= 3;
if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2))
||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
err_print("! Improper hex number following @l");
else{
unsigned i;
char*beg;
sscanf(loc-3,"%x",&i);
while(xisspace(*loc)&&loc<limit)loc++;
beg= loc;
while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||*loc=='_'))loc++;
if(loc-beg>=translit_length)
err_print("! Replacement string in @l too long");
else{
strncpy(translit[i-0200],beg,loc-beg);
translit[i-0200][loc-beg]= '\0';
}
}
/*:93*/
#line 1491 "ctangle.w"
;break;
case format_code:case'@':break;
case control_text:if(c=='q'||c=='Q'){
while((c= skip_ahead())=='@');
if(*(loc-1)!='>')
err_print("! Double @ should be used in control text");
break;
}
default:err_print("! Double @ should be used in limbo");
}
}
}
}
示例2: vtq_imageconv_init
int vtq_imageconv_init(struct vtq_imageconv_state **vtq_imageconv_out,
struct vtq_vce *vtq_vce,
struct module *module,
struct device *device,
struct proc_dir_entry *proc_vcedir)
{
struct vtq_imageconv_state *out;
int s;
(void) proc_vcedir;
out = kmalloc(sizeof(*out), GFP_KERNEL);
if (out == NULL) {
err_print("kmalloc failure\n");
goto err_kmalloc_vtq_imageconv_state;
}
out->vtq = vtq_create_context(vtq_vce);
if (out->vtq == NULL) {
err_print("failed to create VTQ context\n");
goto err_vtq_create_context;
}
/* Mark that we haven't received the blob (via
* request_firmware) yet */
out->image = NULL;
out->want_image_via_vtqinit = 0;
atomic_set(&out->task_get_count, 0);
out->device = device;
s = request_firmware_nowait(module, 1,
"bcmvtq_imageconv", out->device,
GFP_KERNEL, out, _fw_cont);
if (s != 0) {
err_print("request firmware failed\n");
goto err_request_firmware;
}
/* success */
*vtq_imageconv_out = out;
return 0;
/* error exit paths follow */
err_request_firmware:
vtq_destroy_context(out->vtq);
err_vtq_create_context:
kfree(out);
err_kmalloc_vtq_imageconv_state:
return -ENOENT;
}
示例3: P1H
void
#line 87 "./cwebdir/comm-w2c.ch"
prime_the_change_buffer P1H(void)
#line 254 "./cwebdir/common.w"
{
change_limit= change_buffer;
/*13:*/
#line 265 "./cwebdir/common.w"
while(1){
change_line++;
if(!input_ln(change_file))return;
if(limit<buffer+2)continue;
if(buffer[0]!='@')continue;
if(xisupper(buffer[1]))buffer[1]= tolower(buffer[1]);
if(buffer[1]=='x')break;
if(buffer[1]=='y'||buffer[1]=='z'||buffer[1]=='i'){
loc= buffer+2;
err_print("! Missing @x in change file");
}
}
/*:13*/
#line 256 "./cwebdir/common.w"
;
/*14:*/
#line 282 "./cwebdir/common.w"
do{
change_line++;
if(!input_ln(change_file)){
err_print("! Change file ended after @x");
return;
}
}while(limit==buffer);
/*:14*/
#line 257 "./cwebdir/common.w"
;
/*15:*/
#line 292 "./cwebdir/common.w"
{
change_limit= change_buffer+(limit-buffer);
strncpy(change_buffer,buffer,limit-buffer+1);
}
/*:15*/
#line 258 "./cwebdir/common.w"
;
}
示例4: DMPAPI
DMPAPI(void) uart_Close(void *vport)
{
unsigned char lcr;
SerialPort *port = (SerialPort *)vport;
if (port == NULL) { err_print((char*)"%s: port is null.\n", __FUNCTION__); return; }
if (port->InUse != 0)
{
// restore old IER & MCR
uart_IntDisable(vport);
io_DisableINT();
{
io_outpb(port->MCR, port->old_mcr);
}
io_RestoreINT();
irq_Close();
// restore old LSB & MSB
#ifdef _VORTEX86EXC_UART_WORKAROUND
/* To avoid Vortex86EX(D) write sync. issue. */
io_DisableINT();
{
lcr = io_inpb(port->LCR);
io_outpb(port->LCR, 0x80);
do {
io_outpb(port->DLLSB, port->old_lsb);
} while (io_inpb(port->DLLSB) != port->old_lsb);
do {
io_outpb(port->DLMSB, port->old_msb);
} while (io_inpb(port->DLMSB) != port->old_msb);
io_inpb(0x80); // do IO delay
io_outpb(port->LCR, lcr);
}
io_RestoreINT();
#else
_16550_DLAB_Out(port, port->DLLSB, port->old_lsb);
_16550_DLAB_Out(port, port->DLMSB, port->old_msb);
#endif
// restore old LCR & timeout
uart_SetFormat(vport, port->old_lcr);
uart_SetTimeOut(vport, port->old_TimeOut);
vx86_uart_Close(port->com);
if (io_Close() == false) err_print((char*)"Close IO lib error!!\n");
}
uart_Free(port);
}
示例5: get_control_text
boolean get_control_text(void)
{ char c,* k=id_first=&mod_text[1]; /* points after last recorded character */
do
if ((*k++=*loc++)=='@')
if ((c=*loc++)!='@')
{ if (c!='>')
err_print("! Control codes are forbidden in control text");
return (id_loc=k-1)==id_first;
}
while(loc<=limit);
err_print("! Control text didn't end");
return (id_loc=k)==id_first;
}
示例6: block_all_sigs
static inline void block_all_sigs(void)
{
sigset_t set;
if( sigfillset(&set) == -1 ) {
err_print("sigfillset");
return;
}
if( sigprocmask(SIG_BLOCK,&set,NULL) == -1) {
err_print("sigprocmask");
return;
}
}
示例7: i2csw_Write
static bool i2csw_Write(int dev, unsigned char val) {
int i, databit;
// send data byte
for(i=0; i<8; i++)
{
databit = ((val & 0x80) == 0)? 0 : 1;
set_pins(dev, 0, databit); timer_DelayMicroseconds(I2CSW_delay[dev]); // set data bit
set_pins(dev, 1, databit); timer_DelayMicroseconds(I2CSW_delay[dev]); // send a clock
set_pins(dev, 0, databit);
val = val << 1;
}
// read ACK
set_pins(dev, 0, 1); timer_DelayMicroseconds(I2CSW_delay[dev]); // set SDA as input
set_pins(dev, 1, 1); timer_DelayMicroseconds(I2CSW_delay[dev]); // send a clock
if (read_sda(dev) == 1)
{
err_print("receive no ACK after transmitting");
return false;
}
set_pins(dev, 0, 1);
return true;
}
示例8: isp_open
static int isp_open(struct inode *inode, struct file *filp)
{
int ret = 0;
isp_t *dev = kmalloc(sizeof(isp_t), GFP_KERNEL);
if (!dev)
return -ENOMEM;
filp->private_data = dev;
dev->lock = __SPIN_LOCK_UNLOCKED();
dev->isp_status.status = 0;
sema_init(&dev->irq_sem, 0);
enable_isp_clock();
ret =
request_irq(IRQ_ISP, isp_isr, IRQF_DISABLED | IRQF_SHARED,
ISP_DEV_NAME, dev);
if (ret) {
err_print("request_irq failed ret = %d\n", ret);
goto err;
}
disable_irq(IRQ_ISP);
return 0;
err:
if (dev)
kfree(dev);
return ret;
}
示例9: _imageconv_flush
void _imageconv_flush(vce_t *user,
struct vce *vce)
{
int s;
if (user->need_to_wait_for_imageconv) {
dbg_print("Flushing unfinished imageconversions\n");
s = vtq_imageconv_await(vce->vtq_imageconv,
user->last_imageconv_job_id);
if (s == -ERESTARTSYS) {
int retried;
dbg_print("Wait was interrupted by signal, will poll\n")
;
/* TODO: might be good to make blocking version of API
*/
retried = 0;
while (s == -ERESTARTSYS && retried++ < 1000) {
usleep_range(1000, 20000);
s = vtq_imageconv_await(vce->vtq_imageconv,
user->last_imageconv_job_id);
}
dbg_print("After %d tries, s = %d\n", retried, s);
}
if (s != 0)
err_print("Failed to flush imageconv -- likely FATAL\n")
;
}
}
示例10: DMPAPI
DMPAPI(bool) usb_SetUSBPins(void *vusb, char port1, char pin1, char port2, char pin2)
{
USB_Device *usb = (USB_Device *)vusb;
if (usb == NULL) { err_print((char*)"%s: USB device is null.\n", __FUNCTION__); return false; }
if (set_gpio_config_addr(GPIO_CONFIG_ADDR) == false)
{
err_print((char*)"%s: init USB-DEV DETECT and ONOFF pins fail.\n", __FUNCTION__);
return false;
}
set_pin_in(port1, pin1);
set_pin_out(port2, pin2);
USB_Connect();
return true;
}
示例11: p_expand
int
p_expand()
{
uint64_t delta;
uint_t nparts;
struct dk_gpt *efi_label = cur_parts->etoc;
if (cur_parts->etoc->efi_altern_lba == 1 ||
(cur_parts->etoc->efi_altern_lba >=
cur_parts->etoc->efi_last_lba)) {
err_print("Warning: No expanded capacity is found.\n");
return (0);
}
delta = efi_label->efi_last_lba - efi_label->efi_altern_lba;
nparts = efi_label->efi_nparts;
enter_critical();
efi_label->efi_parts[nparts - 1].p_start += delta;
efi_label->efi_last_u_lba += delta;
efi_label->efi_altern_lba = cur_parts->etoc->efi_last_lba;
exit_critical();
fmt_print("The expanded capacity is added to the unallocated space.\n");
return (0);
}
示例12: init_logging_semaphore
/*
* Name: init_loging_semaphore
* Zweck: Initialisieren der Logging Semaphore
* In-Parameter: -
* Out-Parameter: -
* Globale Variablen: sem_t* log_sem
* Rückgabewert: -
*/
void init_logging_semaphore(void) {
if ((log_sem = sem_open(SEM_NAME, O_CREAT, S_IRUSR | S_IWUSR, 1))
== SEM_FAILED) {
err_print("cannot create named semaphore");
exit(EXIT_FAILURE); //WARNING / TODO Does not free used memory!
} /* end if */
} /* end of init_logging_semaphore */
示例13: a_verify
/*
* This routine implements the 'verify' command. It writes the disk
* by writing unique data for each block; after the write pass, it
* reads the data and verifies for correctness. Note that the entire
* disk (or the range of disk) is fully written first and then read.
* This should eliminate any caching effect on the drives.
* It is not ok to run this command on any data you want to keep.
*/
int
a_verify()
{
/*
* The current disk must be formatted before disk analysis.
*/
if (!(cur_flags & DISK_FORMATTED)) {
err_print("Current Disk is unformatted.\n");
return (-1);
}
if (scan_random) {
fmt_print("The verify command does not write random data\n");
scan_random = 0;
}
if (scan_passes < 2 && !scan_loop) {
scan_passes = 2;
fmt_print("The verify command runs minimum of 2 passes, one"
" for writing and \nanother for reading and verfying."
" Resetting the number of passes to 2.\n");
}
if (check("Ready to verify (will corrupt data). This takes a long time,"
"\nbut is interruptable with CTRL-C. Continue")) {
return (-1);
}
return (do_scan(SCAN_WRITE | SCAN_VERIFY, F_NORMAL));
}
示例14: DMPAPI
DMPAPI(bool) i2cmaster_Start(int dev, unsigned char addr, unsigned char rwbit) {
bool result = true;
if (I2C_action[dev] != I2CACT_IDLE)
{
err_print("can't start a transaction because I2C%d isn't idle", dev);
return false;
}
I2C_rsInfo[dev].restart = false;
if (I2C_swMode[dev] != I2CSW_DISABLE)
result = i2csw_Start(dev, addr, rwbit, false);
else
{
if (I2C_speedMode[dev] == I2CMODE_HIGHSPEED)
result = i2cmaster_Start1(dev, 0x07, I2C_WRITE); //send high-speed master code
if (result == true) result = i2cmaster_Start1(dev, addr, rwbit);
}
if (result == true)
{
I2C_action[dev] = (rwbit == I2C_WRITE)? I2CACT_MASTERWRITE : I2CACT_MASTERREAD;
I2C_curAddr[dev] = addr;
}
return result;
}
示例15: delete_partition
/*
* This routine deletes a partition map from the list of maps for
* the given disk type.
*/
void
delete_partition(struct partition_info *parts)
{
struct partition_info *pptr;
/*
* If there isn't a current map, it's an error.
*/
if (cur_dtype->dtype_plist == NULL) {
err_print("Error: unexpected null partition list.\n");
fullabort();
}
/*
* Remove the map from the list.
*/
if (cur_dtype->dtype_plist == parts)
cur_dtype->dtype_plist = parts->pinfo_next;
else {
for (pptr = cur_dtype->dtype_plist; pptr->pinfo_next != parts;
pptr = pptr->pinfo_next)
;
pptr->pinfo_next = parts->pinfo_next;
}
/*
* Free the space it was using.
*/
destroy_data((char *)parts);
}