• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ catgets函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: huffman_code

/* determines correct huffman code based on current counts in tree,
 * writes out all to both files overlaying previous values if they existed.
 */
static void     huffman_code (time_t idstamp)
{
    int             i;	/* current char */
    int             lasti;
    int             j;	/* ascends tree from i to build bit_string */
    char            bit_string[MAX_BITLEN + 4];
    char            sprintbuf[128];
    char           *bitptr;
    FILE           *outstream_huc;
    FILE           *outstream_huf;

    /* establish the 'literal' node (char #256) count
     * equal to sum of all chars whose counts are less than threshold.
     */
    if (literal_coding_on) {
	hctree1[256].count = 0L;
	for (i = 0; i < 256; i++)
	    if (hctree1[i].count <= literal_threshold)
		hctree1[256].count += hctree1[i].count;
    }

    /* build the Huffman Code tree, and determine root (last_node) */
    while (build_tree ());

    /* now that we know the total number of tree nodes (last_node),
     * we are ready to write.  
     * Open both output files and verify they are not write protected.
     */
    if ((outstream_huc = fopen (filename_huc, "w")) == NULL) {
	fprintf (stderr, catgets(dtsearch_catd, MS_huff, 34,
	    "424 File '%s' failed to open for write.  Is it read-only?\n"),
	    filename_huc);
	exit (2);
    }
    if ((outstream_huf = fopen (filename_huf, "w")) == NULL) {
	fprintf (stderr, catgets(dtsearch_catd, MS_huff, 34,
	    "439 File '%s' failed to open for write.  Is it read-only?\n"),
	    filename_huf);
	exit (2);
    }

    /* create the .c decode file (tree as integer array) */
    fprintf (outstream_huc,
	"#include <time.h>\n"
	"char   *hctree_name =\t\"%s\";\n"
	"time_t hctree_id =\t%ldL;\n"
	"int    hctree_root =\t%d;\n"
	"static int hctree_array[] = {\n",
	filename_huc, idstamp, last_node - 257);
    for (i = 257; i <= last_node; i++) {
	fprintf (outstream_huc, "\t%4d,\t%4d%c\t/* %3d */\n",
	    hctree1[i].son0 - 257, hctree1[i].son1 - 257,
	    (i == last_node) ? ' ' : ',',	/* no comma after last
						 * one */
	    i - 257);	/* comment contains node number */
    }
    fprintf (outstream_huc, "\t};\nint *hctree =\thctree_array;\n");
    fclose (outstream_huc);

    /* write out the tree base (0-256) in sorted order to .huf file */
    fprintf (outstream_huf, "%ld\tHCTREE_ID\n", idstamp);
    for (lasti = -1; (i = next_sorted_node (lasti)) >= 0; lasti = i) {
	/*
	 * Create huffman code digit string. j ascends tree from i
	 * to build string in reverse order. 
	 */
	bitptr = bit_string;
	for (j = i; j != -1; j = hctree1[j].father)
	    *bitptr++ = hctree1[j].bit;
	*bitptr = '\0';	/* terminate reversed string */
	strrev (bit_string);	/* reverse the string order */
	if (bit_string[1] == 0)
	    strcpy (bit_string, "  ");
	if (strlen (bit_string) < 9)
	    strcat (bit_string, "\t");

	/* write out the line for this char */
	sprintf (sprintbuf, "%d\t%s\t%ld\t%s\n",
	    i,
	    bit_string + 1,	/* hop over LAST_BIT */
	    hctree1[i].count,
	    char_label (i));
	fprintf (outstream_huf, "%s", sprintbuf);

    }	/* end forloop printing out each tree base entry */

    fclose (outstream_huf);
    return;
}  /* end of function huffman_code */
开发者ID:juddy,项目名称:edcde,代码行数:92,代码来源:huffcode.c


示例2: read_in_file

static void read_in_file(FILE *fd, const char *filename, int show_user_filename)
{
	/** Open the specified file and stream it in to the already opened
	    file descriptor given to us.  When we're done output the number
	    of lines and characters we added, if any... **/

	FILE *myfd;
	char exp_fname[SLEN], buffer[SLEN];
	int n;
	int lines = 0, nchars = 0;

	while (whitespace(*filename))
		++filename;

	/** expand any shell variables or leading '~' **/
	(void) expand_env(exp_fname, filename, sizeof(exp_fname));

	if (exp_fname[0] == '\0') {
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmNoFilenameSpecified,
	      "\n\r(No filename specified for file read! Continue.)\n\r"));
	  return;
	}

	if ((myfd = fopen(exp_fname,"r")) == NULL) {
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmCouldntReadFile,
	    "\n\r(Couldn't read file '%s'! Continue.)\n\r"), exp_fname);
	  return;
	}

	while ((n = mail_gets(buffer, SLEN, myfd))) {
	  if (buffer[n-1] == '\n')
		  lines++;
	  nchars += n;
  	  fwrite(buffer, 1, n, fd);
	}
	fflush(fd);

	fclose(myfd);

	if (lines == 1)
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmAddedLine,
	    "\n\r(Added 1 line ["));
	else
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmAddedLinePlural,
	    "\n\r(Added %d lines ["), lines);

	if (nchars == 1)
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmAddedChar,
	    "1 char] "));
	else
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmAddedCharPlural,
	    "%d chars] "), nchars);

	if (show_user_filename)
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmAddedFromFile,
		"from file %s. Continue.)\n\r"), exp_fname);
	else
	  PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmAddedToMessage,
		"to message. Continue.)\n\r"));

	return;
}
开发者ID:wfp5p,项目名称:elm,代码行数:62,代码来源:editmsg.c


示例3: builtin_editor

/*
 * The editor used by edit_message() when "builtin" or "none" are selected.
 * Return 0 if successful, -1 on error.
 */
