本文整理汇总了C++中DEBUG_puts函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUG_puts函数的具体用法?C++ DEBUG_puts怎么用?C++ DEBUG_puts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEBUG_puts函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cupsGetOption
const char * /* O - Option value or @code [email protected] */
cupsGetOption(const char *name, /* I - Name of option */
int num_options,/* I - Number of options */
cups_option_t *options) /* I - Options */
{
int diff, /* Result of comparison */
match; /* Matching index */
DEBUG_printf(("2cupsGetOption(name=\"%s\", num_options=%d, options=%p)", name, num_options, (void *)options));
if (!name || num_options <= 0 || !options)
{
DEBUG_puts("3cupsGetOption: Returning NULL");
return (NULL);
}
match = cups_find_option(name, num_options, options, -1, &diff);
if (!diff)
{
DEBUG_printf(("3cupsGetOption: Returning \"%s\"", options[match].value));
return (options[match].value);
}
DEBUG_puts("3cupsGetOption: Returning NULL");
return (NULL);
}
示例2: cupsFinishDestDocument
ipp_status_t /* O - Status of document submission */
cupsFinishDestDocument(
http_t *http, /* I - Connection to destination */
cups_dest_t *dest, /* I - Destination */
cups_dinfo_t *info) /* I - Destination information */
{
DEBUG_printf(("cupsFinishDestDocument(http=%p, dest=%p(%s/%s), info=%p)",
http, dest, dest ? dest->name : NULL,
dest ? dest->instance : NULL, info));
/*
* Range check input...
*/
if (!http || !dest || !info)
{
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
DEBUG_puts("1cupsFinishDestDocument: Bad arguments.");
return (IPP_STATUS_ERROR_INTERNAL);
}
/*
* Get the response at the end of the document and return it...
*/
ippDelete(cupsGetResponse(http, info->resource));
DEBUG_printf(("1cupsFinishDestDocument: %s (%s)",
ippErrorString(cupsLastError()), cupsLastErrorString()));
return (cupsLastError());
}
示例3: cupsGetJobs
int /* O - Number of jobs */
cupsGetJobs(cups_job_t **jobs, /* O - Job data */
const char *mydest, /* I - NULL = all destinations, *
* otherwise show jobs for mydest */
int myjobs, /* I - 0 = all users, 1 = mine */
int completed) /* I - -1 = show all, 0 = active, *
* 1 = completed jobs */
{
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
/*
* Try to connect to the server...
*/
if (!cups_connect("default", NULL, NULL))
{
DEBUG_puts("Unable to connect to server!");
return (-1);
}
/*
* Return the jobs...
*/
return (cupsGetJobs2(cg->http, jobs, mydest, myjobs, completed));
}
示例4: mimeType
mime_type_t * /* O - Matching file type definition */
mimeType(mime_t *mime, /* I - MIME database */
const char *super, /* I - Super-type name */
const char *type) /* I - Type name */
{
mime_type_t key, /* MIME type search key */
*mt; /* Matching type */
DEBUG_printf(("mimeType(mime=%p, super=\"%s\", type=\"%s\")", mime, super,
type));
/*
* Range check input...
*/
if (!mime || !super || !type)
{
DEBUG_puts("1mimeType: Returning NULL.");
return (NULL);
}
/*
* Lookup the type in the array...
*/
strlcpy(key.super, super, sizeof(key.super));
strlcpy(key.type, type, sizeof(key.type));
mt = (mime_type_t *)cupsArrayFind(mime->types, &key);
DEBUG_printf(("1mimeType: Returning %p.", mt));
return (mt);
}
示例5: cupsRemoveOption
int /* O - New number of options */
cupsRemoveOption(
const char *name, /* I - Option name */
int num_options, /* I - Current number of options */
cups_option_t **options) /* IO - Options */
{
int i; /* Looping var */
cups_option_t *option; /* Current option */
DEBUG_printf(("2cupsRemoveOption(name=\"%s\", num_options=%d, options=%p)",
name, num_options, options));
/*
* Range check input...
*/
if (!name || num_options < 1 || !options)
{
DEBUG_printf(("3cupsRemoveOption: Returning %d", num_options));
return (num_options);
}
/*
* Loop for the option...
*/
for (i = num_options, option = *options; i > 0; i --, option ++)
if (!_cups_strcasecmp(name, option->name))
break;
if (i)
{
/*
* Remove this option from the array...
*/
DEBUG_puts("4cupsRemoveOption: Found option, removing it...");
num_options --;
i --;
_cupsStrFree(option->name);
_cupsStrFree(option->value);
if (i > 0)
memmove(option, option + 1, (size_t)i * sizeof(cups_option_t));
}
/*
* Return the new number of options...
*/
DEBUG_printf(("3cupsRemoveOption: Returning %d", num_options));
return (num_options);
}
示例6: _cupsSNMPIsOIDPrefixed
int /* O - 1 if prefixed, 0 if not prefixed */
_cupsSNMPIsOIDPrefixed(
cups_snmp_t *packet, /* I - Response packet */
const int *prefix) /* I - OID prefix */
{
int i; /* Looping var */
/*
* Range check input...
*/
DEBUG_printf(("4_cupsSNMPIsOIDPrefixed(packet=%p, prefix=%p)", packet,
prefix));
if (!packet || !prefix)
{
DEBUG_puts("5_cupsSNMPIsOIDPrefixed: Returning 0");
return (0);
}
/*
* Compare OIDs...
*/
for (i = 0;
i < CUPS_SNMP_MAX_OID && prefix[i] >= 0 && packet->object_name[i] >= 0;
i ++)
if (prefix[i] != packet->object_name[i])
{
DEBUG_puts("5_cupsSNMPIsOIDPrefixed: Returning 0");
return (0);
}
DEBUG_printf(("5_cupsSNMPIsOIDPrefixed: Returning %d",
i < CUPS_SNMP_MAX_OID));
return (i < CUPS_SNMP_MAX_OID);
}
示例7: init_uart
void init_uart()
{
DMA_start(hDmaRx);
/* Start the MCBSP and Sample Rate Generator */
MCBSP_start(C55XX_UART_hMcbsp, MCBSP_SRGR_START, 0xFFFF);
/* Take MCBSP receive and transmit out of reset */
MCBSP_start(C55XX_UART_hMcbsp, MCBSP_XMIT_START | MCBSP_RCV_START, 0xFFFF);
MCBSP_write32(C55XX_UART_hMcbsp, 0xffffffff); /* kickstart the serial port */
DEBUG_putc('d');
DEBUG_puts("ebug_printf_ok\r\n");
}
示例8: get_error_buffer
_cups_raster_error_t * /* O - Pointer to error buffer */
get_error_buffer(void)
{
_cups_raster_error_t *buf; /* Pointer to error buffer */
/*
* Initialize the global data exactly once...
*/
DEBUG_puts("3get_error_buffer()");
pthread_once(&raster_key_once, raster_init);
/*
* See if we have allocated the data yet...
*/
if ((buf = (_cups_raster_error_t *)pthread_getspecific(raster_key))
== NULL)
{
DEBUG_puts("4get_error_buffer: allocating memory for thread.");
/*
* No, allocate memory as set the pointer for the key...
*/
buf = calloc(1, sizeof(_cups_raster_error_t));
pthread_setspecific(raster_key, buf);
DEBUG_printf(("4get_error_buffer: buf=%p", (void *)buf));
}
/*
* Return the pointer to the data...
*/
return (buf);
}
示例9: _cupsSNMPIsOID
int /* O - 1 if equal, 0 if not equal */
_cupsSNMPIsOID(cups_snmp_t *packet, /* I - Response packet */
const int *oid) /* I - OID */
{
int i; /* Looping var */
/*
* Range check input...
*/
DEBUG_printf(("4_cupsSNMPIsOID(packet=%p, oid=%p)", packet, oid));
if (!packet || !oid)
{
DEBUG_puts("5_cupsSNMPIsOID: Returning 0");
return (0);
}
/*
* Compare OIDs...
*/
for (i = 0;
i < CUPS_SNMP_MAX_OID && oid[i] >= 0 && packet->object_name[i] >= 0;
i ++)
if (oid[i] != packet->object_name[i])
{
DEBUG_puts("5_cupsSNMPIsOID: Returning 0");
return (0);
}
DEBUG_printf(("5_cupsSNMPIsOID: Returning %d",
i < CUPS_SNMP_MAX_OID && oid[i] == packet->object_name[i]));
return (i < CUPS_SNMP_MAX_OID && oid[i] == packet->object_name[i]);
}
示例10: cupsImageClose
void
cupsImageClose(cups_image_t *img) /* I - Image to close */
{
cups_ic_t *current, /* Current cached tile */
*next; /* Next cached tile */
/*
* Wipe the tile cache file (if any)...
*/
if (img->cachefile >= 0)
{
DEBUG_printf(("Closing/removing swap file \"%s\"...\n", img->cachename));
close(img->cachefile);
unlink(img->cachename);
}
/*
* Free the image cache...
*/
DEBUG_puts("Freeing memory...");
for (current = img->first, next = NULL; current != NULL; current = next)
{
DEBUG_printf(("Freeing cache (%p, next = %p)...\n", current, next));
next = current->next;
free(current);
}
/*
* Free the rest of memory...
*/
if (img->tiles != NULL)
{
DEBUG_printf(("Freeing tiles (%p)...\n", img->tiles[0]));
free(img->tiles[0]);
DEBUG_printf(("Freeing tile pointers (%p)...\n", img->tiles));
free(img->tiles);
}
free(img);
}
示例11: cups_cache_lookup
static cups_lang_t * /* O - Language data or NULL */
cups_cache_lookup(
const char *name, /* I - Name of locale */
cups_encoding_t encoding) /* I - Encoding of locale */
{
cups_lang_t *lang; /* Current language */
DEBUG_printf(("7cups_cache_lookup(name=\"%s\", encoding=%d(%s))", name,
encoding, encoding == CUPS_AUTO_ENCODING ? "auto" :
lang_encodings[encoding]));
/*
* Loop through the cache and return a match if found...
*/
for (lang = lang_cache; lang != NULL; lang = lang->next)
{
DEBUG_printf(("9cups_cache_lookup: lang=%p, language=\"%s\", "
"encoding=%d(%s)", lang, lang->language, lang->encoding,
lang_encodings[lang->encoding]));
if (!strcmp(lang->language, name) &&
(encoding == CUPS_AUTO_ENCODING || encoding == lang->encoding))
{
lang->used ++;
DEBUG_puts("8cups_cache_lookup: returning match!");
return (lang);
}
}
DEBUG_puts("8cups_cache_lookup: returning NULL!");
return (NULL);
}
示例12: mimeDeleteFilter
void
mimeDeleteFilter(mime_t *mime, /* I - MIME database */
mime_filter_t *filter) /* I - Filter */
{
DEBUG_printf(("mimeDeleteFilter(mime=%p, filter=%p(%s/%s->%s/%s, cost=%d, "
"maxsize=" CUPS_LLFMT "))", mime, filter,
filter ? filter->src->super : "???",
filter ? filter->src->type : "???",
filter ? filter->dst->super : "???",
filter ? filter->dst->super : "???",
filter ? filter->cost : -1,
filter ? CUPS_LLCAST filter->maxsize : CUPS_LLCAST -1));
if (!mime || !filter)
return;
#ifdef DEBUG
if (!cupsArrayFind(mime->filters, filter))
DEBUG_puts("1mimeDeleteFilter: Filter not in MIME database.");
#endif /* DEBUG */
cupsArrayRemove(mime->filters, filter);
free(filter);
/*
* Deleting a filter invalidates the source lookup cache used by
* mimeFilter()...
*/
if (mime->srcs)
{
DEBUG_puts("1mimeDeleteFilter: Deleting source lookup cache.");
cupsArrayDelete(mime->srcs);
mime->srcs = NULL;
}
}
示例13: ippPort
int /* O - Port number */
ippPort(void)
{
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
DEBUG_puts("ippPort()");
if (!cg->ipp_port)
_cupsSetDefaults();
DEBUG_printf(("1ippPort: Returning %d...", cg->ipp_port));
return (cg->ipp_port);
}
示例14: cupsFileGetChar
int /* O - Character or -1 on end of file */
cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
{
/*
* Range check input...
*/
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
{
DEBUG_puts("3cupsFileGetChar: Bad arguments!");
return (-1);
}
/*
* If the input buffer is empty, try to read more data...
*/
if (fp->ptr >= fp->end)
if (cups_fill(fp) < 0)
{
DEBUG_puts("3cupsFileGetChar: Unable to fill buffer!");
return (-1);
}
/*
* Return the next character in the buffer...
*/
DEBUG_printf(("3cupsFileGetChar: Returning %d...", *(fp->ptr) & 255));
fp->pos ++;
DEBUG_printf(("4cupsFileGetChar: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (*(fp->ptr)++ & 255);
}
示例15: cgi_sort_variables
static void
cgi_sort_variables(void)
{
#ifdef DEBUG
int i;
DEBUG_puts("cgi_sort_variables: Sorting variables...");
#endif /* DEBUG */
if (form_count < 2)
return;
qsort(form_vars, (size_t)form_count, sizeof(_cgi_var_t),
(int (*)(const void *, const void *))cgi_compare_variables);
#ifdef DEBUG
DEBUG_puts("cgi_sort_variables: Sorted variable list is:");
for (i = 0; i < form_count; i ++)
DEBUG_printf(("cgi_sort_variables: %d: %s (%d) = \"%s\" ...\n", i,
form_vars[i].name, form_vars[i].nvalues,
form_vars[i].values[0]));
#endif /* DEBUG */
}