本文整理汇总了C++中print_entry函数的典型用法代码示例。如果您正苦于以下问题:C++ print_entry函数的具体用法?C++ print_entry怎么用?C++ print_entry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_entry函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: display_tfiles
static void display_tfiles(struct tfile ** ents_array, int numents) {
if (long_mode) {
int widths[4] = {0,0,0,0};
for (int i = 0; i < numents; i++) {
update_column_widths(widths, ents_array[i]);
}
for (int i = 0; i < numents; i++) {
print_entry_long(widths, ents_array[i]);
}
} else {
/* Determine the gridding dimensions */
int ent_max_len = 0;
for (int i = 0; i < numents; i++) {
ent_max_len = MAX(ent_max_len, strlen(ents_array[i]->name));
}
int col_ext = ent_max_len + MIN_COL_SPACING;
int cols = ((term_width - ent_max_len) / col_ext) + 1;
/* Print the entries */
for (int i = 0; i < numents;) {
/* Columns */
print_entry(ents_array[i++], ent_max_len);
for (int j = 0; (i < numents) && (j < (cols-1)); j++) {
printf(" ");
print_entry(ents_array[i++], ent_max_len);
}
printf("\n");
}
}
}
开发者ID:yadavcloud,项目名称:ponyos,代码行数:35,代码来源:ls.c
示例2: main
int main(int argc, char **argv)
{
int i;
if (!al_init()) {
abort_example("Could not init Allegro.\n");
}
open_log_monospace();
log_printf("%-36s %-6s %8s %8s %8s %8s\n",
"name", "flags", "ctime", "mtime", "atime", "size");
log_printf(
"------------------------------------ "
"------ "
"-------- "
"-------- "
"-------- "
"--------\n");
if (argc == 1) {
ALLEGRO_FS_ENTRY *entry = al_create_fs_entry("data");
print_entry(entry);
al_destroy_fs_entry(entry);
}
for (i = 1; i < argc; i++) {
ALLEGRO_FS_ENTRY *entry = al_create_fs_entry(argv[i]);
print_entry(entry);
al_destroy_fs_entry(entry);
}
close_log(true);
return 0;
}
开发者ID:gitustc,项目名称:d2imdev,代码行数:34,代码来源:ex_dir.c
示例3: show_prefixes6
void show_prefixes6(int count,struct prefix *prefix,BGPDATA BGP,BGPDUMP_ENTRY *entry,std::ofstream &outFile)
{
int i;
char buf[128];
return;
for (i=0;i<count;i++) {
char cidr[128];
int arv = 0;
int srv = 0;
sprintf(cidr,"%s/%d",inet_ntop(AF_INET6,&prefix[i].address.v6_addr,buf,128),prefix[i].len);
if (entry->attr->aspath != NULL && !BGP.asnfile.empty()) {
arv = ValidatePath(entry->attr->aspath->str,BGP);
}
else if (entry->attr->aspath != NULL) {
arv = 1;
}
if (!BGP.setfile.empty()) {
srv = ValidateSet(cidr,BGP);
}
else {
srv = 1;
}
if (BGP.or_flag) {
if (arv != 0 || srv != 0)
print_entry(cidr,entry,outFile);
}
else if (srv != 0 && arv != 0) {
print_entry(cidr,entry,outFile);
}
}
}
开发者ID:qzm1218,项目名称:bgpuma,代码行数:31,代码来源:readfile.cpp
示例4: print_user
static void
print_user(CA_DB * db, BIO * bio, int userindex, int verbose)
{
if (verbose > 0) {
char **pp = sk_OPENSSL_PSTRING_value(db->db->data, userindex);
if (pp[DB_srptype][0] != 'I') {
print_entry(db, bio, userindex, verbose, "User entry");
print_entry(db, bio, get_index(db, pp[DB_srpgN], 'I'), verbose, "g N entry");
}
}
}
开发者ID:jeremyandrews,项目名称:libressl,代码行数:12,代码来源:srp.c
示例5: main
int main(int argc, char *argv[]) {
char needle[20];
struct Entry *result;
int action, i = 0;
if (argc < 2) {
fprintf(stderr, "Path to database omitted!\n");
exit(-1);
}
struct List entries = parse_db(argv[1]); /* parse database */
/* ask for criterium */
printf("What do you want to do?:\n1) sort by name\n2) sort by residents\n3) sort by area\n4) sort by distance\n5) search for entry\nYour choice: ");
scanf("%d", &action);
switch(action) {
case 1:
quicksort(entries.start, entries.end, cmp_name);
break;
case 2:
quicksort(entries.start, entries.end, cmp_residents);
break;
case 3:
quicksort(entries.start, entries.end, cmp_area);
break;
/*case 4:
quicksort(entries.start, entries.end, cmp_distance);
break;*/
case 5:
printf("what are you searching: ");
scanf("%s", needle);
result = lsearch(needle, entries.start, entries.end);
print_entry(result);
default:
fprintf(stderr, "Invalid sort criteria!\n");
}
/* show result */
if (action != 5) {
struct Node *node;
for (node = entries.start; node != entries.end && i++ < 100; node = node->next) {
print_entry(node->data);
}
}
return 0;
}
开发者ID:stv0g,项目名称:rwth-info1,代码行数:50,代码来源:open-geodb.c
示例6: dircb
/* directory callback */
static int dircb(wagon_t * id_list, attr_set_t * attr_list,
unsigned int entry_count, void * dummy )
{
/* retrieve child entries for all directories */
int i, rc;
for (i = 0; i < entry_count; i++)
{
wagon_t * chids = NULL;
attr_set_t * chattrs = NULL;
unsigned int chcount = 0;
int j;
/* match condition on dirs parent */
if (!is_expr || (EntryMatches(&id_list[i].id, &attr_list[i],
&match_expr, NULL) == POLICY_MATCH))
{
/* don't display dirs if no_dir is specified */
if (! (prog_options.no_dir && ATTR_MASK_TEST(&attr_list[i], type)
&& !strcasecmp(ATTR(&attr_list[i], type), STR_TYPE_DIR)) )
print_entry(&id_list[i], &attr_list[i]);
}
if (!prog_options.dir_only)
{
rc = ListMgr_GetChild( &lmgr, &entry_filter, id_list+i, 1,
disp_mask | query_mask,
&chids, &chattrs, &chcount);
if (rc)
{
DisplayLog(LVL_MAJOR, FIND_TAG, "ListMgr_GetChild() failed with error %d", rc);
return rc;
}
for (j = 0; j < chcount; j++)
{
if (!is_expr || (EntryMatches(&chids[j].id, &chattrs[j],
&match_expr, NULL) == POLICY_MATCH))
print_entry(&chids[j], &chattrs[j]);
ListMgr_FreeAttrs(&chattrs[j]);
}
free_wagon(chids, 0, chcount);
MemFree(chids);
MemFree(chattrs);
}
}
return 0;
}
开发者ID:barzoj,项目名称:robinhood,代码行数:51,代码来源:rbh_find.c
示例7: ug_option_entry_print_help
void ug_option_entry_print_help (UgOptionEntry* entry,
const char* prog_name,
const char* parameter_string,
const char* summary_string)
{
UgBuffer buffer;
ug_buffer_init (&buffer, 4096);
buffer.more = buffer_more;
ug_buffer_write (&buffer, "\n" "Usage:\n ", -1);
ug_buffer_write (&buffer, prog_name, -1);
ug_buffer_write (&buffer, " [OPTION...] ", -1);
ug_buffer_write (&buffer, parameter_string, -1);
ug_buffer_write (&buffer, "\n\n", -1);
if (summary_string) {
ug_buffer_write (&buffer, summary_string, -1);
ug_buffer_write (&buffer, "\n\n", -1);
}
for (; entry->long_name; entry++)
print_entry (&buffer, entry, 28);
buffer_more (&buffer);
ug_buffer_write (&buffer, "\n\n", -1);
ug_buffer_clear (&buffer, TRUE);
}
开发者ID:erdincay,项目名称:uget2,代码行数:28,代码来源:UgOption.c
示例8: main
int main(void)
{
l4_kernel_info_t *kip = l4re_kip();
struct l4_vhw_descriptor *vhw;
int i;
if (!kip)
{
printf("KIP not available!\n");
return 1;
}
if (!l4util_kip_kernel_is_ux(kip))
{
printf("This example is for Fiasco-UX only.\n");
return 1;
}
vhw = l4_vhw_get(kip);
printf("kip at %p, vhw at %p\n", kip, vhw);
printf("magic: %08x, version: %08x, count: %02d\n",
vhw->magic, vhw->version, vhw->count);
for (i = 0; i < vhw->count; i++)
print_entry(l4_vhw_get_entry(vhw, i));
return 0;
}
开发者ID:michas2,项目名称:l4re-snapshot,代码行数:29,代码来源:main.c
示例9: local_print
static int local_print(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
unsigned spec, const char *ptr, uint64_t bitmap2)
{
struct vlog_priv_t *vlog = priv;
int type;
(void) bitmap2;
type = (spec & VSL_S_CLIENT) ? 'c' :
(spec & VSL_S_BACKEND) ? 'b' : '-';
if (tag == SLT_Debug) {
if (vlog->entries > 0)
VSB_printf(vlog->answer,",");
VSB_printf(vlog->answer, "\n{ \"fd\": \"%d\","
"\"tag\": \"%s\", \"type\":\"%c\","
"\"value\":\"",
fd, VSL_tags[tag], type);
while (len-- > 0) {
if (*ptr >= ' ' && *ptr <= '~')
VSB_printf(vlog->answer, "%c", *ptr);
else
VSB_printf(vlog->answer, "%%%02x", (unsigned char)*ptr);
ptr++;
}
VSB_printf(vlog->answer,"\"}");
return (0);
}
print_entry(vlog,fd,tag, type, ptr, len);
return (0);
}
开发者ID:cleberjsantos,项目名称:vagent2,代码行数:31,代码来源:vlog.c
示例10: print_dir
void
print_dir(const char *file)
{
struct stat st;
lstat(file, &st);
if (S_ISDIR(st.st_mode)) {
if (progopt.many) {
if (progopt.many == 2) printf("\n");
printf("%s:\n", file);
progopt.many = 2;
}
DIR *dir = opendir(file);
if (!dir) {
error("cannot open directory %s", file);
exit(-1);
}
struct dirent *dent;
while ( (dent = readdir(dir)) ) {
char path[256];
struct stat st2;
snprintf(path, sizeof(path), "%s/%s", file, dent->d_name);
if (stat(path, &st2)) {
error("cannot stat(2) path %s", path);
exit(-1);
}
print_entry(dent->d_name, &st2);
}
closedir(dir);
}
}
开发者ID:akat1,项目名称:impala,代码行数:30,代码来源:ls.c
示例11: main
int
main (int argc, char *argv[])
{
int type;
void *data;
int num_nums = argc - 1;
int i;
long nums [num_nums];
for (i = 0; i < num_nums; ++i)
nums [i] = strtoul (argv [i + 1], NULL, 16);
while ((type = read_entry (stdin, &data)) != SGEN_PROTOCOL_EOF) {
gboolean match = FALSE;
for (i = 0; i < num_nums; ++i) {
if (is_match ((gpointer) nums [i], type, data)) {
match = TRUE;
break;
}
}
if (match)
print_entry (type, data);
free (data);
}
return 0;
}
开发者ID:Lavesson,项目名称:mono,代码行数:27,代码来源:sgen-grep-binprot.c
示例12: do_list_entries
//TODO:print interface name
int do_list_entries(struct iptargs *ipt)
{
struct iptc_handle *handle;
handle = iptc_init(ipt->table);
const char *this;
for (this=iptc_first_chain(handle); this; this=iptc_next_chain(handle)) {
const struct ipt_entry *i;
unsigned int num;
if (ipt->chain && strcmp(ipt->chain, this) != 0)
continue;
print_header(this, handle);
i = iptc_first_rule(this, handle);
num = 0;
while (i) {
num++;
printf("%d\t | ", num);
print_entry(this, i, handle);
i = iptc_next_rule(i, handle);
}
}
iptc_free(handle);
return 0;
}
开发者ID:sorindumitru,项目名称:lkl-net,代码行数:29,代码来源:ipt_common.c
示例13: h_order
static int
h_order(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
unsigned spec, const char *ptr, uint64_t bm)
{
char type;
struct vlog_priv_t *vlog = priv;
/* XXX: Just ignore any fd not inside the bitmap */
if (fd >= sizeof vlog->bitmap / sizeof vlog->bitmap[0])
return (0);
vlog->bitmap[fd] |= bm;
type = (spec & VSL_S_CLIENT) ? 'c' :
(spec & VSL_S_BACKEND) ? 'b' : '-';
if (!(spec & (VSL_S_CLIENT|VSL_S_BACKEND))) {
(void)local_print(vlog, tag, fd, len, spec, ptr, bm);
return (0);
}
if (vlog->ob[fd] == NULL) {
vlog->ob[fd] = VSB_new_auto();
assert(vlog->ob[fd] != NULL);
}
if ((tag == SLT_BackendOpen || tag == SLT_SessionOpen ||
(tag == SLT_ReqStart &&
vlog->last[fd] != SLT_SessionOpen &&
vlog->last[fd] != SLT_VCL_acl) ||
(tag == SLT_BackendXID &&
vlog->last[fd] != SLT_BackendOpen)) &&
VSB_len(vlog->ob[fd]) != 0) {
/*
* This is the start of a new request, yet we haven't seen
* the end of the previous one. Spit it out anyway before
* starting on the new one.
*/
if (vlog->last[fd] != SLT_SessionClose)
VSB_printf(vlog->ob[fd], "{ \"fd\": \"%d\","
"\"tag\": \"%s\", \"type\":\"%c\","
"\"value\":\"%s\"},\n",
fd, "Interrupted", type, VSL_tags[tag]);
h_order_finish(vlog, fd);
}
vlog->last[fd] = tag;
print_entry(vlog, fd, tag, type, ptr, len);
switch (tag) {
case SLT_ReqEnd:
case SLT_BackendClose:
case SLT_BackendReuse:
case SLT_StatSess:
h_order_finish(vlog, fd);
break;
default:
break;
}
return (0);
}
开发者ID:cleberjsantos,项目名称:vagent2,代码行数:59,代码来源:vlog.c
示例14: dumptree_inner
/* For debugging */
static void
dumptree_inner(const struct hs_base *h,
char *(* keyprint)(const void *),
const char *descr, int printdetails)
{
unsigned long ix = 0;
unsigned long tsize = h->tablesize_;
struct ts_entry *p = &h->hashtab_[0];
unsigned long hashused = 0;
unsigned long maxchainlength = 0;
unsigned long chainsgt1 = 0;
printf("dumptree head ptr : 0x%08x size %lu entries %lu allowed %lu %s\n",
(unsigned)h,
h->tablesize_,
h->record_count_,
h->allowed_fill_,
descr);
for( ; ix < tsize; ix++,p++) {
unsigned long chainlength = 0;
struct ts_entry*n = 0;
int chainpos = 0;
if(p->entryused) {
++hashused;
chainlength = 1;
if(printdetails) {
print_entry(p,"head",keyprint,ix,chainpos);
}
}
chainpos++;
for(n = p->next; n ; n = n->next) {
chainlength++;
if(printdetails) {
print_entry(n,"chain",keyprint,ix,chainpos);
}
}
if(chainlength > maxchainlength) {
maxchainlength = chainlength;
}
if (chainlength > 1) {
chainsgt1++;
}
}
printf("Hashtable: %lu of %lu hash entries used.\n",hashused,tsize);
printf("Hashtable: %lu chains length longer than 1. \n",chainsgt1);
printf("Hashtable: %lu is maximum chain length.\n",maxchainlength);
}
开发者ID:xGreat,项目名称:drmingw,代码行数:47,代码来源:dwarf_tsearchhash.c
示例15: print_entries
static void
print_entries (FILE *stream, WispObject *list, int long_p)
{
while (list != NIL)
{
print_entry (stream, CAR (list), long_p);
if (long_p) fprintf (stream, "\n");
list = CDR (list);
}
}
开发者ID:AOSC-Dev,项目名称:metahtml,代码行数:10,代码来源:birthday.c
示例16: print_flowtable
/*----------------------------------------------------------------------------*/
void
print_flowtable(void)
{
entry_t *e;
for(e = list_head(flowtable); e != NULL; e = e->next) {
PRINTF("[FLT]: ");
print_entry(e);
PRINTF("\n");
}
}
开发者ID:suxiongye,项目名称:sdn-wise-contiki,代码行数:11,代码来源:flowtable.c
示例17: lck
void LoadedLibraries::print(outputStream* os) {
MiscUtils::AutoCritSect lck(&g_cs);
if (!g_first) {
reload_table();
}
for (entry_t* e = g_first; e; e = e->next) {
print_entry(e, os);
os->cr();
}
}
开发者ID:gaoxiaojun,项目名称:dync,代码行数:10,代码来源:loadlib_aix.cpp
示例18: main
int
main()
{
int i = 0;
printf("/* dwarfdump_ctype table */\n");
printf("char dwarfdump_ctype_table[256] = { \n");
for ( i = 0 ; i <= 255; ++i) {
print_entry(i);
}
printf("};\n");
}
开发者ID:tomhughes,项目名称:libdwarf,代码行数:11,代码来源:uritablebuild.c
示例19: save
static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
{
const struct ipt_policy_info *info = (void *)match->data;
unsigned int i;
print_flags("--", info);
for (i = 0; i < info->len; i++) {
print_entry("--", &info->pol[i], 0);
if (i + 1 < info->len)
printf("--next ");
}
}
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:12,代码来源:libipt_policy.c
示例20: policy6_save
static void policy6_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_policy_info *info = (void *)match->data;
unsigned int i;
print_flags("--", info);
for (i = 0; i < info->len; i++) {
print_entry("--", &info->pol[i], false, NFPROTO_IPV6);
if (i + 1 < info->len)
printf("--next ");
}
}
开发者ID:Einheri,项目名称:wl500g,代码行数:12,代码来源:libipt_policy.c
注:本文中的print_entry函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论