static int builtin_editor(const char *filename, SEND_HEADER *shdr)
{
    char linebuf[SLEN];		/* line input buffer			*/
    char wrapbuf[SLEN];		/* wrapped line overflow buffer		*/
    char tmpbuf[SLEN];		/* scratch buffer			*/
    FILE *fp;			/* output stream to "filename"		*/
    int rc;			/* return code from this procedure	*/
    int is_wrapped;		/* wrapped line flag			*/
    int err;			/* temp holder for errno		*/
    SIGHAND_TYPE (*oldint)();	/* previous value of SIGINT		*/
    SIGHAND_TYPE (*oldquit)();	/* previous value of SIGQUIT		*/
    SIGHAND_TYPE builtin_interrupt_handler();

    /* the built-in editor is not re-entrant! */
    assert(!builtin_active);

    /* initialize return code to failure */
    rc = -1;

    if ((fp = fopen(filename, "r+")) == NULL) {
	err = errno;
	sprintf(tmpbuf, catgets(elm_msg_cat, ElmSet, ElmCouldntOpenAppend,
	    "Couldn't open %s for update [%s]."),
	    filename, strerror(err));
	PutLine(-1, -1, tmpbuf);
	dprint(1, (debugfile,
	    "Error encountered trying to open file %s;\n", filename));
	dprint(1, (debugfile, "** %s **\n", strerror(err)));
	return rc;
    }

    /* skip past any existing text */
    fseek(fp, 0, SEEK_END);

    /* prompt user, depending upon whether file already has text */
    if (fsize(fp) > 0L)
	strcpy(tmpbuf, catgets(elm_msg_cat, ElmSet, ElmContinueEntering,
	    "\n\rContinue entering message."));
    else
	strcpy(tmpbuf, catgets(elm_msg_cat, ElmSet, ElmEnterMessage,
	    "\n\rEnter message."));
    strcat(tmpbuf, catgets(elm_msg_cat, ElmSet, ElmTypeElmCommands,
	"  Type Elm commands on lines by themselves.\n\r"));
    sprintf(tmpbuf+strlen(tmpbuf),
	catgets(elm_msg_cat, ElmSet, ElmCommandsInclude,
	"Commands include:  ^D or '.' to end, %cp to list, %c? for help.\n\r\n\r"),
	escape_char, escape_char);
    CleartoEOS();
    PutLine(-1, -1, tmpbuf);

    builtin_active = TRUE;
    builtin_interrupt_count = 0;

    oldint  = signal(SIGINT,  builtin_interrupt_handler);
    oldquit = signal(SIGQUIT, builtin_interrupt_handler);

    /* return location for interrupts */
    while (SETJMP(builtin_jmpbuf) != 0) {
	if (builtin_interrupt_count == 1) {
	    PutLine(-1, -1, catgets(elm_msg_cat, ElmSet,
		ElmEditmsgOneMoreCancel,
		"(Interrupt. One more to cancel this letter.)\n\r"));
	} else {
	    PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmEditmsgCancelled,
		"(Interrupt. Letter canceled.)\n\r"));
	    goto done;
	}
    }

    for (;;) {

	/* re-open file if it was closed out on a call to an external editor */
	if (fp == NULL) {
	    if ((fp = fopen(filename, "a+")) == NULL) {
		err = errno;
		sprintf(tmpbuf, catgets(elm_msg_cat, ElmSet,
		    ElmCouldntOpenAppend,
		    "Couldn't open %s for update [%s]."),
		    filename, strerror(err));
		PutLine(-1, -1, tmpbuf);
		dprint(1, (debugfile,
		    "Error encountered trying to open file %s;\n", filename));
		dprint(1, (debugfile, "** %s **\n", strerror(err)));
		goto done;
	    }
	    PutLine(-1, -1, catgets(elm_msg_cat, ElmSet, ElmPostEdContinue,
		"(Continue entering message.  Type ^D or '.' on a line by itself to end.)\n\r"));
	}

	linebuf[0] = '\0';
	wrapbuf[0] = '\0';
	is_wrapped = 0;

more_wrap:
	if (wrapped_enter(linebuf, wrapbuf, -1, -1, fp, &is_wrapped) != 0)
	    break;
//.........这里部分代码省略.........
开发者ID:wfp5p,项目名称:elm,代码行数:101,代码来源:editmsg.c


示例4: main

int
main(
	int argc,	/* Number of arguments */
	char *argv[])	/* Argument pointer list */
{
	extern int optind;
	char *cwd;
	int c, i;
	int errors = 0;

	/*
	 * Process arguments.
	 */
	CustmsgInit(0, NULL);
	program_name = basename(argv[0]);
	while ((c = getopt(argc, argv, "c:df:Vv")) != EOF) {
		switch (c) {
		case 'c':
			i = atoi(optarg);
			if (i < 1 || i > 4) {
				errors++;
				fprintf(stderr,
				    "%s: -c %s: invalid copy number\n",
				    program_name, optarg);
			}
			CopyMask |= 1<<(i-1);
			break;

		case 'd':
			Damaged = TRUE;
			break;

		case 'f':
			o_fname = optarg;
			o_fname_specified = TRUE;
			break;

		case 'V':
		case 'v':
			Verbose = TRUE;
			break;

		case '?':
		default:
			errors++;
		}
	}

	if (optind == argc)  errors++;	/* No root_path */
	if (errors != 0) {
		fprintf(stderr, catgets(catfd, SET, 13001, "Usage: %s %s\n"),
		    program_name,
		    "[-c copy_number]... [-f audit_file] [-V] root_path");
		return (ES_Args);
	}


	if (CopyMask == 0) CopyMask = 0xf;
			/* If no -c,interested in all copies */

	if ((cwd = getcwd(NULL, sizeof (fullpath)-1)) == NULL) {
		error(1, errno, catgets(catfd, SET, 587, "Cannot get cwd"));
	}
	/*
	 * Open the audit output file.  Rule is:
	 *    If -f not specified, or "-f -" specified, then use stdout
	 *    else use filename from -f argument.
	 */
	if (o_fname_specified && strcmp(o_fname, "-") != 0) {
		uid_t uid = getuid();
		gid_t gid = getgid();

		if ((*o_fname != '/') && (cwd != NULL)) {
			strncpy(fullpath, cwd, sizeof (fullpath)-1);
			strncat(fullpath, "/", sizeof (fullpath)-1);
		} else  *fullpath = '\0';
		strncat(fullpath, o_fname, sizeof (fullpath)-1);
		if (NormalizePath(fullpath) == NULL) {
			error(ES_OutputFile, 0,
			    catgets(catfd, SET, 1423,
			    "Invalid output file path"));
		}
		if ((o_st = FOPEN(fullpath, "a")) == NULL) {
			error(ES_OutputFile, errno,
			    catgets(catfd, SET, 574,
			    "Cannot create %s"), fullpath);
		}
		if (chown(fullpath, uid, gid) < 0) {
			error(0, errno,
			    catgets(catfd, SET, 573,
			    "Cannot chown %s"), fullpath);
			exit_status = ES_OutputFile;
		}
	} else {
		o_st = stdout;
	}


	/*
	 * Check the path to audit.
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:101,代码来源:archive_audit.c


示例5: dodir

/*
 *	Descend through the directories, starting at "name".
 *	Call dofile() for each directory entry.
 *	Save each directory name, and process at the end.
 */
static void
dodir(char *name)
{
	size_t dn_mark, dn_next;
	char *prev_base;
	int seg_stat_err;
	int num_segs;

	strcpy(base_name, name);

	/*
	 * Change to the new directory.
	 * Extend the full path.
	 */
	if ((dir_fd = open(name, O_RDONLY)) == -1) {
		error(0, errno,
		    catgets(catfd, SET, 3088, "Cannot open directory %s"),
		    fullpath);
		if (exit_status < ES_Path) exit_status = ES_Path;
		return;
	}
	getdent_s.offset = 0;
	dir_buf_count = 0;
	if (chdir(name) == -1 && chdir(fullpath) == -1) {
		error(0, errno,
		    catgets(catfd, SET, 3038, "cannot chdir to %s"),
		    fullpath);
		(void) close(dir_fd);
		if (exit_status < ES_Path) exit_status = ES_Path;
		return;
	}
	prev_base = base_name;
	base_name += strlen(name);
	if (base_name[-1] != '/') {
		*base_name++ = '/';
	}
	*base_name = '\0';

	/*
	 * Mark the directory name stack.
	 */
	dn_mark = dn_next = dn_size;

	while (getdent() > 0) {
		/* ignore dot and dot-dot */
		if (strcmp((const char *) dir->d_name, ".") == 0 ||
		    strcmp((const char *) dir->d_name, "..") == 0)
			continue;

		/*
		 * check to assure that construction of the full path name does
		 * not exceed the limit before doing the idstat call
		 */

		if ((int)(strlen(fullpath) + dir->d_namlen + 1) > MAXPATHLEN) {
			error(0, errno,
			    catgets(catfd, SET, 268,
			    "%s: Pathname too long"), fullpath);
			if (exit_status < ES_File) exit_status = ES_File;
			continue;
		}

		strcpy(base_name, (const char *) dir->d_name);
		idstat.id = dir->d_id;
		seg_num = 0;

		if (ioctl(fs_fd, F_IDSTAT, &idstat) < 0) {
			error(0, errno,
			    catgets(catfd, SET, 1090,
			    "Ioctl call to stat %s (%d, %d) failed."),
			    fullpath, (int)idstat.id.ino, idstat.id.gen);
			if (exit_status < ES_IDstat) exit_status = ES_IDstat;
			continue;
		}
		if (S_ISREQ(inode.di.mode)) {
			/*
			 * Try to eliminate removable media files which don't
			 * actually represent space on tape.  These are those
			 * for the archiver and stager, and those created by
			 * users for disaster recovery.
			 * For newly created filesystems, those for the
			 * archiver and stager will have parent inode
			 * SAM_ARCH_INO (5) and SAM_STAGE_INO (7) respectively.
			 * For legacy file systems we don't have a clue.
			 * Those created by users for reading
			 * (disaster recovery) which haven't been referenced
			 * will have size of MAXOFFSET_T, so throw these out too
			 * (in CheckRmStatus() ).
			 */
			if ((inode.di.parent_id.ino != SAM_ARCH_INO) &&
			    (inode.di.parent_id.ino != SAM_STAGE_INO)) {
				CheckRmStatus();
			}
		} else {
			CheckArchiveStatus();
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:101,代码来源:archive_audit.c


示例6: get_blk_device

int				/* fd if successful, -1 if error */
get_blk_device(
	struct sam_fs_part *fsp,
	int oflags,
	int maxdevretry)
{
	int fd;
	int retrycnt = 0;
	struct dk_cinfo dkcinfo;
	struct vtoc vtoc;
	char *devrname;

	if (check_mnttab(fsp->pt_name)) {
		error(0, 0, catgets(catfd, SET, 13422, "device %s is mounted."),
		    fsp->pt_name);
		return (-1);
	}

	if ((devrname = getfullrawname(fsp->pt_name)) == NULL) {
		error(0, 0,
		    catgets(catfd, SET, 1606,
		    "malloc: %s"), "getfullrawname");
		return (-1);
	}
	if (*devrname == '\0') {
		error(0, errno, "%s", fsp->pt_name);
		error(0, 0,
		    catgets(catfd, SET, 1998,
		    "Raw device not found for eq (%d)"),
		    fsp->pt_eq);
		free(devrname);
		return (-1);
	}
	/*
	 * Oracle RAC (oban) devices under SunCluster initialize at the
	 * same time as QFS filesystems are mounted. We loop waiting
	 * for the devices to become available (maximum of maxdevretry
	 * tries).
	 */
	while ((fd = open(devrname, oflags)) < 0) {
		if ((retrycnt >= maxdevretry) ||
		    ((strncmp(devrname, "/dev/md/", 8) != 0))) {
			error(0, errno, "%s", devrname);
			error(0, 0, catgets(catfd, SET, 1856,
			    "Open failed on (%s), retries=%d"),
			    devrname, retrycnt);
			free(devrname);
			return (-1);
		}
		retrycnt++;
		sleep(2);
	}
	if (retrycnt > 0) {
		printf("%s: %d retries on %s (max=%d).\n",
		    program_name, retrycnt, devrname, maxdevretry);
	}

	if (ioctl(fd, DKIOCINFO, &dkcinfo) < 0) {
		error(0, errno, "%s", devrname);
		error(0, 0,
		    catgets(catfd, SET, 1443,
		    "Ioctl(DKIOCINFO) failed on (%s)"),
		    devrname);
		free(devrname);
		return (-1);
	}
	if (ioctl(fd, DKIOCGVTOC, &vtoc) >= 0) {
		/*
		 * Size of partition is returned in units of 512
		 * byte sectors.
		 */
		fsp->pt_size = (unsigned long)
		    vtoc.v_part[dkcinfo.dki_partition].p_size;
		if (fsp->pt_size == 0) {
			error(0, 0,
			    catgets(catfd, SET, 1909,
			    "Partition %d is undefined on (%s)"),
			    dkcinfo.dki_partition, devrname);
			free(devrname);
			return (-1);
		}
	} else if (is_efi_present()) {
		int part;
		int saved_errno;
		struct dk_gpt *efi_vtoc;

		saved_errno = errno;
		if ((part = call_efi_alloc_and_read(fd, &efi_vtoc)) >= 0) {
			fsp->pt_size = efi_vtoc->efi_parts[part].p_size;
			call_efi_free(efi_vtoc);
			if (fsp->pt_size == 0) {
				error(0, 0, catgets(catfd, SET, 1909,
				    "Partition %d is undefined on (%s)"),
				    part, devrname);
				free(devrname);
				return (-1);
			}
		} else {
			error(0, saved_errno, "%s", devrname);
			error(0, 0, catgets(catfd, SET, 13030,
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:101,代码来源:mount.c


示例7: main

int
main (int argc, char **argv)
{
  char *s, *prompt;
  char drive[_MAX_DRIVE];		/* for _splitpath, _makepath */
  char dir[_MAX_DIR];			/* for _splitpath, _makepath */
  char file[_MAX_FNAME];		/* for _splitpath, _makepath */
  char ext[_MAX_EXT];			/* for _splitpath, _makepath */
  char fullpath[_MAX_PATH];		/* the full path after _makepath */

  int i;
  int next;				/* return value of more() function */
  int done;				/* flag for findfirst, findnext */
  int exitval;				/* exit value */

  int pfile;				/* file handle */
  struct ffblk ffblk;			/* findfirst, findnext block */
  nl_catd cat;				/* message catalog */
  int stdinhandle;
  int someFileFound;
  int more_prompt_needed = 0;


  GetScreenSize();

  /* Open the message catalog */

  cat = catopen ("more", 0);
  prompt = catgets (cat, 2, 0, "More");

  /* Evaluate the files on the command line */


  /* we want to use DOS to get characters from STDIN.
     STDIN MAY have been redirected, which is not acceptable to more
     
     however, we want to be able to work with CTTY COM1
     so using the BIOS isn't an option as well.
     
     so we duplicate STDIN to a new handle,
     and duplicate STDERR (possibly COM1) to STDIN
     
     then STDIN is available for character input again
  */

  stdinhandle = dos_dup(0);
  if (stdinhandle < 0)
    {
      printf("??\n");
      exit(1);
    }
	
  dos_close(0);	
	
  if (dos_dup2(2,0))
    {
      printf("???\n");
      exit(1);   
    }
	    
  for (i = 1; i < argc; i++)
    {
      /* Check if we are asking for help */
	
      if (argv[i][0] != '/')
	{
	  continue;
	}
      /* This is a flag character */

      /* Add any code here that deals with special flag chars */

      switch (argv[i][1])
	{
	case '?':
	case 'H':
	case 'h':
	  /* print usage and quit */

	  s = catgets (cat, 0, 0, "Display the contents of a text file one screen at a time");
	  printf ("MORE: %s\n", s);
	  usage (cat);
	  catclose (cat);
	  exit (0);
	  break;
	      
	case 't':
	case 'T':
	  if ( argv[i][2] < '1' || argv[i][2] > '9')
	    {
	      printf("MORE:%s\n",
		     catgets(cat,1,3,"option /Tabs must be /T1..9 (default 4)\n"));
	    			
	      exit(1);	
	    }
	  TABSIZE = argv[i][2] - '0';
	  break;	    		
	      

	default:
//.........这里部分代码省略.........
开发者ID:FDOS,项目名称:more,代码行数:101,代码来源:MORE.C


示例8: disk_install

inst_t
disk_install(const char *datfile, const char *descfile,
	     char *fromdir, char *destdir)
{
  char lsmfile[MAXPATH];		/* Linux software map file */
  char *s;

  int dat_size = 30;			/* malloc size of the dat array */
  int dat_count;				/* size of the dat array */
  int ret;
  int ch;
  int i;

  int pkg_yesToAll = 0;			/* Assume default yes to all = not specified */

  dat_t *dat_ary;				/* the DAT array */
  inst_t this;				/* return: no. of errors,warnings */

  /* Initialize variables */

  this.errors = 0;
  this.warnings = 0;

  /* Read dat file */

  dat_ary = malloc (sizeof (dat_t) * dat_size);
  if (dat_ary == NULL)
    {
      s = catgets (cat, SET_ERRORS, MSG_ERROR, MSG_ERROR_STR);
      fprintf (stderr, s);
      log("<error msg=\"%s\" />\n", s);
      s = catgets (cat, SET_ERRORS, MSG_ERRALLOCMEMFDF, MSG_ERRALLOCMEMFDF_STR);
      fprintf (stderr, s);
      log("<error msg=\"%s\" />\n", s);

	pause();
      return (this);
    }

  dat_count = dat_read (datfile, dat_ary, dat_size);
  if (dat_count < 1)
    {
      s = catgets (cat, SET_ERRORS, MSG_ERROR, MSG_ERROR_STR);
      fprintf (stderr, s);
      log("<error msg=\"%s\" />\n", s);
      s = catgets (cat, SET_ERRORS, MSG_ERREMPTYFLOPPYDATAFILE, MSG_ERREMPTYFLOPPYDATAFILE_STR);
      fprintf (stderr, s);
      log("<error msg=\"%s\" />\n", s);


	pause();
      free (dat_ary);
      return (this);
    }

  /* Run the install */

  for (i = 0; i < dat_count; i++) {
    /* Print the screen and progress bargraph */

    repaint_empty();

    box (14, 16, 66, 18);
    gotoxy (15, 17);
    bargraph (i, dat_count, 50 /* width */);

    /* Print the package name */

    gotoxy (2, 5);
    s = catgets (cat, SET_PKG_GENERAL, MSG_PACKAGE, MSG_PACKAGE_STR);
    cputs (s);

    cputs (dat_ary[i].name);

    /* Show the package description */

    /* Generate the lsmfile name */

    fnmerge (lsmfile, "", fromdir, dat_ary[i].name, "LSM");

    if (isfile (lsmfile))
      {
	lsm_description (8, 2, 10, lsmfile);
      }
    else
      {
	/* no lsm file. try it again with a plain txt file */

	fnmerge (lsmfile, "", fromdir, dat_ary[i].name, "");

	if (isfile (lsmfile))
	  {
	    gotoxy (2, 8);
	    cat_file (lsmfile, 10 /* no. lines */);
	  }
      }

    /* Find out which ones the user wants to install */

    gotoxy (2, 25);
//.........这里部分代码省略.........
开发者ID:TijmenW,项目名称:FreeDOS,代码行数:101,代码来源:inst.c


示例9: set_install

inst_t
set_install (const char *diskset, char *fromdir, char *destdir)
{
  /* Variables */

  char endfile[MAXPATH];		/* marks end of series */
  char descfile[MAXPATH];		/* description file */
  char datfile[MAXPATH];		/* current DAT file */
  char ext[MAXPATH];			/* file extension */
  char *s;
  int disknum = 0;			/* current disk number */
  int ch;
  inst_t ret;				/* return: no. of errors,warnings */
  inst_t this;				/* no. of errors,warnings */

  /* Create the filenames */

  fnmerge (endfile, "", fromdir, diskset, "END");
  /* fnmerge (descfile, "", fromdir, diskset, "TXT"); */
  fnmerge (descfile, "", fromdir, diskset, "");


  /* Print the name of the series we are working on */

  repaint_empty();
  s = catgets (cat, SET_PKG_GENERAL, MSG_INSTSERIES, MSG_INSTSERIES_STR);
  gotoxy (2, 3);
  cputs (s);
  cputs (diskset);
  log("<diskset name=\"%s\" >\n", diskset);


  /* Install while we have disks to work from.  Since we will reach an
     exit condition within the loop, we use an infinite loop here. */

  ret.errors = 0;
  ret.warnings = 0;

  while (1) {
    repaint_empty();

    /* First check that the datfile exists.  If it doesn't, check if
       the endfile was found. */

    sprintf (ext, "%d", ++disknum);
    fnmerge (datfile, "", fromdir, diskset, ext);

    if (!isfile (datfile)) {
      /* Does the endfile exist? */

      if (isfile (endfile)) {
	s = catgets (cat, SET_PKG_GENERAL, MSG_INSTSERIESDONE, MSG_INSTSERIESDONE_STR);
	gotoxy (2, 10);
	cputs (s);

	s = catgets (cat, SET_PKG_GENERAL, MSG_NEXTSERIESDISK, MSG_NEXTSERIESDISK_STR);
	gotoxy (2, 15);
	cputs (s);

	s = catgets (cat, SET_PKG_GENERAL, MSG_NEXTSERIESDISK2, MSG_NEXTSERIESDISK2_STR);
	gotoxy (2, 16);
	cputs (s);

      log("</diskset>\n\n");
	pause();
	return (ret);
      }

      /* The endfile was not found, so we know there is at least one
         more disk left to do.  Keep asking the user to insert the
         next disk. */

      do {

      /* If this is the 1st disk in the series, then instead of assuming wrong disk
         prompt for them to insert the disk. */
      if (disknum == 1)
      {
        s = catgets (cat, SET_PKG_GENERAL, MSG_INSERT1STDISK, MSG_INSERT1STDISK_STR);
	  gotoxy (2, 10);
        cprintf(s, diskset);
      }
      else 
      {
	  s = catgets (cat, SET_PKG_GENERAL, MSG_MISSINGDATAFILE, MSG_MISSINGDATAFILE_STR);
	  gotoxy (2, 10);
	  cputs (s);

	  gotoxy (2, 11);
	  cputs (datfile);

	  s = catgets (cat, SET_PKG_GENERAL, MSG_WRONGFLOPPY, MSG_WRONGFLOPPY_STR);
	  gotoxy (2, 15);
	  cputs (s);

	  s = catgets (cat, SET_PKG_GENERAL, MSG_STILLWRONGFLOPPY, MSG_STILLWRONGFLOPPY_STR);
	  gotoxy (2, 16);
	  cputs (s);
      }

//.........这里部分代码省略.........
开发者ID:TijmenW,项目名称:FreeDOS,代码行数:101,代码来源:inst.c


示例10: vredraw

/*
 * Fully cleanup the screen, leaving no @ lines except at end when
 * line after last won't completely fit.  The routine vsync is
 * more conservative and much less work on dumb terminals.
 */
void 
vredraw(register int p)
{
	register int l;
	register line *tp;
	char temp[LBSIZE];
	bool anydl = 0;
	short oldhold = hold;

#ifdef ADEBUG
	if (trace)
		tfixnl(), fprintf(trace, "vredraw(%d)\n", p), tvliny();
#endif
	if (holdupd) {
		holdupd = 3;
		return;
	}
	if (state == HARDOPEN || splitw)
		return;
	if (p < 0 /* || p > WECHO */)
		error(catgets(catd, 1, 221, "Internal error: vredraw"));

	/*
	 * Trim the ragged edges (lines which are off the screen but
	 * not yet logically discarded), save the current line, and
	 * search for first logical line affected by the redraw.
	 */
	vscrap();
	CP(temp, linebuf);
	l = 0;
	tp = dot - vcline;
	if (vcnt == 0)
		LINE(0) = WTOP;
	while (l < vcnt && LINE(l) < p)
		l++, tp++;

	/*
	 * We hold off echo area clearing during the redraw in deference
	 * to a final clear of the echo area at the end if appropriate.
	 */
	heldech = 0;
	hold |= HOLDECH;
	for (; l < vcnt && Peekkey != ATTN; l++) {
		if (l == vcline)
			strcLIN(temp);
		else
			getline(*tp);

		/*
		 * Delete junk between displayed lines.
		 */
		if (LINE(l) != LINE(l + 1) && LINE(l) != p) {
			if (anydl == 0 && DB && CD) {
				hold = oldhold;
				vclrech(0);
				anydl = 1;
				hold |= HOLDECH;
				heldech = 0;
			}
			vdellin(p, LINE(l) - p, l);
		}

		/*
		 * If line image is not know to be up to date, then
		 * redisplay it;  else just skip onward.
		 */
		LINE(l) = p;
		if (FLAGS(l) & VDIRT) {
			DEPTH(l) = vdepth();
			if (l != vcline && p + DEPTH(l) - 1 > WBOT) {
				vscrap();
				break;
			}
			FLAGS(l) &= ~VDIRT;
			vreopen(p, lineno(tp), l);
			p = LINE(l) + DEPTH(l);
		} else
			p += DEPTH(l);
		tp++;
	}

	/*
	 * That takes care of lines which were already partially displayed.
	 * Now try to fill the rest of the screen with text.
	 */
	if (state == VISUAL && p <= WBOT) {
		int ovcline = vcline;

		vcline = l;
		for (; tp <= dol && Peekkey != ATTN; tp++) {
			getline(*tp);
			if (p + vdepth() - 1 > WBOT)
				break;
			vopen(tp, p);
			p += DEPTH(vcline);
//.........这里部分代码省略.........
开发者ID:JamesLinus,项目名称:LiteBSD-Ports,代码行数:101,代码来源:ex_vadj.c


示例11: strerror_r


//.........这里部分代码省略.........
       know of no implementation that modifies buf to be an
       unterminated string, so this strlen should be portable in
       practice (rather than pulling in a safer strnlen).  */
    if (ret == ERANGE && strlen (buf) < buflen - 1)
      {
        char stackbuf[STACKBUF_LEN];

        /* STACKBUF_LEN should have been large enough.  */
        if (strerror_r (errnum, stackbuf, sizeof stackbuf) == ERANGE)
          abort ();
        safe_copy (buf, buflen, stackbuf);
      }
# endif

#else /* USE_SYSTEM_STRERROR */

    /* Try to do what strerror (errnum) does, but without clobbering the
       buffer used by strerror().  */

# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __CYGWIN__ /* NetBSD, HP-UX, native Win32, Cygwin */

    /* NetBSD:        sys_nerr, sys_errlist are declared through _NETBSD_SOURCE
                      and <errno.h> above.
       HP-UX:         sys_nerr, sys_errlist are declared explicitly above.
       native Win32:  sys_nerr, sys_errlist are declared in <stdlib.h>.
       Cygwin:        sys_nerr, sys_errlist are declared in <errno.h>.  */
    if (errnum >= 0 && errnum < sys_nerr)
      {
#  if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
#   if defined __NetBSD__
        nl_catd catd = catopen ("libc", NL_CAT_LOCALE);
        const char *errmsg =
          (catd != (nl_catd)-1
           ? catgets (catd, 1, errnum, sys_errlist[errnum])
           : sys_errlist[errnum]);
#   endif
#   if defined __hpux
        nl_catd catd = catopen ("perror", NL_CAT_LOCALE);
        const char *errmsg =
          (catd != (nl_catd)-1
           ? catgets (catd, 1, 1 + errnum, sys_errlist[errnum])
           : sys_errlist[errnum]);
#   endif
#  else
        const char *errmsg = sys_errlist[errnum];
#  endif
        if (errmsg == NULL || *errmsg == '\0')
          ret = EINVAL;
        else
          ret = safe_copy (buf, buflen, errmsg);
#  if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
        if (catd != (nl_catd)-1)
          catclose (catd);
#  endif
      }
    else
      ret = EINVAL;

# elif defined __sgi || (defined __sun && !defined _LP64) /* IRIX, Solaris <= 9 32-bit */

    /* For a valid error number, the system's strerror() function returns
       a pointer to a not copied string, not to a buffer.  */
    if (errnum >= 0 && errnum < sys_nerr)
      {
        char *errmsg = strerror (errnum);
开发者ID:FEI17N,项目名称:gnulib,代码行数:66,代码来源:strerror_r.c


示例12: vrepaint

/*
 * Repaint the screen, with cursor at curs, aftern an arbitrary change.
 * Handle notification on large changes.
 */
void 
vrepaint(char *curs)
{

	wdot = NOLINE;
	/*
	 * In open want to notify first.
	 */
	noteit(0);
	vscrap();

	/*
	 * Deal with a totally useless display.
	 */
	if (vcnt == 0 || vcline < 0 || vcline > vcnt || holdupd && state != VISUAL) {
		register line *odol = dol;

		vcnt = 0;
		if (holdupd)
			if (state == VISUAL)
				ignore(peekkey());
			else
				vup1();
		holdupd = 0;
		if (odol == zero)
			fixzero();
		vcontext(dot, '.');
		noteit(1);
		if (noteit(1) == 0 && odol == zero) {
			CATCH
				error(catgets(catd, 1, 220,
						"No lines in buffer"));
			ENDCATCH
			linebuf[0] = 0;
			splitw = 0;
		}
		vnline(curs);
		return;
	}

	/*
	 * Have some useful displayed text; refresh it.
	 */
	getDOT();

	/*
	 * This is for boundary conditions in open mode.
	 */
	if (FLAGS(0) & VDIRT)
		vsync(WTOP);
	
	/*
	 * If the current line is after the last displayed line
	 * or the bottom of the screen, then special effort is needed
	 * to get it on the screen.  We first try a redraw at the
	 * last line on the screen, hoping it will fill in where @
	 * lines are now.  If this doesn't work, then roll it onto
	 * the screen.
	 */
	if (vcline >= vcnt || LINE(vcline) > WBOT) {
		short oldhold = hold;
		hold |= HOLDAT, vredraw(LASTLINE), hold = oldhold;
		if (vcline >= vcnt) {
			register int i = vcline - vcnt + 1;

			dot -= i;
			vcline -= i;
			vroll(i);
		} else
			vsyncCL();
	} else
		vsync(vcline > 0 ? LINE(vcline - 1) : WTOP);

	/*
	 * Notification on large change for visual
	 * has to be done last or we may lose
	 * the echo area with redisplay.
	 */
	noteit(1);

	/*
	 * Finally.  Move the cursor onto the current line.
	 */
	vnline(curs);
}
开发者ID:JamesLinus,项目名称:LiteBSD-Ports,代码行数:89,代码来源:ex_vadj.c


示例13: main

int             main (int argc, char *argv[])
{
    FILE           *instream;
    struct stat     fstat_input;
    long            bytes_in = 0L;
    int             mychar;
    time_t          now, start_stamp;

    setlocale (LC_ALL, "");
    dtsearch_catd = catopen (FNAME_DTSRCAT, 0);
    printf (catgets(dtsearch_catd, MS_huff, 40,
	"HUFFCODE Version %s\n"), AUSAPI_VERSION);

    /* validate user's command line arguments */
    user_args_processor (argc, argv);

    /* initialize tree table, using the table file if it exists */
    init_treebase ();
    if (total_count == 0L)
	printf ("%s", catgets(dtsearch_catd, MS_huff, 41,
	    "Huffman Code Tables will be newly created.\n"));
    else
	printf (catgets(dtsearch_catd, MS_huff, 42,
	    "Table '%s' already contains %ld Kbytes from previous runs.\n"),
	    filename_huf, total_count / 1000L);

    if (!input_file_specified && no_huffcode_file) {
	fprintf (stderr, catgets(dtsearch_catd, MS_huff, 43,
	    "645 Input file not specified and '%s' table file\n"
	    "   doesn't exist--nothing to do!\n"),
	    filename_huf);
	print_usage ();
	exit (2);
    }

    /* read the input file and count its bytes */
    if (input_file_specified) {
	if ((instream = fopen (filename_input, "rb")) == NULL) {
    BAD_INPUT_FILE:
	    fprintf (stderr, catgets(dtsearch_catd, MS_huff, 44,
		"Could not open input file '%s' or access status: %s\n"),
		filename_input, strerror (errno));
	    exit (2);
	}
	if (fstat (fileno (instream), &fstat_input) == -1)
	    goto BAD_INPUT_FILE;
	printf (catgets(dtsearch_catd, MS_huff, 45,
	    "Input file '%s' contains about %ld Kbytes.\n"),
	    filename_input, fstat_input.st_size / 1000L);

	time (&start_stamp);
	while ((mychar = getc (instream)) != EOF) {
	    hctree1[mychar].count++;
	    total_count++;

	    /* echo progress to user every so often */
	    if (!(++bytes_in % 10000L))
		printf (catgets(dtsearch_catd, MS_huff, 46,
		    "\r%ld%% done. %2ld Kbytes read.  "
		    "Estimate %3ld seconds to completion.   "),
		    (bytes_in * 100L) / fstat_input.st_size,
		    bytes_in / 1000L,
		    (fstat_input.st_size - bytes_in) *
		    (time (NULL) - start_stamp) / bytes_in);
	}	/* end read loop for each char in input file */

	putchar ('\n');
	fclose (instream);
    }	/* endif that processes input file */

    /* build huffman code tree, write out files */
    time (&now);	/* this will be the official tree id time
			 * stamp */
    printf (catgets(dtsearch_catd, MS_huff, 47,
	"Identifying timestamp will be '%ld'.\n"
	"%s Huffman Code Tables in '%s' and '%s'..."),
	now,
	(no_huffcode_file) ?
	    catgets(dtsearch_catd, MS_huff, 48, "Creating") :
	    catgets(dtsearch_catd, MS_huff, 49, "Rebuilding"),
	filename_huf,
	filename_huc);
    huffman_code (now);
    putchar ('\n');
    return 0;
}  /* end of function main */
开发者ID:juddy,项目名称:edcde,代码行数:86,代码来源:huffcode.c


示例14: user_args_processor

/* handles command line arguments for 'main' */
static void     user_args_processor (int argc, char **argv)
{
    char           *argptr;
    int             OK_to_overwrite = FALSE;
    FILE           *stream;

    if (argc <= 1) {	/* user just wants to see usage msg */
	print_usage ();
	exit (1);
    }

    /* each pass grabs new parm of "-xxx" format */
    while (--argc > 0 && (*++argv)[0] == '-') {
	argptr = argv[0];
	argptr[1] = tolower (argptr[1]);
	switch (argptr[1]) {
	    case 'l':	/* literal threshold */
		if (argptr[2] == 0)
		    goto BADARG;
		else if (argptr[2] == '-')
		    literal_coding_on = FALSE;
		else
		    literal_threshold = atoi (argptr + 2);
		break;

	    case 'o':	/* OK_to_overwrite .c file if it already
			 * exists */
		OK_to_overwrite = TRUE;
		break;

	    case 'v':	/* verbose mode = debug switch */
		debug_switch = TRUE;
		break;

	BADARG:
	    default:
		fprintf (stderr, catgets(dtsearch_catd, MS_huff, 36,
		    "'%s' is invalid argument.\n"), argptr);
		print_usage ();
		exit (2);	/* ABORT program */

	}	/* endswitch */
    }	/* endwhile for cmd line '-'processing */

    /* test for required tree file name */
    if (argc <= 0) {
	fprintf (stderr, "%s", catgets(dtsearch_catd, MS_huff, 37,
	    "576 Missing Huffman Code file names prefix.\n"));
	print_usage ();
	exit (2);
    }
    /* create 2 output file names from passed argument */
    strncpy (filename_huf, argv[0], _POSIX_PATH_MAX);
    filename_huf[_POSIX_PATH_MAX - 6] = 0;
    strcat (filename_huf, EXT_HUFFCODE);
    strncpy (filename_huc, argv[0], _POSIX_PATH_MAX);
    filename_huc[_POSIX_PATH_MAX - 6] = 0;
    strcat (filename_huc, EXT_HDECODE);

    /* Since the decode file is a C source code file (.c extension),
     * we want to be sure not to erase somebody's source program.
     * So if the .c file already exists, and the user didn't specify
     * overwrite in a command line argument, ask him now if it's OK to
     * blow away the old file.
     */
    if (!OK_to_overwrite)
	if ((stream = fopen (filename_huc, "r")) != NULL) {
	    fclose (stream);
	    printf (catgets(dtsearch_catd, MS_huff, 38,
		"Decode file '%s' already exists.  "
		"Is it OK to overwrite it? [y/n] "),
		filename_huc);
	    if (toupper (getchar ()) != 'Y')
		exit (2);
	}

    /* test for optional input file name */
    if (--argc <= 0)
	input_file_specified = FALSE;
    else {
	input_file_specified = TRUE;
	strncpy (filename_input, argv[1], _POSIX_PATH_MAX);
	filename_input[_POSIX_PATH_MAX - 1] = 0;
    }

    return;
}  /* end of function user_args_processor */
开发者ID:juddy,项目名称:edcde,代码行数:88,代码来源:huffcode.c


示例15: main


//.........这里部分代码省略.........
      ret = find_str (needle, 0 /* stdin */,
        invert_search, count_lines, number_output, ignore_case);
    }

  else
    {
      for (i = c; i < argc; i++)
   {
     /* find drive and wd for each file when using findfirst */

     /* fnsplit (argv[i], drv, thiscwd, NULL, NULL); */
     /* fnsplit is "expensive", so replace it... */
     
     if (argv[i][1] == ':') {
       drv = toupper(argv[i][0]) - 'A';
       strcpy(thiscwd,argv[i]+2);
     } else {
       drv = drive - 1; /* default drive */
       strcpy(thiscwd,argv[i]);
     }

     if (strrchr(thiscwd,'\\') == NULL) {
       strcpy(thiscwd,"."); /* no dir given */
     } else {
       if (strrchr(thiscwd,'\\') != thiscwd) {
         strrchr(thiscwd,'\\')[0] = '\0'; /* end string at last \\ */
       } else {
         strcpy(thiscwd,"\\"); /* dir is root dir */
       }
     }

     if (!LFNConvertToSFN(thiscwd))
     {
       s = catgets (cat, 2, 2, "Cannot change to directory");
       /* printf ("FIND: %s: %s\n", argv[i], s); */
       write(1,"FIND: ",6);
       write(1,argv[i],strlen(argv[i]));
       write(1,": ",2);
       write(1,s,strlen(s));
       write(1,"\r\n",2);          
     }

     /* printf("drive (0=A:)=%d dir=%s\n", drv, thiscwd); */

     /* use findfirst/findnext to expand the filemask */

     /* done = findfirst (argv[i], &ffblk, 0); */
     done = LFNFirstFile(argv[i], file, longfile);

     if (done)
       {
         /* We were not able to find a file. Display a message and
       set the exit status. */

         s = catgets (cat, 2, 1, "No such file");
         /* printf ("FIND: %s: %s\n", argv[i], s); */
         write(1,"FIND: ",6);
         write(1,argv[i],strlen(argv[i]));
              write(1,": ",2);
         write(1,s,strlen(s));
         write(1,"\r\n",2);
       }

     while (!done)
       {
         /* We have found a file, so try to open it */
开发者ID:CivilPol,项目名称:sdcboot,代码行数:67,代码来源:find.c


示例16: __kmp_i18n_do_catopen

void
__kmp_i18n_do_catopen(
) {
    int    english = 0;
    char * lang    = __kmp_env_get( "LANG" );
    // TODO: What about LC_ALL or LC_MESSAGES?

    KMP_DEBUG_ASSERT( status == KMP_I18N_CLOSED );
    KMP_DEBUG_ASSERT( cat    == KMP_I18N_NULLCAT );

    english =
	lang == NULL                       ||  // In all these cases English language is used.
	strcmp( lang, "" )            == 0 ||
        strcmp( lang, " " )           == 0 ||
              // Workaround for Fortran RTL bug DPD200137873 "Fortran runtime resets LANG env var
              // to space if it is not set".
	strcmp( lang, "C" )           == 0 ||
	strcmp( lang, "POSIX" )       == 0;

    if ( ! english ) {  // English language is not yet detected, let us continue.
        // Format of LANG is: [language[_territory][.codeset][@modifier]]
        // Strip all parts except language.
        char * tail = NULL;
        __kmp_str_split( lang, '@', & lang, & tail );
        __kmp_str_split( lang, '.', & lang, & tail );
        __kmp_str_split( lang, '_', & lang, & tail );
        english = ( strcmp( lang, "en" ) == 0 );
    }; // if

    KMP_INTERNAL_FREE( lang );

    // Do not try to open English catalog because internal messages are
    // exact copy of messages in English catalog.
    if ( english ) {
	status = KMP_I18N_ABSENT;  // mark catalog as absent so it will not be re-opened.
	return;
    }

    cat = catopen( name, 0 );
    // TODO: Why do we pass 0 in flags?
    status = ( cat == KMP_I18N_NULLCAT ? KMP_I18N_ABSENT : KMP_I18N_OPENED );

    if ( status == KMP_I18N_ABSENT ) {
      if (__kmp_generate_warnings > kmp_warnings_low) { // AC: only issue warning in case explicitly asked to
        int    error   = errno; // Save errno immediately.
	char * nlspath = __kmp_env_get( "NLSPATH" );
        char * lang    = __kmp_env_get( "LANG" );

	// Infinite recursion will not occur -- status is KMP_I18N_ABSENT now, so
	// __kmp_i18n_catgets() will not try to open catalog, but will return default message.
	__kmp_msg(
	    kmp_ms_warning,
	    KMP_MSG( CantOpenMessageCatalog, name ),
	    KMP_ERR( error ),
	    KMP_HNT( CheckEnvVar, "NLSPATH", nlspath ),
            KMP_HNT( CheckEnvVar, "LANG", lang ),
	    __kmp_msg_null
	);
	KMP_INFORM( WillUseDefaultMessages );
        KMP_INTERNAL_FREE( nlspath );
        KMP_INTERNAL_FREE( lang );
      }
    } else { // status == KMP_I18N_OPENED

        int section = get_section( kmp_i18n_prp_Version );
        int number  = get_number( kmp_i18n_prp_Version );
        char const * expected = __kmp_i18n_default_table.sect[ section ].str[ number ];
            // Expected version of the catalog.
        kmp_str_buf_t version;   // Actual version of the catalog.
        __kmp_str_buf_init( & version );
        __kmp_str_buf_print( & version, "%s", catgets( cat, section, number, NULL ) );

            // String returned by catgets i 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ causedBy函数代码示例发布时间:2022-05-30
下一篇:
C++ category函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap