ftp.nice.ch/pub/next/unix/developer/docgen.0.3.2.s.tar.gz#/docgen-0.3.2/docgen.h

This is docgen.h in view mode; [Download] [Up]

/*
  docgen  Objective C Document Generator
  Copyright (C) 1995  Bill Bereza.
  
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
  Email:
  berezaw@river.it.gvsu.edu

  S-mail:
  Bill Bereza
  9526 Judson Rd.
  Ravenna, MI 49451-9427

  */
/* docgen	Objective C Document Generator
 * Copyright (c) 1994 Bill Bereza
 *
 *	$Log:	docgen.h,v $
 * Revision 1.38  96/01/07  01:28:47  berezaw
 * 0.3.2 in progress
 * 
 * Revision 1.37  95/07/26  23:00:18  berezaw
 * *** empty log message ***
 * 
 * Revision 1.36  95/07/26  21:46:16  berezaw
 * *** empty log message ***
 * 
 * Revision 1.35  95/07/26  17:51:31  berezaw
 * *** empty log message ***
 * 
 * Revision 1.34  95/07/26  17:50:18  berezaw
 * *** empty log message ***
 * 
 * Revision 1.33  95/07/26  16:17:27  berezaw
 * 0.3.1
 * 
 * Revision 1.32  95/07/25  11:29:21  berezaw
 * *** empty log message ***
 * 
 * Revision 1.31  95/07/25  11:19:51  berezaw
 * *** empty log message ***
 * 
 * Revision 1.28  95/07/23  15:49:21  berezaw
 * using objc_loadModules
 * 
 * Revision 1.27  95/07/23  14:33:27  berezaw
 * added NXBundle stuff
 * 
 * Revision 1.26  95/07/23  02:31:22  berezaw
 * adding dynamic module loading for Formatting Classes
 * 
 * Revision 1.21  95/07/21  01:58:23  berezaw
 * added ObjC stuff
 * 
 * Revision 1.20  95/07/20  01:17:47  berezaw
 * adjusted for 0.2.1
 * 
 *
 * Revision 1.18  95/03/02  18:16:48  berezaw
 * 0.2.0
 * 
 * Revision 1.17  95/03/02  13:21:38  berezaw
 * 
 * updated for 0.1.9
 * 
 * Revision 1.16  95/03/02  03:44:40  berezaw
 * using GNU regex library
 * rewrote recmp() as docgen_recmp()
 * added GPL stuff to each file
 * increase rev. to 0.1.9
 * 
 * Revision 1.15  95/02/13  19:05:11  berezaw
 * 
 * will now skip to next line on end of comments
 * 
 * Revision 1.14  95/02/13  18:08:29  berezaw
 * *** empty log message ***
 * 
 * Revision 1.13  95/02/13  18:01:46  berezaw
 * version number change
 * 
 * Revision 1.12  95/02/02  18:31:50  berezaw
 * 0.1.7, fixed problems with skipping lines
 * in odd classes
 * 
 * Revision 1.11  95/02/01  18:49:52  berezaw
 * 
 * 0.1.6
 * 
 * Revision 1.10  95/02/01  16:28:10  berezaw
 * 0.1.6
 * 
 * Revision 1.9  95/01/31  18:28:35  berezaw
 * 
 * added 0.1.5 stuff
 * 
 * Revision 1.8  95/01/30  14:11:10  berezaw
 * fixed fancy text
 * 
 * Revision 1.7  95/01/30  13:32:15  berezaw
 * added -F
 * 
 * Revision 1.6  95/01/29  01:50:23  berezaw
 * changes started for 0.1.4
 * 
 * Revision 1.5  95/01/27  00:31:40  berezaw
 * added '-x' option to hide methods beginning with '_'
 * 
 * Revision 1.4  95/01/26  15:32:30  berezaw
 * added BSD, SYSV and HPUX checks
 * 
 * Revision 1.3  95/01/26  05:34:53  berezaw
 * added global variables GLOB_decdir and GLOB_sort
 * 
 * Revision 1.2  94/11/28  12:08:31  berezaw
 * *** empty log message ***
 * 
 *
 *	$Id: docgen.h,v 1.38 96/01/07 01:28:47 berezaw Exp $
 */

