当前位置: 首页>>代码示例>>C++>>正文


C++ print_name函数代码示例

本文整理汇总了C++中print_name函数的典型用法代码示例。如果您正苦于以下问题:C++ print_name函数的具体用法?C++ print_name怎么用?C++ print_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了print_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: print_name

	void symboltable::print(std::ostream& s) const
	{
		for(sid i = 0; i < index.size(); i++)
		{
			print_name(i, s << i << ": ");
			s << std::endl;
		}
	}
开发者ID:Wassasin,项目名称:splicpp,代码行数:8,代码来源:symboltable.cpp

示例2: main

int main(int argc, char *argv[]) 
{
	printf("Hello, World!\n");
	printf("Git is fun!\n");

	print_name("edwin");
	return 0;
}
开发者ID:edpanameno,项目名称:learning-git,代码行数:8,代码来源:hello.c

示例3: print_long

void
print_long(OBJ *obj)
{
	struct stat *st;
	FTSENT      *p;
	char        mode[MODE_BUFF_SIZE];

	p = obj->obj_list;

	if(!obj->obj_isroot)
		print_total(obj->obj_size_total);

	while (p != NULL) {
		if (p->fts_number == FTS_NO_PRINT) {
			p = p->fts_link;
			continue;
		}

		st = p->fts_statp;

		/* print inode */
		if (f_ino)
			printf("%*"PRIuMAX" ", obj->obj_ino_max,
				(uintmax_t)st->st_ino);

		/* print number of blocks */
		if (f_block) {	
			print_block((int64_t)st->st_blocks * DEFAULT_BSIZE, 
				    obj->obj_block_max);
		}
		
		/* print mode */
		strmode(st->st_mode, mode);
		printf("%11s ", mode);

		/* print number of links */
		printf("%*"PRIuMAX" ", obj->obj_link_max, 
			(uintmax_t)st->st_nlink);

		/* print owner and group */
		print_user_and_group(st->st_uid, st->st_gid, 
				      obj->obj_user_max, obj->obj_group_max);

		/* print size */
		if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
			print_device(st->st_rdev, obj->obj_major_max,
					obj->obj_minor_max);
		else
			print_size(st->st_size, obj->obj_size_max);

		print_date(st);
		print_name(p, WITH_LINK);

		putchar('\n');

		p = p->fts_link;
	}
}
开发者ID:chenggongtc,项目名称:myls,代码行数:58,代码来源:print.c

示例4: traite_ligne

void traite_ligne(char *ch, int if_cntx)
{
static char *lvide="  ";
char *word,*tagg;
int nb,i,j;

if (ch)
 {
 word=strtok(ch," \t\n");
 if (word) tagg=strtok(NULL," \t\n"); else tagg=NULL;
 if ((!word)||(!tagg)) { fprintf(stderr,"ERROR: bad format in input file line %d\n",nb+1); exit(0); }
 if (strlen(word)>=TailleMot) word[TailleMot-2]='\0';
 if (strlen(tagg)>=TailleMot) tagg[TailleMot-2]='\0';
 }
else tagg=word=lvide;

for(i=1;i<WindowSize;i++)
 {
 strcpy(T_word[i-1],T_word[i]);
 strcpy(T_tagg[i-1],T_tagg[i]);
 T_flag[i-1]=T_flag[i];
 }
strcpy(T_word[WindowSize-1],word);
strcpy(T_tagg[WindowSize-1],tagg);
T_flag[WindowSize-1]=0;

if (T_flag[ContextSize]==0)
 {
 if ((find_name(&j))&&((j>ContextSize+1)||(strlen(T_word[ContextSize])>1)))
  {
  if (if_cntx)
   {
   for (i=0;i<ContextSize;i++) { if (i>0) printf(" "); printf("%s",T_word[i]); }
   printf(" # "); print_name(j);
   for (i=1;i<ContextSize;i++) { if (i>1) printf(" "); printf("%s",T_word[i]); }
   printf(" # "); print_name(j);
   for (i=2;i<ContextSize;i++) { if (i>2) printf(" "); printf("%s",T_word[i]); }
   printf(" # "); print_name(j);
   for (i=3;i<ContextSize;i++) { if (i>3) printf(" "); printf("%s",T_word[i]); }
   printf(" # "); print_name(j);
   }
  else print_name(j);
  }
 }
}
开发者ID:alicecaron,项目名称:paf,代码行数:45,代码来源:extract_name.c

示例5: print_string_and_value

static void print_string_and_value(char *name,const char *str,
				   unsigned char value)
    {
    print_name(name);

    printf("%s", str);
    printf(" (0x%x)", value);
    printf("\n");
    }
