ftp.nice.ch/pub/next/developer/objc/api/MetroToolsAPI.s.tar.gz#/MetroTools API/Headers/MetroTools.h

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

/*------------------------------------------------------------------------------
						METROTOOLS GLOBAL HEADER
						
	This is the header file that is public to all MetroTool Modules. It contains
	info that is relevant to modules living in MetroTools.
	
	filename: MetroTools.h
	author: Ron Miller
	date: 11/29/91
	
	modification history:
		2/14/92 RLM - modified to handle MetroTools as a file package.
		
------------------------------------------------------------------------------*/
/* includes */
#import <objc/objc.h>
#import <sys/types.h>
#import <sys/dir.h>
#import <streams/streams.h>

/* defines */

/*
	the directory structure for MetroTools goes like this:

	- The MetroTools Modules can reside in three directories:
		
		../MetroTools.app
		/(Home)/Apps/MetroToolModules
		/LocalApps/MetroToolModules
	
	with the .app directory taking presidence over the home directory, 
	and the home directory modules taking presidence over the LocalApps. Any 
	tool modules that require files of their own (like their own plug-in 
	modules) should have their files in a directory under one of the 
	MetroToolModules directories, and should search the directories in the same 
	order of presidence.
	
	- Preferences for MetroTools goes into a file called MetroTools.prefs in 
	the directory: 
	
	/(Home)/.MetroToolConfigs
	
	This hides the file from normal view, and places it in the user's directory
	so that each user can have their own customized preferences. All tools that
	have their own preferences should place that file into this directory.
	
	- Help files reside in the MetroToolModules directory in a directory 
	called:
		
		.../MetroToolModules/MetroToolsHelp
		
	The names of the help files are (ModuleName).help. These files should be in
	rtf format. When help is requested from the user for your module, 
	MetroTools first searches for the help file in the standard way, and 
	displays it if found. If not found, MetroTools then calls the module with a 
	DisplayHelp method, so that the module can display a specialized help if 
	need be.
*/

/* MetroToolModule directory paths */

#define MTDIRHOMEPATH	"/Apps/MetroToolModules/"	/* concat w/home dir */
#define MTDIRLOCALPATH	"/LocalApps/MetroToolModules/"

/* MetroToolModule help directory */

#define MTHELPDIR		"Help/"		/* concat w/ module directory paths */

/* MetroTools config directory */

#define MTCONFIGPATH	"/.MetroToolConfigs/"	/* concat w/ home dir */




/* structs */

/* list of file pathnames */
typedef char pathString[MAXNAMLEN+1];

typedef struct
	{
		int			nFiles;
		pathString	paths[0];
	} FileListRec, *FileListPtr;


/* prototypes */

/* file list utils */
extern FileListPtr NewFileList( void );
/* this routine returns an allocated and initialized file list ptr. returns
	NULL if problem.
*/

extern BOOL GetFileList( char *path, char *ext, FileListPtr *fp, BOOL noDups );
/* this routine searches the given directory for all the files that end with
	the given extender. Each file found is stuffed into fp. assumes fp is 
	allocated and initialized. returns true if successful.
*/

extern void KillFileList( FileListPtr fp );
/* this routine releases all memory associated with a file list ptr. */

extern FileListPtr SearchForModules( char *partialPath, char *ext );
/* this routine goes through each of the MetroTools module directories and
	searches for the files with the given ext. partialPath refers to an 
	optional partial path that starts from the module directories (ie 
	.../MetroToolModules/MetroToolsHelp/, where MetroToolsHelp/ is the partial 
	path). This routine excludes any duplicate files. returns FileListPtr if 
	successful, else NULL.
*/

/* MetroToolModules directory path creation utility routines */
void GetAppModulePath( char *partialPath, char *fullPath );
/* this routine returns the application .app path for the MetroTool modules.
	concats the passed partial path onto the app directory path.
*/

void GetHomeModulePath( char *partialPath, char *fullPath );
/* this routine returns the home path for the MetroTool modules. concats the
	passed partial path onto the home directory path.
*/

void GetPublicModulePath( char *partialPath, char *fullPath );
/* this routine returns the public path for the MetroTool modules. concats the
	passed partial path onto the public directory path.
*/

/* preference file utils */
extern NXStream *OpenPrefStream( char *fileName, BOOL *new );
/* this routine opens a preference file as an NXStream. The stream is opened
	with NXMapFile(), which means that this is a memory stream (the file is
	mapped into memory). You can read from and write to it, but to save it back
	out to file, call SavePrefStream(). The routine opens the prefs file in the
	user's MetroTools prefs directory. If the file is NOT found, the stream is
	opened with NXOpenMemory(), and new is set to true, else new is set to 
	false. returns the opened stream, if successful, else returns NULL.
*/

extern BOOL SavePrefStream( NXStream *prefStream, char *fileName );
/* this routine writes out the opened preference file stream to the passed 
	fileName. This routine saves the prefs stream to the user's MetroTools
	prefs directory, creating the directory if not there, and creating the file
	if not there. The stream should be one from OpenPrefStream() but can be any
	memory stream. returns true if successful.
*/

extern void ClosePrefStream( NXStream *prefStream );
/* this routine closes out the pref file stream. NOTE: does not save the stream 
	to file. For that, use SavePrefStream().
*/

extern void GetPrefDirPath( char *pathName );
/* this routine returns the preferences directory path name */

extern BOOL CreatePrefsDirectory( void );
/* this routine creates the preferences directory if not already there. returns
	true if successful.
*/


/* end file */

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