home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
rndcap.exe
/
RENDCAP.C
next >
Wrap
Text File
|
1995-03-03
|
4KB
|
114 lines
/****************************************************************************
** DISCLAIMER
**
** Novell, Inc. makes no representations or warranties with respect to
** any NetWare software, and specifically disclaims any express or
** implied warranties of merchantability, title, or fitness for a
** particular purpose.
**
** Distribution of any NetWare software is forbidden without the
** express written consent of Novell, Inc. Further, Novell reserves
** the right to discontinue distribution of any NetWare software.
**
** Novell is not responsible for lost profits or revenue, loss of use
** of the software, loss of data, costs of re-creating lost data, the
** cost of any substitute equipment or program, or claims by any party
** other than you. Novell strongly recommends a backup be made before
** any software is installed. Technical support for this software
** may be provided at the discretion of Novell.
****************************************************************************
** File: ENDCAP.C
**
** Desc: This program will do an end capture on a print job by checking the
** capture flags2 fileCaptureFlag and seeing if a file or queue is
** captured. It will then end the capture according to the way the
** flag is set.
**
** Programmers:
** Ini Who Firm
** ------------------------------------------------------------------
** ARM A. Ray Maxwell Novell Developer Support.
**
** History:
**
** ------------------------------------------------------------------
** 02-15-95 ARM First code.
*/
/****************************************************************************
** Include Headers, Macros & function Prototypes.
*/
/*-------------------------------------------------------------------
** ANSI
*/
#include <stdio.h> /* getch() */
#include <stdlib.h> /* exit() atoi() */
#include <conio.h> /* cputs() */
#include <string.h> /* strcpy() */
/*-------------------------------------------------------------------
** Netware NWCALLS etc.
*/
#include <nwcalls.h>
/***************************************************************************
** Program start
*/
void main(int argc, char *argv[])
{
NWCAPTURE_FLAGS1 f1;
NWCAPTURE_FLAGS2 f2;
NWCCODE ccode;
int lptPort;
if(argc!=2){
printf("Usage: endcap <lpt port>\n");
printf(" lpt port = 1 to 3 on netx\n");
printf(" 1 to 9 with VLM's set\n");
exit(-1);
}
lptPort=atoi(argv[1]); /* set up the port */
if(argc!=2 || lptPort>9 ){
printf("Usage: endcap <lpt port>\n");
printf(" lpt port = 1 to 3 on netx\n");
printf(" 1 to 9 with VLM's set\n");
exit(-1);
}
ccode = NWCallsInit(NULL, NULL);
if (ccode){
printf("NWCallsInit failed with ccode =%X\n",ccode);
}
ccode = NWGetCaptureStatus(lptPort);
if (ccode ==0x00FF){
ccode = NWGetCaptureFlags(
/* port 1,2,3 > */ lptPort,
/* captureflags1 < */ &f1,
/* captureflags2 < */ &f2);
if (ccode){
printf("NWGetCaptureFlags failed with ccode =%X\n",ccode);
exit(-1);
}
/*--------------------------------------------------------------------
** Note: the NWCancelCapture is used to end a file capture.
*/
if(f2.fileCaptureFlag==0xFF){
ccode=NWCancelCapture(lptPort);
if (ccode){
printf("NWCancelCapture failed with ccode=%X\n",ccode);
exit(-1);
}
}
else{
ccode=NWEndCapture(lptPort);
if(ccode){
printf("NWEndCapture fails %X\n",ccode);
exit(-1);
}
}
}
}