开发者ID:MrKID,项目名称:RetroShare,代码行数:9,代码来源:packet-print.c

示例6: tail_object_deleted

static void tail_object_deleted(confdb_handle_t handle,
	hdb_handle_t parent_object_handle,
	const void *name_pt,
	size_t name_len)
{
	fputs("object_deleted>", stdout);
	print_name(stdout, name_pt, name_len);
	fputs("\n", stdout);
}
开发者ID:emrehe,项目名称:corosync,代码行数:9,代码来源:corosync-objctl.c

示例7: visit

  // for LIR
  virtual void visit(LIR_OpVisitState* visit) {
#ifndef PRODUCT
    if (LIRTracePeephole && Verbose) {
      tty->print("no visitor for ");
      print_name(tty);
      tty->cr();
    }
#endif
  }
开发者ID:nikezheng,项目名称:lookaside_java-1.8.0-openjdk,代码行数:10,代码来源:c1_CodeStubs.hpp

示例8: archive_name

/*
 * Open a device.
 */
void DEVICE::open_device(DCR *dcr, int omode)
{
   POOL_MEM archive_name(PM_FNAME);

   get_autochanger_loaded_slot(dcr);

   /*
    * Handle opening of File Archive (not a tape)
    */
   pm_strcpy(archive_name, dev_name);

   /*
    * If this is a virtual autochanger (i.e. changer_res != NULL) we simply use
    * the device name, assuming it has been appropriately setup by the "autochanger".
    */
   if (!device->changer_res || device->changer_command[0] == 0) {
      if (VolCatInfo.VolCatName[0] == 0) {
         Mmsg(errmsg, _("Could not open file device %s. No Volume name given.\n"),
            print_name());
         clear_opened();
         return;
      }

      if (!IsPathSeparator(archive_name.c_str()[strlen(archive_name.c_str())-1])) {
         pm_strcat(archive_name, "/");
      }
      pm_strcat(archive_name, getVolCatName());
   }

   mount(dcr, 1);                     /* do mount if required */

   open_mode = omode;
   set_mode(omode);

   /*
    * If creating file, give 0640 permissions
    */
   Dmsg3(100, "open disk: mode=%s open(%s, 0x%x, 0640)\n", mode_to_str(omode),
         archive_name.c_str(), oflags);

   if ((m_fd = d_open(archive_name.c_str(), oflags, 0640)) < 0) {
      berrno be;
      dev_errno = errno;
      Mmsg2(errmsg, _("Could not open: %s, ERR=%s\n"), archive_name.c_str(),
            be.bstrerror());
      Dmsg1(100, "open failed: %s", errmsg);
   }

   if (m_fd >= 0) {
      dev_errno = 0;
      file = 0;
      file_addr = 0;
   }

   Dmsg1(100, "open dev: disk fd=%d opened\n", m_fd);
}
开发者ID:dl5rcw,项目名称:bareos,代码行数:59,代码来源:dev.c

示例9: do_find

static void
do_find(isc_boolean_t want_event) {
	isc_result_t result;
	isc_boolean_t done = ISC_FALSE;
	unsigned int options;

	options = DNS_ADBFIND_INET | DNS_ADBFIND_INET6;
	if (want_event)
		options |= DNS_ADBFIND_WANTEVENT | DNS_ADBFIND_EMPTYEVENT;
	dns_fixedname_init(&target);
	result = dns_adb_createfind(view->adb, task, adb_callback, NULL,
				    dns_fixedname_name(&fixed),
				    dns_rootname, 0, options, 0,
				    dns_fixedname_name(&target), 0,
				    &find);
	if (result == ISC_R_SUCCESS) {
		if (!ISC_LIST_EMPTY(find->list)) {
			/*
			 * We have at least some of the addresses for the
			 * name.
			 */
			INSIST((find->options & DNS_ADBFIND_WANTEVENT) == 0);
			print_addresses(find);
			done = ISC_TRUE;
		} else {
			/*
			 * We don't know any of the addresses for this
			 * name.
			 */
			if ((find->options & DNS_ADBFIND_WANTEVENT) == 0) {
				/*
				 * And ADB isn't going to send us any events
				 * either.  This query loses.
				 */
				done = ISC_TRUE;
			}
			/*
			 * If the DNS_ADBFIND_WANTEVENT flag was set, we'll
			 * get an event when something happens.
			 */
		}
	} else if (result == DNS_R_ALIAS) {
		print_name(dns_fixedname_name(&target));
		done = ISC_TRUE;
	} else {
		printf("dns_adb_createfind() returned %s\n",
		       isc_result_totext(result));
		done = ISC_TRUE;
	}

	if (done) {
		if (find != NULL)
			dns_adb_destroyfind(&find);
		isc_app_shutdown();
	}
}
开发者ID:each,项目名称:bind9-collab,代码行数:56,代码来源:byname_test.c

