コード例 #1
0
ファイル: cole.c プロジェクト: c00kiemon5ter/rtf2latex2e
COLEFILE *cole_fopen(COLEFS * colefilesystem, char *filename,
                     COLERRNO * colerrno)
{
    struct _cole_fopen_info info;

    if (cole_locate_filename(colefilesystem, filename, &info, &_cole_fopen_action, colerrno))
        return NULL;

    if (info.succ)
        return info.file;

    if (colerrno != NULL)
        *colerrno = info.colerrno;
    return NULL;
}
コード例 #2
0
int
main (int argc, char **argv)
{
	COLEFS * cfs;
	COLERRNO colerrno;

	/* To test cole_locate_filename() */
#define FILENAME "/ObjectPool/_994231763/\001Ole10Native"
	struct str_info info = { FILENAME, 108004 };


	cfs = cole_mount (COLE_TOPSRCDIR"/examples/text.doc", &colerrno);
	if (cfs == NULL) {
		cole_perror (PRGNAME, colerrno);
		exit (1);
	}


	if (cole_print_tree (cfs, &colerrno)) {
		cole_perror (PRGNAME, colerrno);
		cole_umount (cfs, NULL);
		exit (1);
	}


	if (cole_locate_filename (cfs, FILENAME, &info, check_size,
				  &colerrno)) {
		cole_perror (PRGNAME, colerrno);
		cole_umount (cfs, NULL);
		exit (1);
	}


	if (cole_recurse_tree (cfs, NULL, NULL, NULL, NULL, NULL, NULL,
			       &colerrno)) {
		cole_perror (PRGNAME, colerrno);
		cole_umount (cfs, NULL);
		exit (1);
	}


	if (cole_umount (cfs, &colerrno)) {
		cole_perror ("travel", colerrno);
		exit (1);
	}

	exit (0);
}
コード例 #3
0
ファイル: cole.c プロジェクト: UlricE/SiagOffice
COLEFILE *
cole_fopen (COLEFS *colefilesystem, char *filename, COLERRNO *colerrno)
{
	struct _cole_fopen_info info;

	if (cole_locate_filename (colefilesystem, filename, &info,
				  _cole_fopen_action, colerrno)) {
		/* couldn't locate the filename */
		/* colerrno is set */
		return NULL;
	}

	if (info.succ)
		return info.file;

	if (colerrno != NULL) *colerrno = info.colerrno;
	return NULL;
}
コード例 #4
0
int main (int argc, char **argv)
{
	int f_ptr = 0;
	COLEFS * cfs;
	COLERRNO colerrno;

	if (argc < 2)
	{
		fprintf (stderr, "dump - Outputs excel chart records for analysis.\n"
			"Usage: "PRGNAME" <FILE>\n");
		exit (1);
	}
	else
	{
		strncpy(filename, argv[1], 124);
		cfs = cole_mount (filename, &colerrno);
		if (cfs == NULL)
		{
			cole_perror (PRGNAME, colerrno);
			exit (1);
		}
	}

	while (cole_locate_filename (cfs, FileName[f_ptr], NULL, dump_file, &colerrno)) 
	{
		if (f_ptr)
		{
			cole_perror (PRGNAME, colerrno);
			break;
		}
		else
			f_ptr++;
	}

	if (cole_umount (cfs, &colerrno))
	{
		cole_perror ("travel", colerrno);
		exit (1);
	}
		
	return 0;
}