home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 316 / libsrc / std-init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  619 b   |  32 lines

  1.  
  2. /* this is a sort of standard init frobule for general purpose
  3.    c programs.  You can replace it if you want something that 
  4.    doesn't drag in half the know universe at link time.
  5. */
  6.  
  7. #include <stdio.h>
  8.  
  9. FILE * stdin = NULL;
  10. FILE * stdout = NULL;
  11. FILE * stderr = NULL;
  12.  
  13. int _main (n_args, args, env)
  14. int n_args;
  15. char ** args;
  16. char * env;        /* is this right? */
  17. {
  18.   int return_code;
  19.  
  20.   stdin = fdopen(0, "r");
  21.   stdout = fdopen(1, "w");
  22.   stderr = fdopen(2, "w+");
  23.  
  24.   return_code = main(n_args, args, env);
  25.  
  26.   fclose(stdin);
  27.   fclose(stdout);
  28.   fclose(stderr);
  29.  
  30.   return(return_code);
  31. }
  32.