#ifndef DOCGEN_H
#define DOCGEN_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#define DOCGEN_VERSION	"v0.3.2, Copyright (C) 1995  Bill Bereza.\ndocgen comes with ABSOLUTELY NO WARRANTY.\nThis is free software, and you are welcome to redistribute it\nunder certain conditions."

#ifdef STDC_HEADERS
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>

#if HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# define dirent direct
# define NAMLEN(dirent) (dirent)->d_namlen
# if HAVE_SYS_NDIR_H
#  include <sys/ndir.h>
# endif
# if HAVE_SYS_DIR_H
#  include <sys/dir.h>
# endif
# if HAVE_NDIR_H
#  include <ndir.h>
# endif
#endif

/* The next couple of ifdef's are to try to find the right
 * header file for getopt
 */
#ifdef HAVE_BSD_LIBC_H
#include <bsd/libc.h>
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#ifdef HAVE_OBJC_OBJECT_H
#define OBJC
#include <Format/Formatting.h>
#include <Format/DocgenFormatter.h>
#include <Format/RTFFormatter.h>
#include <Format/TXTFormatter.h>
#include <Format/HTMLFormatter.h>
#endif

#include <dynstr/dstring.h>
#include <dynstr/dstrio.h>
#include <dlist/dlstqueue.h>

/* Default search paths */
				/* Directory to begin search for .m files 	*/
#ifndef DEFSTARTDIR
#define DEFSTARTDIR	"."
#endif
				/* Directory to write RTF files into		*/
#ifndef DEFODIR
#define DEFODIR		"."
#endif
				/* Director(y|ies) to search for inheritance	*/
#ifndef DEFISEARCH
#ifdef NeXT
#define DEFISEARCH	".:/NextDeveloper/Headers:/LocalDeveloper/Headers"
#elif defined amiga
#define DEFISEARCH	".:/gnu/lib:/gnu/include"
#else
#define DEFISEARCH	".:/usr/lib:/usr/include"
#endif
#endif /* ! DEFISEARCH */
				/* Default level of verbosity */
#ifndef DEFVERBO
#define DEFVERBO	2
#endif
				/* Default: whether or not to recurse */
#ifndef DEFRECURS
#define DEFRECURS	no
#endif
				/* Default separator text for inheritance output */
#ifndef DEFSEP
#define DEFSEP		":"
#endif
								/* string to italicize */
#ifndef DEFITAL
#define DEFITAL		"#super#self#"
#endif

/* Defualt Formatter class */
#ifndef DEFFORMAT
#define DEFFORMAT "RTFFormatter"
#endif

/* Default search path for bundles */
#ifndef DEFBUNDLES
#define DEFBUNDLES {".","/usr/local/lib/docgen","/usr/lib/docgen", NULL }
#endif

/* Usage string */
#ifndef USAGE
#define USAGE	\
"docgen "DOCGEN_VERSION\
"\nCompiled: "__TIME__"  "__DATE__"\n"\
"\nUsage:\tdocgen\n\t[-d dir] [-l library] [-I headerdirs] [-R]"\
"\n\t[-v #] [-s string] [-e string] [-f classname] [-B ModuleDir]"\
"\n\t[-x] [-S] [-F] [-C] [-A] [-D] [-a] [-b] [-O]\n"\
"\n[-d dir]\t\tRoot dir to begin search for files"\
"\n[-l library]\t\tdir to dump RTF files into"\
"\n[-I headerdirs]\t\tList of directories separated by ':'"\
"\n[-R]\t\t\trecursively search the header dirs"\
"\n[-s string]\t\tSeparator for inheritance path output"\
"\n[-v (0-5)]\t\tlevel of verbosity(0 = none, 5 = all)"\
"\n[-e string]\t\tName of directory to put in Declared In:"\
"\n[-f classname]\t\tThe name of the Formatting class to use"\
"\n[-B ModuleDir]\t\tThe name of a directory containing Formatting modules"\
"\n[-x]\t\t\tDon't document methods that begin with _"\
"\n[-F]\t\t\tDon't check for net-like fancy text."\
"\n[-S]\t\t\tSort the methods in the descriptions."\
"\n[-C]\t\t\tPrint the first line of comments."\
"\n[-A]\t\t\tAuto-document ALL set and get methods."\
"\n[-D]\t\t\tShow default values for all the above."\
"\n[-a]\t\t\tParse comments after method name in implementation."\
"\n[-b]\t\t\tParse comments before the method name\n"
#endif

