This is nppow.c in view mode; [Download] [Up]
/* * Filename: nppow.c * Created : Tue Sep 24 22:21:35 1991 * Author : Vince DeMarco * <vince@whatnxt.cuc.ab.ca> */ #include <sys/types.h> #include <sys/boolean.h> #include <sys/file.h> #include <sys/ioctl.h> #include <nextdev/npio.h> #define PRINTER "/dev/np0" extern int open(const char *path, int flags,int mode); extern void close(int fd); extern int ioctl(int d, unsigned long request,void *argp); /* structure in <nextdev/npio.h> is called np_Data */ static struct npop np_Data; int nppoweroff(void) { int fd = open(PRINTER, O_WRONLY,0777); /* Turns printer on */ if (fd == -1) return(-1); /* Does much of nothing */ np_Data.np_op=0; ioctl(fd,NPIOCPOP,&np_Data); /* Turns printer off */ np_Data.np_op=0; ioctl(fd,NPIOCPOP,&np_Data); close(fd); return(1); }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.