コード例 #1
0
ファイル: hexdump.c プロジェクト: CSRedRat/util-linux
int main(int argc, char **argv)
{
	FS *tfs;
	char *p;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);
	atexit(close_stdout);

	if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od")) {
		newsyntax(argc, &argv);
	} else
		errx(EXIT_FAILURE, _("calling hexdump as od has been deprecated "
				     "in favour to GNU coreutils od."));

	/* figure out the data block size */
	for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {
		tfs->bcnt = block_size(tfs);
		if (blocksize < tfs->bcnt)
			blocksize = tfs->bcnt;
	}
	/* rewrite the rules, do syntax checking */
	for (tfs = fshead; tfs; tfs = tfs->nextfs)
		rewrite(tfs);

	(void)next(argv);
	display();
	return exitval;
}
コード例 #2
0
ファイル: main_hexdump.c プロジェクト: AoLaD/rtems
int
main_hexdump(rtems_shell_hexdump_globals* globals, int argc, char *argv[])
{
	FS *tfs;
	char *p;

#if RTEMS_REMOVED
	(void)setlocale(LC_ALL, "");
#endif

	if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od"))
		newsyntax(globals, argc, &argv);
	else
		oldsyntax(globals, argc, &argv);

	/* figure out the data block size */
	for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {
		tfs->bcnt = size(globals, tfs);
		if (blocksize < tfs->bcnt)
			blocksize = tfs->bcnt;
	}
	/* rewrite the rules, do syntax checking */
	for (tfs = fshead; tfs; tfs = tfs->nextfs)
		rewrite(globals, tfs);

	(void)next(globals, argv);
	display(globals);
  exit(exitval);
  return exitval;
}
コード例 #3
0
ファイル: hexdump.c プロジェクト: AtariTeenageRiot/LUKS
int main(int argc, char **argv)
{
	FS *tfs;
	char *p;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od"))
		newsyntax(argc, &argv);
	else
		oldsyntax(argc, &argv);

	/* figure out the data block size */
	for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {
		tfs->bcnt = size(tfs);
		if (blocksize < tfs->bcnt)
			blocksize = tfs->bcnt;
	}
	/* rewrite the rules, do syntax checking */
	for (tfs = fshead; tfs; tfs = tfs->nextfs)
		rewrite(tfs);

	(void)next(argv);
	display();
	return exitval;
}
コード例 #4
0
ファイル: hexdump.c プロジェクト: edgar-pek/PerspicuOS
int
main(int argc, char *argv[])
{
    FS *tfs;
    char *p;

    (void)setlocale(LC_ALL, "");

    if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od"))
        newsyntax(argc, &argv);
    else
        oldsyntax(argc, &argv);

    /* figure out the data block size */
    for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {
        tfs->bcnt = size(tfs);
        if (blocksize < tfs->bcnt)
            blocksize = tfs->bcnt;
    }
    /* rewrite the rules, do syntax checking */
    for (tfs = fshead; tfs; tfs = tfs->nextfs)
        rewrite(tfs);

    (void)next(argv);
    display();
    exit(exitval);
}