home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
prnflg.exe
/
CAPFLAGS.C
next >
Wrap
Text File
|
1995-02-05
|
6KB
|
169 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: CAPFLAGS.C
**
** Desc: The program will print out the capture flags from the flags1
** and flags2 structures. The user must specify the lpt port.
**
**
** Programmers:
** Ini Who Firm
** ------------------------------------------------------------------
** ARM A. Ray Maxwell Novell Developer Support.
**
** History:
**
** ------------------------------------------------------------------
** 01-29-95 ARM First code.
*/
/****************************************************************************
** Include Headers, Macros & function Prototypes.
*/
/*-------------------------------------------------------------------
** Borland C.
*/
#include <stdio.h> /* getch() */
#include <stdlib.h> /* exit() atoi() */
#include <conio.h> /* cputs() */
#include <string.h> /* strcpy() */
/*-------------------------------------------------------------------
** Netware NWCALLS etc.
*/
#include <nwcalls.h>
/*-------------------------------------------------------------------
** Prototypes
*/
void helpScreen(void);
void printFlags(NWCAPTURE_FLAGS1 *,NWCAPTURE_FLAGS2 *);
/****************************************************************************
** Program Start
*/
void main (int argc, char **argv)
{
NWCAPTURE_FLAGS1 f1; /* new capture flags for queue */
NWCAPTURE_FLAGS2 f2; /* new capture flags for queue */
int lptPort; /* buffer for lpt */
NWCCODE ccode; /* error code buffer */
if (argc != 2){
helpScreen();
exit(-1);
}
lptPort=atoi(argv[1]); /* set up the port */
ccode = NWCallsInit(NULL, NULL);
if (ccode != 0x0000){
printf("NWCallsInit failed with ccode =%X\n",ccode);
}
/*--------------------------------------------------------------------
** Check the capture status and if captured put the queue flags1 and 2
** into temp buffers.
*/
ccode = NWGetCaptureStatus(lptPort);
if (ccode ==0x00FF){
/*------------------------------------------------------------
** Sets a flag telling us there was a previous capture. This
** is used in resetOriginalCapture()
*/
ccode = NWGetCaptureFlags(
/* port 1,2,3 > */ lptPort,
/* captureflags1 < */ &f1,
/* captureflags2 < */ &f2);
if (ccode != 0x0000){
printf("NWGetCaptureFlags failed with ccode =%X\n",ccode);
exit(-1);
}
}
else
printf("LPT PORT %d is not currently captured\n",lptPort);
printFlags(&f1,&f2);
}
/****************************************************************************
** Usage and help screen.
*/
void helpScreen (void)
{
clrscr();
gotoxy (34,5);
cputs ("CAP Usage");
gotoxy (11,7);
cprintf("Usage: CAPFLAGS <lpt port>");
gotoxy (15,8);
cputs("lpt port = the port 1,2,3 that you are captured to.");
gotoxy (31,16);
cputs ("Hit Return to Exit");
getch();
}
/****************************************************************************
** Print the flags1 and flags2 field.
*/
void printFlags(NWCAPTURE_FLAGS1 *f1, NWCAPTURE_FLAGS2 *f2)
{
printf("Job Description: %s\n",f1->jobDescription);
printf("tabsize: %d\n",f1->tabSize);
printf("Number of copies: %d\n",f1->numCopies);
printf("Print flags: %X\n",f1->printFlags);
printf("Maximum Lines: %d\n",f1->maxLines);
printf("Maximum Charaters: %d\n",f1->maxChars);
printf("Maximum Lines: %d\n",f1->maxLines);
printf("Form Name: %s\n",f1->formName);
printf("formType: %X\n",f1->formType);
printf("Maximum Lines: %d\n",f1->maxLines);
printf("Banner Text: %s\n",f1->bannerText);
printf("Flush Capture time out,%d\n",f1->flushCaptureTimeout);
printf("Flush Capture on close %d\n",f1->flushCaptureOnClose);
printf("Queue ID: %08lX\n",f2->queueID);
printf("SetUpStringMaxLen: %d\n",f2->setupStringMaxLen);
printf("resetStringMaxLen: %d\n",f2->resetStringMaxLen);
printf("LPTCaptureFlag: %X\n",f2->LPTCaptureFlag);
printf("fileCaptureFlag: %X\n",f2->fileCaptureFlag);
printf("timeOutFlag: %X\n",f2->timingOutFlag);
printf("inProgress: %X\n",f2->inProgress);
printf("printQueueFlag: %X\n",f2->printQueueFlag);
printf("printJobValid: %X\n",f2->printJobValid);
printf("queueName: %s\n",f2->queueName);
}