dslinux/user/perl/NetWare/testnlm/type type.c

cayenne dslinux_cayenne at user.in-berlin.de
Mon Dec 4 17:59:01 CET 2006


Update of /cvsroot/dslinux/dslinux/user/perl/NetWare/testnlm/type
In directory antilope:/tmp/cvs-serv17422/NetWare/testnlm/type

Added Files:
	type.c 
Log Message:
Adding fresh perl source to HEAD to branch from

--- NEW FILE: type.c ---
/**********************************************************************
*
*	C Source:		type.c
*	Instance:		idc_rads_2
*	Description:	DOS type Emulation
*	%created_by:	smscm %
*	%date_created:	Fri Apr 20 19:05:34 2001 %
*
**********************************************************************/
#ifndef lint
static char *_csrc = "@(#) %filespec: type.c~1 %  (%full_filespec: type.c~1:csrc:idc_rads#3 %)";
#endif

#include <stdio.h>
#include <nwfattr.h>
#include "clibstuf.h"

void main (int argc, char** argv)
{
  FILE* pfile = NULL;
  int k;
  int thechar;
  char* defaultDir;

  fnInitGpfGlobals();
  SetCurrentNameSpace(NWOS2_NAME_SPACE);
  defaultDir = (char *)getenv("PERL_ROOT");
  if (!defaultDir || (strlen(defaultDir) == 0))
    defaultDir = "sys:\\perl\\scripts";
  chdir(defaultDir);

  k = 1;
  while (k < argc)
  {
    // open the next file and print it out
    pfile = fopen(argv[k],"r");
    if (pfile)
    {
      while ((thechar = getc(pfile)) != EOF)
      {
        if (thechar != 0x0d)
          printf("%c",thechar);
      }
      fclose (pfile);
    }
    k++;
  }
}




More information about the dslinux-commit mailing list