示例10: print_hexdump

static void print_hexdump(const char *name,
			  const unsigned char *data,
			  unsigned int len)
    {
    print_name(name);

    printf("len=%d, data=0x", len);
    print_hex(data,len);
    printf("\n");
    }
开发者ID:MrKID,项目名称:RetroShare,代码行数:10,代码来源:packet-print.c

示例11: print_hexdump_data

static void print_hexdump_data(const char *name,
			       const unsigned char *data,
			       unsigned int len)
    {
    print_name(name);

    printf("0x");
    print_hex(data,len);
    printf("\n");
    }
开发者ID:MrKID,项目名称:RetroShare,代码行数:10,代码来源:packet-print.c

示例12: tail_key_changed

static void tail_key_changed(confdb_handle_t handle,
	confdb_change_type_t change_type,
	hdb_handle_t parent_object_handle,
	hdb_handle_t object_handle,
	const void *object_name_pt,
	size_t  object_name_len,
	const void *key_name_pt,
	size_t key_name_len,
	const void *key_value_pt,
	size_t key_value_len)
{
	/* printf("key_changed> %.*s.%.*s=%.*s\n", */
	fputs("key_changed> ", stdout);
	print_name (stdout, object_name_pt, object_name_len);
	fputs(".", stdout);
	print_name (stdout, key_name_pt, key_name_len);
	fputs("=", stdout);
	print_name (stdout, key_value_pt, key_value_len);
	fputs("\n", stdout);
}
开发者ID:emrehe,项目名称:corosync,代码行数:20,代码来源:corosync-objctl.c

示例13: Mmsg1

/*
 * Position device to end of medium (end of data)
 *
 * Returns: true  on succes
 *          false on error
 */
bool DEVICE::eod(DCR *dcr)
{
   boffset_t pos;

   if (m_fd < 0) {
      dev_errno = EBADF;
      Mmsg1(errmsg, _("Bad call to eod. Device %s not open\n"), print_name());
      return false;
   }

   if (is_vtl()) {
      return true;
   }

   Dmsg0(100, "Enter eod\n");
   if (at_eot()) {
      return true;
   }

   clear_eof();         /* remove EOF flag */

   block_num = file = 0;
   file_size = 0;
   file_addr = 0;

   pos = lseek(dcr, (boffset_t)0, SEEK_END);
   Dmsg1(200, "====== Seek to %lld\n", pos);

   if (pos >= 0) {
      update_pos(dcr);
      set_eot();
      return true;
   }

   dev_errno = errno;
   berrno be;
   Mmsg2(errmsg, _("lseek error on %s. ERR=%s.\n"), print_name(), be.bstrerror());
   Dmsg0(100, errmsg);

   return false;
}
开发者ID:dl5rcw,项目名称:bareos,代码行数:47,代码来源:dev.c

示例14: Dmsg3

/* Rewind file device */
bool DEVICE::rewind(DCR *dcr)
{
   Dmsg3(400, "rewind res=%d fd=%d %s\n", num_reserved(), m_fd, print_name());
   state &= ~(ST_EOT|ST_EOF|ST_WEOT);  /* remove EOF/EOT flags */
   block_num = file = 0;
   file_size = 0;
   file_addr = 0;
   if (m_fd < 0) {
      return false;
   }
   if (is_file()) {
      if (lseek(dcr, (boffset_t)0, SEEK_SET) < 0) {
         berrno be;
         dev_errno = errno;
         Mmsg2(errmsg, _("lseek error on %s. ERR=%s.\n"),
            print_name(), be.bstrerror());
         return false;
      }
   }
   return true;
}
开发者ID:rkorzeniewski,项目名称:bacula,代码行数:22,代码来源:file_dev.c

示例15: main

int main()
{
    clear_screen();
    print_name();

    // Loading Kernel OK
    printloc("Loading kernel...", 8, 2, RED);
    printloc("[OK]", 8, 30, GREEN);
    printloc("Building the world...", 9, 2, RED);
    printloc("[OK]", 9, 30, GREEN);

    printloc("You can now doing nothing :)", 11, 2, CYAN);
}
开发者ID:Peekmo,项目名称:nasm,代码行数:13,代码来源:kernel.c


注:本文中的print_name函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。