html-unix.c

来自「将rft格式文件转换成html格式文件」· C语言 代码 · 共 72 行

C
72
字号
/* * html-unix.c -- UNIX rtftohtml wrapper * * Driver provides OpenOutputFile() and Basename() functions for the writer. */# include	<stdio.h># include	"rtf.h"# include	"rtf-unix.h"# include	"rtftohtml.h"static char *usage="rtftohtml [-V] [-i] [-G] [-T] [-o filename] [-P extension] file";intmain (argc, argv)int	argc;char	*argv[];{	/* install OS-specific callbacks into RTF library */	UnixSetProgPath (argv[0]);	RTFSetOpenLibFileProc (UnixOpenLibFile);	WriterInit ();	RTFInit ();	switch (do_main(argc,argv))	/* set up for output file */	{	case 1:			/* successful */		RTFRead ();		HTMLCleanup();		break;	case 0:			/* unsuccessful; die */		exit (1);	case -1:		/* unsuccessful; print usage message and die*/		RTFPanic ("Usage: %s", usage);	}	exit (0);}FILE *OpenOutputFile (name, mode, fileType)char	*name;char	*mode;int	fileType;	/* ignored */{	return (fopen (name, mode));}/* * Return pointer to basename part of pathname */# define	pathSep	'/'char *Basename (name)char	*name;{int	i, lsep;	for(i=0,lsep=0;name[i]!='\0';i++)	{		if(name[i]==pathSep)			lsep=i+1;	}	return (&name[lsep]);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?