ftp.nice.ch/pub/next/unix/database/sybtool.1.3.s.tar.gz#/sybtool-1.3/cmdline-1.04/src/cmd/main.c

This is main.c in view mode; [Download] [Up]

//------------------------------------------------------------------------
// ^FILE: main.c - main program for cmdparse(1)
//
// ^DESCRIPTION:
//     Instantiate a CmdParseCommand object and let it go do its stuff!
//
// ^HISTORY:
//    05/03/92	Brad Appleton	<brad@ssd.csd.harris.com>	Created
//-^^---------------------------------------------------------------------

#include <new.h>
#include <iostream.h>
#include <stdlib.h>

#include "cmdparse.h"

//
//  cmdparse_new_handler -- allocation error handler for cmdparse(1).
//
void  cmdparse_new_handler(void)
{
   cerr << "cmdparse: free-store allocation error." << endl ;
   ::exit(127);
}

int
main(int argc, const char * argv[])
{
   set_new_handler(cmdparse_new_handler);

   CmdParseCommand  cmdparse_cmd(*argv);
   CmdArgvIter  argv_iter(--argc, ++argv);

   return  cmdparse_cmd(argv_iter);
}

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