/* verbose option definitions */
#define	V_NONE		(verbo>=0)	/* defined just for completeness 		*/
#define	V_BADERR	(verbo>=1)	/* any errors the user should know about	*/
#define	V_ERR		(verbo>=2)	/* errors the user can live with (warnings) 	*/
#define	V_STAT		(verbo>=3)	/* output that is useful for debugging		*/
#define	V_USELESS	(verbo>=4)	/* for things even you don't want care to know	*/
#define V_ALL		(verbo>=5)	/* nothing uses this, could be line tracing	*/

/* external functions in docgen.c, files.c, getdocopts.c, parseobjc.c */
extern 	int 	getdocopts(int argc, char **argv, char **checkdir, char **outlib, char **headers, char **format, char **bundledir);
extern 	void 	dirwalk(char *dir, void (*)(char *, char *, char *, char *), char *odir, char *hdir);
	/* no reason to use the function pointer */
extern 	void 	procfile(char *name, char *idir, char *odir, char *hdir);
    /* name = name of the file
	 * idir = dir the file is in
	 * odir = dir to write .rtfs into (passed onto parsobjc())
	 * hdir = dir(s) to search for .h (passed onto parsobjc())
	 */
extern	void 	procm(char *mname, char *idir, char *odir, char *hdir);
	/* mname = name of .m file found by procfile()
	 * rest are the same as procfile's
	 */
extern	char 	*dirfile(char *directory, char *filename);
	/* simple returns char array of directory+"/"+filename 	*/
	/* might do some checking of the last char of directory */
extern  char	*findfile(char *fname, char *startdir);
	/* fname = name of a file to fine
	 * startdir = root directory to begin search from
	 */
extern	int 	parseobjc(char *mfile, char *hfile, char *rtffile, char *hdir);
	/* mfile = absolute pathname of .m file
	 * hfile = absolute pathname of .h file (existence unknown)
	 * rtffile = absolute pathname the the .rtf to create/kill
	 */

/* boolean type using yes no so it won't be confused with standard TRUE FALSE */
typedef enum { no, yes } bool;

/* verbosity level */
extern 	int		verbo;

/* recursion */
extern 	bool	GLOB_recurs;

/* seperator for inheritance path */
extern  char    *GLOB_sep;

/* Whether or not to print out default values and exit */
extern	bool 	GLOB_defaults;

/* Name of directory to put in Declared In: if not NULL */
extern	char	*GLOB_decdir;

/* to sort methods or not */
extern	bool	GLOB_sort;

/* whether to hide methods beginning with '_' or not */
extern	bool	GLOB_undoc;

/* whether or not to parse fancy text */
extern	bool	GLOB_fancy;

/* whether or not to include the text on the same line as the
   comment beginner
   */
extern	bool	GLOB_firstcomm;

/* whether or not to autodocument all set and get methods */
extern	bool	GLOB_autodoc;

/* where to parse comments for methods from (before, after or both) */
extern	bool	GLOB_before, GLOB_after;

// This is the class to use with formatting
#ifdef OBJC
extern	id		myForm;
#endif

#endif /* ! DOCGEN_H */

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.