Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
259
cde/programs/dthelp/dthelpprint/Dthelpprint
Normal file
259
cde/programs/dthelp/dthelpprint/Dthelpprint
Normal file
@@ -0,0 +1,259 @@
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!! File: Dthelpprint
|
||||
!!! Default Location: /usr/dt/app-defaults/C/Dthelpprint
|
||||
!!! Other OK locations: /usr/lib/X11/app-defaults/Dthelpprint
|
||||
!!! $HOME/Dthelpprint
|
||||
!!!
|
||||
!!! (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!!! (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!!! (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!!! (c) Copyright 1993, 1994 Novell, Inc.
|
||||
!!!
|
||||
!!! Purpose: dthelpprint application default resources
|
||||
!!! Description:
|
||||
!!! This file contains a list of all resources supported by
|
||||
!!! dthelpprint and their default or useful alternative values.
|
||||
!!! To customize dthelpprint operation, these resources can be
|
||||
!!! specified on the dthelpprint command line, added to the current
|
||||
!!! session database, or a put in a private Dthelpprint app-default
|
||||
!!! file in $HOME/Dthelpprint.
|
||||
!!! Used by: dthelpprint
|
||||
!!! Product: @(#)Common Desktop Environment 1.0
|
||||
!!! Revision: $XConsortium: Dthelpprint /main/3 1995/11/07 13:15:21 rswiston $
|
||||
!!! Warning:
|
||||
!!! Because of how dthelpprint merges resources from various
|
||||
!!! locations, a resource should only be uncommented when it
|
||||
!!! is explicitly set. Defining a resource without a value
|
||||
!!! actually overrides a previous value, which may cause
|
||||
!!! incorrect behaviour.
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!!! if defined, sends rsrc db and commands to stdout
|
||||
!dthelpprint.debugHelpPrint:
|
||||
!Dthelpprint.DebugHelpPrint:
|
||||
|
||||
!!! what resources to use
|
||||
!application.name:
|
||||
!Application.Name:
|
||||
|
||||
!application.class:
|
||||
!Application.Class:
|
||||
|
||||
!!! what resources to use
|
||||
!dthelpprint.name: dthelpprint
|
||||
!Dthelpprint.Name:
|
||||
|
||||
!dthelpprint.class: Dthelpprint
|
||||
!Dthelpprint.Class:
|
||||
|
||||
!!! how to print
|
||||
!dthelpprint.display:
|
||||
!Dthelpprint.Display:
|
||||
|
||||
!dthelpprint.printer:
|
||||
!Dthelpprint.Printer:
|
||||
|
||||
!dthelpprint.copies: 1
|
||||
!Dthelpprint.Copies:
|
||||
|
||||
!dthelpprint.outputFile:
|
||||
!Dthelpprint.OutputFile:
|
||||
|
||||
!!! what content to print; In most cases, these options should be
|
||||
!!! specified on the command line, not in a resource file
|
||||
! valid types are: 0: help topic, 1: string, 2: man page, 3: file, 4: dyn str
|
||||
!dthelpprint.helpType: 0
|
||||
!Dthelpprint.HelpType:
|
||||
|
||||
!dthelpprint.helpVolume:
|
||||
!Dthelpprint.HelpVolume:
|
||||
|
||||
!dthelpprint.locationId: _hometopic
|
||||
!Dthelpprint.LocationId:
|
||||
|
||||
! if defined, will cause only the entire volume, including TOC & Index to be printed
|
||||
!dthelpprint.allTopics:
|
||||
!Dthelpprint.AllTopics:
|
||||
|
||||
! if defined, will cause only the the topic and its subtopics to be printed
|
||||
!dthelpprint.subTopics:
|
||||
!Dthelpprint.SubTopics:
|
||||
|
||||
! if defined, will cause only the TOC to be printed
|
||||
!dthelpprint.toc:
|
||||
!Dthelpprint.Toc:
|
||||
|
||||
! if defined, will cause only the Index to be printed
|
||||
!dthelpprint.index:
|
||||
!Dthelpprint.Index:
|
||||
|
||||
!dthelpprint.manPage:
|
||||
!Dthelpprint.ManPage:
|
||||
|
||||
!dthelpprint.stringData:
|
||||
!Dthelpprint.StringData:
|
||||
|
||||
!dthelpprint.helpFile:
|
||||
!Dthelpprint.HelpFile:
|
||||
|
||||
!dthelpprint.topicTitle:
|
||||
!Dthelpprint.TopicTitle:
|
||||
|
||||
!!! Page Headers and Footers
|
||||
!!! The examples headers and footers given below are suitable for printing
|
||||
!!! double-sided pages with 72 column content size. By tuning for even
|
||||
!!! and odd pages, the page number and section number can always appear
|
||||
!!! at the outside of a bound page, for example.
|
||||
!!!
|
||||
!!! These are the set of possible symbolic values that may be used
|
||||
!!! in header/footer strings.
|
||||
!!!
|
||||
!!! $LMARGIN left margin blanks
|
||||
!!! $TODAY today's date
|
||||
!!! $VOLDATE date on the help volume file
|
||||
!!! $VOLUME volume name
|
||||
!!! $VOLUMEFILL filler for fixed sized 50 column volume name
|
||||
!!! $TOPIC section topic title
|
||||
!!! $TOPICFILL filler for fixed sized 50 column section topic title
|
||||
!!! $PAGENUM page number
|
||||
!!! $PAGENUMFILL filler for fixed sized 3 column page number
|
||||
!!! $SECTNUM section number or name
|
||||
!!! $SECTNUMFILL filler for fixed sized 8 column section number or name
|
||||
|
||||
!dthelpprint.evenTocHeader:$LMARGIN $VOLUMEFILL$VOLUME\n\n
|
||||
!Dthelpprint.EvenTocHeader:
|
||||
|
||||
!dthelpprint.oddTocHeader:$LMARGIN$VOLUME\n\n
|
||||
!Dthelpprint.OddTocHeader:
|
||||
|
||||
!dthelpprint.evenTocFooter:\n$LMARGIN$SECTNUM\n
|
||||
!Dthelpprint.EvenTocFooter:
|
||||
|
||||
!dthelpprint.oddTocFooter:\n$LMARGIN $SECTNUM\n
|
||||
!Dthelpprint.OddTocFooter:
|
||||
|
||||
!dthelpprint.evenBodyHeader:$LMARGINPage $PAGENUM$PAGENUMFILL $VOLUMEFILL$VOLUME\n\n
|
||||
!Dthelpprint.EvenBodyHeader:
|
||||
|
||||
!dthelpprint.oddBodyHeader:$LMARGIN$VOLUME$VOLUMEFILL $PAGENUMFILLPage $PAGENUM\n\n
|
||||
!Dthelpprint.OddBodyHeader:
|
||||
|
||||
!dthelpprint.evenBodyFooter:\n$LMARGINSection $SECTNUM$SECTNUMFILL $TOPICFILL$TOPIC\n
|
||||
!Dthelpprint.EvenBodyFooter:
|
||||
|
||||
!dthelpprint.oddBodyFooter:\n$LMARGIN$TOPIC$TOPICFILL $SECTNUMFILLSection $SECTNUM\n
|
||||
!Dthelpprint.OddBodyFooter:
|
||||
|
||||
!dthelpprint.evenIndexHeader:$LMARGINPage $PAGENUM$PAGENUMFILL $VOLUMEFILL$VOLUME\n\n
|
||||
!Dthelpprint.EvenIndexHeader:
|
||||
|
||||
!dthelpprint.oddIndexHeader:$LMARGIN$VOLUME$VOLUMEFILL $PAGENUMFILLPage $PAGENUM\n\n
|
||||
!Dthelpprint.OddIndexHeader:
|
||||
|
||||
!dthelpprint.evenIndexFooter:\n$LMARGIN$SECTNUM\n
|
||||
!Dthelpprint.EvenIndexFooter:
|
||||
|
||||
!dthelpprint.oddIndexFooter:\n$LMARGIN $SECTNUM\n
|
||||
!Dthelpprint.OddIndexFooter:
|
||||
|
||||
!!! print activity control
|
||||
!dthelpprint.echoCommand: echo
|
||||
!Dthelpprint.EchoCommand:
|
||||
|
||||
!! echo arg values order: STRING string
|
||||
!dthelpprint.echoArgs: "%s"
|
||||
!Dthelpprint.FoldArgs:
|
||||
|
||||
!dthelpprint.foldCommand: fold
|
||||
!Dthelpprint.FoldCommand:
|
||||
|
||||
!! fold arg values order: INT column width, STRING filename
|
||||
!for HP, IBM: dthelpprint.foldArgs: -s -w %d %s
|
||||
!for Sun (-s not suported): dthelpprint.foldArgs: -w %d %s
|
||||
!dthelpprint.foldArgs: -w %d %s
|
||||
!Dthelpprint.FoldArgs:
|
||||
|
||||
!dthelpprint.prCommand: pr
|
||||
!Dthelpprint.PrCommand:
|
||||
|
||||
!! pr arg values order: STRING topic title, INT page height, STRING filename
|
||||
!dthelpprint.prArgs: -h "%s" -f -l%d %s
|
||||
!Dthelpprint.PrArgs:
|
||||
|
||||
!! pr offset arg value order: INT col offset
|
||||
!dthelpprint.prOffsetArg: -o%d
|
||||
!Dthelpprint.PrOffsetArg:
|
||||
|
||||
!dthelpprint.manCommand: man
|
||||
!Dthelpprint.ManCommand:
|
||||
|
||||
!! man arg values order: STRING man page
|
||||
!dthelpprint.manArgs: %s
|
||||
!Dthelpprint.ManArgs:
|
||||
|
||||
!! redirect arg value order: STRING filename
|
||||
!dthelpprint.redirectCmdAndArgs: > %s
|
||||
!Dthelpprint.RedirectCmdAndArgs:
|
||||
|
||||
!dthelpprint.lpCommand:
|
||||
!Dthelpprint.LpCommand:
|
||||
|
||||
!dthelpprint.shCommand: /usr/dt/bin/dthelpprint.sh
|
||||
!Dthelpprint.ShCommand:
|
||||
|
||||
!! iconv arg values: STRING toCodeset, STRING fromCodeset, STRING srcFile, STRING destfile
|
||||
!dthelpprint.iconvCmdAndArgs: iconv -f %s -t %s %s > %s
|
||||
!Dthelpprint.IconvCmdAndArgs:
|
||||
|
||||
!!! paper info resources
|
||||
! valid values: help_papersize_letter, help_papersize_a4, help_papersize_b5,
|
||||
! help_papersize_legal, help_papersize_executive
|
||||
|
||||
!dthelpprint.printer.paperSize: help_papersize_letter
|
||||
!Dthelpprint.Printer.PaperSize:
|
||||
|
||||
!dthelpprint.printer.colsWidth:
|
||||
!Dthelpprint.Printer.ColsWidth:
|
||||
|
||||
!dthelpprint.printer.rowsHeight:
|
||||
!Dthelpprint.Printer.RowsHeight:
|
||||
|
||||
!dthelpprint.printer.colsLeftMargin:
|
||||
!Dthelpprint.Printer.ColsLeftMargin:
|
||||
|
||||
!dthelpprint.printer.colsRightMargin:
|
||||
!Dthelpprint.Printer.ColsRightMargin:
|
||||
|
||||
!dthelpprint.printer.rowsTopMargin:
|
||||
!Dthelpprint.Printer.RowsTopMargin:
|
||||
|
||||
!dthelpprint.printer.rowsBottomMargin:
|
||||
!Dthelpprint.Printer.RowsBottomMargin:
|
||||
|
||||
!!! example of a printer-specific set of info resources
|
||||
! valid values: help_papersize_letter, help_papersize_a4, help_papersize_b5,
|
||||
! help_papersize_legal, help_papersize_executive
|
||||
!dthelpprint.printer.name: laser_c4
|
||||
!Dthelpprint.Printer.Name:
|
||||
|
||||
!dthelpprint.printer.laser_c4.paperSize: help_papersize_letter
|
||||
!Dthelpprint.Printer.laser_c4.PaperSize:
|
||||
|
||||
!dthelpprint.printer.laser_c4.colsWidth:
|
||||
!Dthelpprint.Printer.laser_c4.ColsWidth:
|
||||
|
||||
!dthelpprint.printer.laser_c4.rowsHeight:
|
||||
!Dthelpprint.Printer.laser_c4.RowsHeight:
|
||||
|
||||
!dthelpprint.printer.laser_c4.colsLeftMargin:
|
||||
!Dthelpprint.Printer.laser_c4.ColsLeftMargin:
|
||||
|
||||
!dthelpprint.printer.laser_c4.colsRightMargin:
|
||||
!Dthelpprint.Printer.laser_c4.ColsRightMargin:
|
||||
|
||||
!dthelpprint.printer.laser_c4.rowsTopMargin:
|
||||
!Dthelpprint.Printer.laser_c4.RowsTopMargin:
|
||||
|
||||
!dthelpprint.printer.laser_c4.rowsBottomMargin:
|
||||
!Dthelpprint.Printer.laser_c4.RowsBottomMargin:
|
||||
|
||||
407
cde/programs/dthelp/dthelpprint/HelpPrintI.h
Normal file
407
cde/programs/dthelp/dthelpprint/HelpPrintI.h
Normal file
@@ -0,0 +1,407 @@
|
||||
#ifdef DOC
|
||||
/*===================================================================
|
||||
$FILEBEG$: HelpPrintI.h
|
||||
$COMPONENT$: dthelpprint
|
||||
$PROJECT$: Cde1
|
||||
$SYSTEM$: HPUX 9.0; AIX 3.2; SunOS 5.3
|
||||
$REVISION$: $TOG: HelpPrintI.h /main/6 1998/04/06 13:16:19 mgreess $
|
||||
$CHGLOG$:
|
||||
$COPYRIGHT$:
|
||||
(c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
(c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
(c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
(c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
|
||||
==$END$==============================================================*/
|
||||
#endif /*DOC*/
|
||||
|
||||
#ifndef HELPPRINTI_H
|
||||
#define HELPPRINTI_H
|
||||
|
||||
#define TMPFILE_PREFIX "phlp" /* max len of 4 chars */
|
||||
#define TMPFILE_SUFFIX ".txt" /* max len of 4 chars */
|
||||
|
||||
#define MAX_COMMAND_LENGTH 5120 /* max system can handle */
|
||||
|
||||
/* Message catalog support */
|
||||
#ifndef NO_MESSAGE_CATALOG
|
||||
# define _DTGETMESSAGE(set, number, str) _DtHPrGetMessage(set, number, str)
|
||||
#else
|
||||
# define _DTGETMESSAGE(set, number, str) str
|
||||
#endif
|
||||
|
||||
/* These are for Xt emulation */
|
||||
#if 0
|
||||
typedef char * XtPointer;
|
||||
typedef char * String;
|
||||
typedef int Cardinal;
|
||||
typedef char Boolean;
|
||||
|
||||
# define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
|
||||
# define XtNumber(arr) ((Cardinal) (sizeof(arr) / sizeof(arr[0])))
|
||||
#else
|
||||
# include <X11/Intrinsic.h>
|
||||
#endif
|
||||
|
||||
#define XtRefOffset(struct_base,field_offset) \
|
||||
((XtPointer *)(((unsigned long)struct_base) + (field_offset)))
|
||||
|
||||
|
||||
typedef struct __DtHPrHeadFoot
|
||||
{
|
||||
String evenHeader; /* even-page header when printing volume */
|
||||
String oddHeader; /* odd-page header when printing volume */
|
||||
String evenFooter; /* even-page footer when printing volume */
|
||||
String oddFooter; /* odd-page footer when printing volume */
|
||||
} _DtHPrHeadFoot;
|
||||
|
||||
/* This is the list of all options that controls
|
||||
the operation of dthelprint. */
|
||||
typedef struct __DtHPrOptions {
|
||||
String display;
|
||||
String printer;
|
||||
String copies;
|
||||
String outputFile;
|
||||
String paperSize;
|
||||
String rsrcname;
|
||||
String rsrcclass;
|
||||
String helpType;
|
||||
String helpVolume;
|
||||
String locationId;
|
||||
String allTopics;
|
||||
String subTopics;
|
||||
String oneTopic;
|
||||
String toc; /* table of contents of a help volume */
|
||||
String index; /* index of a help volume */
|
||||
String frontMatter; /* frontMatter of a help volume */
|
||||
_DtHPrHeadFoot tocHF; /* header / footer of table of contents */
|
||||
_DtHPrHeadFoot bodyHF; /* header / footer of body */
|
||||
_DtHPrHeadFoot indexHF; /* header / footer of index */
|
||||
String manPage;
|
||||
String stringData;
|
||||
String helpFile;
|
||||
String topicTitle;
|
||||
String echoCommand;
|
||||
String echoArgs;
|
||||
String foldCommand;
|
||||
String foldArgs;
|
||||
String prCommand;
|
||||
String prArgs;
|
||||
String prOffsetArg;
|
||||
String manCommand;
|
||||
String manArgs;
|
||||
String redirectCmdAndArgs;
|
||||
String lpCommand;
|
||||
String shCommand;
|
||||
String iconvCmdAndArgs;
|
||||
String debugHelpPrint;
|
||||
char * programName; /* value from argv[0] */
|
||||
int colsWidth; /* full width of page */
|
||||
int rowsHeight; /* full height of page */
|
||||
int colsLeftMargin; /* blank cols to leave on left */
|
||||
int colsRightMargin; /* blank cols to leave on right */
|
||||
int rowsTopMargin; /* blank rows to leave on top */
|
||||
int rowsBottomMargin; /* blank rows to leave on bottom */
|
||||
int colsTextWidth; /* width - margins */
|
||||
int rowsTextHeight; /* height - margins */
|
||||
int colsAdjLeftMargin; /* minus cols that printer cant print on */
|
||||
int colsAdjRightMargin; /* minus cols that printer cant print on */
|
||||
int rowsAdjTopMargin; /* minus rows that printer cant print on */
|
||||
int rowsAdjBottomMargin; /* minus rows that printer cant print on */
|
||||
} _DtHPrOptions, * _DtHPrOptionsPtr;
|
||||
|
||||
|
||||
/* application name and class */
|
||||
#ifdef RASTER_PRINT
|
||||
#define HELPPRINT_APPLICATION_NAME "dthelpprintrst"
|
||||
#define HELPPRINT_APPLICATION_CLASS "Dthelpprintrst"
|
||||
#else
|
||||
#define HELPPRINT_APPLICATION_NAME "dthelpprint"
|
||||
#define HELPPRINT_APPLICATION_CLASS "Dthelpprint"
|
||||
#endif
|
||||
|
||||
/* These constants are used throughout dthelpprint to specify
|
||||
command line args, resources, and arg and resource values
|
||||
AC: arg class
|
||||
AN: arg name
|
||||
RC: rsrc class
|
||||
RN: rsrc name
|
||||
RV: rsrc value
|
||||
*/
|
||||
#define RN_appname "application.name"
|
||||
#define RC_appname "Application.Name"
|
||||
#define RN_appclass "application.class"
|
||||
#define RC_appclass "Application.Class"
|
||||
|
||||
#define AN_display "-display"
|
||||
#define AC_display "-Display"
|
||||
#define RN_display ".display"
|
||||
#define RC_display ".Display"
|
||||
|
||||
#define AN_printer "-printer"
|
||||
#define AC_printer "-Printer"
|
||||
#define RN_printer ".printer"
|
||||
#define RC_printer ".Printer"
|
||||
|
||||
#define AN_copies "-copies"
|
||||
#define AC_copies "-Copies"
|
||||
#define RN_copies ".copies"
|
||||
#define RC_copies ".Copies"
|
||||
|
||||
#define AN_outputFile "-outputFile"
|
||||
#define AC_outputFile "-OutputFile"
|
||||
#define RN_outputFile ".outputFile"
|
||||
#define RC_outputFile ".OutputFile"
|
||||
|
||||
#define AN_paperSize "-paperSize"
|
||||
#define AC_paperSize "-PaperSize"
|
||||
#define RN_paperSize ".paperSize"
|
||||
#define RC_paperSize ".PaperSize"
|
||||
|
||||
#define AN_xrm "-xrm"
|
||||
|
||||
#define AN_rsrcname "-name"
|
||||
#define AC_rsrcname "-Name"
|
||||
#define RN_rsrcname ".name"
|
||||
#define RC_rsrcname ".Name"
|
||||
|
||||
#define AN_rsrcclass "-class"
|
||||
#define AC_rsrcclass "-Class"
|
||||
#define RN_rsrcclass ".class"
|
||||
#define RC_rsrcclass ".Class"
|
||||
|
||||
#define AN_helpType "-helpType"
|
||||
#define RN_helpType ".helpType"
|
||||
#define RC_helpType ".HelpType"
|
||||
|
||||
#define AN_helpVolume "-helpVolume"
|
||||
#define RN_helpVolume ".helpVolume"
|
||||
#define RC_helpVolume ".HelpVolume"
|
||||
|
||||
#define AN_locationId "-locationId"
|
||||
#define RN_locationId ".locationId"
|
||||
#define RC_locationId ".LocationId"
|
||||
|
||||
#define AN_toc "-toc"
|
||||
#define RN_toc ".toc"
|
||||
#define RC_toc ".Toc"
|
||||
|
||||
#define AN_index "-index"
|
||||
#define RN_index ".index"
|
||||
#define RC_index ".Index"
|
||||
|
||||
#define AN_frontMatter "-frontMatter"
|
||||
#define RN_frontMatter ".frontMatter"
|
||||
#define RC_frontMatter ".FrontMatter"
|
||||
|
||||
#define AN_allTopics "-allTopics"
|
||||
#define RN_allTopics ".allTopics"
|
||||
#define RC_allTopics ".AllTopics"
|
||||
|
||||
#define AN_recurse "-R" /* VUE 3.0 helpprint name for -subTopics */
|
||||
#define RN_recurse "-recurse" /* VUE 3.0 helpprint name for .subTopics */
|
||||
#define RC_recurse "-Recurse" /* VUE 3.0 helpprint name for .SubTopics */
|
||||
|
||||
#define AN_subTopics "-subTopics"
|
||||
#define RN_subTopics ".subTopics"
|
||||
#define RC_subTopics ".SubTopics"
|
||||
|
||||
#define AN_oneTopic "-oneTopic"
|
||||
#define RN_oneTopic ".oneTopic"
|
||||
#define RC_oneTopic ".OneTopic"
|
||||
|
||||
#define AN_manPage "-manPage"
|
||||
#define RN_manPage ".manPage"
|
||||
#define RC_manPage ".ManPage"
|
||||
|
||||
#define AN_stringData "-stringData"
|
||||
#define RN_stringData ".stringData"
|
||||
#define RC_stringData ".StringData"
|
||||
|
||||
#define AN_helpFile "-helpFile"
|
||||
#define RN_helpFile ".helpFile"
|
||||
#define RC_helpFile ".HelpFile"
|
||||
|
||||
#define AN_topicTitle "-topicTitle"
|
||||
#define AC_topicTitle "-TopicTitle"
|
||||
#define RN_topicTitle ".topicTitle"
|
||||
#define RC_topicTitle ".TopicTitle"
|
||||
|
||||
/* page header and footer */
|
||||
#define AN_evenTocFooter "-evenTocFooter"
|
||||
#define RN_evenTocFooter ".evenTocFooter"
|
||||
#define RC_evenTocFooter ".EvenTocFooter"
|
||||
|
||||
#define AN_oddTocFooter "-oddTocFooter"
|
||||
#define RN_oddTocFooter ".oddTocFooter"
|
||||
#define RC_oddTocFooter ".OddTocFooter"
|
||||
|
||||
#define AN_evenTocHeader "-evenTocHeader"
|
||||
#define RN_evenTocHeader ".evenTocHeader"
|
||||
#define RC_evenTocHeader ".EvenTocHeader"
|
||||
|
||||
#define AN_oddTocHeader "-oddTocHeader"
|
||||
#define RN_oddTocHeader ".oddTocHeader"
|
||||
#define RC_oddTocHeader ".OddTocHeader"
|
||||
|
||||
#define AN_evenBodyFooter "-evenBodyFooter"
|
||||
#define RN_evenBodyFooter ".evenBodyFooter"
|
||||
#define RC_evenBodyFooter ".EvenBodyFooter"
|
||||
|
||||
#define AN_oddBodyFooter "-oddBodyFooter"
|
||||
#define RN_oddBodyFooter ".oddBodyFooter"
|
||||
#define RC_oddBodyFooter ".OddBodyFooter"
|
||||
|
||||
#define AN_evenBodyHeader "-evenBodyHeader"
|
||||
#define RN_evenBodyHeader ".evenBodyHeader"
|
||||
#define RC_evenBodyHeader ".EvenBodyHeader"
|
||||
|
||||
#define AN_oddBodyHeader "-oddBodyHeader"
|
||||
#define RN_oddBodyHeader ".oddBodyHeader"
|
||||
#define RC_oddBodyHeader ".OddBodyHeader"
|
||||
|
||||
#define AN_evenIndexFooter "-evenIndexFooter"
|
||||
#define RN_evenIndexFooter ".evenIndexFooter"
|
||||
#define RC_evenIndexFooter ".EvenIndexFooter"
|
||||
|
||||
#define AN_oddIndexFooter "-oddIndexFooter"
|
||||
#define RN_oddIndexFooter ".oddIndexFooter"
|
||||
#define RC_oddIndexFooter ".OddIndexFooter"
|
||||
|
||||
#define AN_evenIndexHeader "-evenIndexHeader"
|
||||
#define RN_evenIndexHeader ".evenIndexHeader"
|
||||
#define RC_evenIndexHeader ".EvenIndexHeader"
|
||||
|
||||
#define AN_oddIndexHeader "-oddIndexHeader"
|
||||
#define RN_oddIndexHeader ".oddIndexHeader"
|
||||
#define RC_oddIndexHeader ".OddIndexHeader"
|
||||
|
||||
/* star resource matches all comers */
|
||||
#define STAR_RN_topicTitle "*topicTitle"
|
||||
#define STAR_RC_topicTitle "*TopicTitle"
|
||||
|
||||
/* print activity control */
|
||||
#define RN_echoCommand ".echoCommand"
|
||||
#define RC_echoCommand ".EchoCommand"
|
||||
|
||||
#define RN_echoArgs ".echoArgs"
|
||||
#define RC_echoArgs ".EchoArgs"
|
||||
|
||||
#define RN_foldCommand ".foldCommand"
|
||||
#define RC_foldCommand ".FoldCommand"
|
||||
|
||||
#define RN_foldArgs ".foldArgs"
|
||||
#define RC_foldArgs ".FoldArgs"
|
||||
|
||||
#define RN_prCommand ".prCommand"
|
||||
#define RC_prCommand ".PrCommand"
|
||||
|
||||
#define RN_prArgs ".prArgs"
|
||||
#define RC_prArgs ".PrArgs"
|
||||
|
||||
#define RN_prOffsetArg ".prOffsetArg"
|
||||
#define RC_prOffsetArg ".PrOffsetArg"
|
||||
|
||||
#define RN_manCommand ".manCommand"
|
||||
#define RC_manCommand ".ManCommand"
|
||||
|
||||
#define RN_manArgs ".manArgs"
|
||||
#define RC_manArgs ".ManArgs"
|
||||
|
||||
#define RN_redirectCmdAndArgs ".redirectCmdAndArgs"
|
||||
#define RC_redirectCmdAndArgs ".RedirectCmdAndArgs"
|
||||
|
||||
#define RN_lpCommand ".lpCommand"
|
||||
#define RC_lpCommand ".LpCommand"
|
||||
|
||||
#define RN_shCommand ".shCommand"
|
||||
#define RC_shCommand ".ShCommand"
|
||||
|
||||
#define RN_iconvCmdAndArgs ".iconvCmdAndArgs"
|
||||
#define RC_iconvCmdAndArgs ".IconvCmdAndArgs"
|
||||
|
||||
/* resources */
|
||||
#define RN_colsWidth ".colsWidth"
|
||||
#define RC_colsWidth ".ColsWidth"
|
||||
|
||||
#define RN_rowsHeight ".rowsHeight"
|
||||
#define RC_rowsHeight ".RowsHeight"
|
||||
|
||||
#define RN_colsLeftMargin ".colsLeftMargin"
|
||||
#define RC_colsLeftMargin ".ColsLeftMargin"
|
||||
|
||||
#define RN_colsRightMargin ".colsRightMargin"
|
||||
#define RC_colsRightMargin ".ColsRightMargin"
|
||||
|
||||
#define RN_rowsTopMargin ".rowsTopMargin"
|
||||
#define RC_rowsTopMargin ".RowsTopMargin"
|
||||
|
||||
#define RN_rowsBottomMargin ".rowsBottomMargin"
|
||||
#define RC_rowsBottomMargin ".RowsBottomMargin"
|
||||
|
||||
/* turn on to debug */
|
||||
#define RN_debugHelpPrint ".debugHelpPrint"
|
||||
#define RC_debugHelpPrint ".DebugHelpPrint"
|
||||
|
||||
/* to determine if debug is on */
|
||||
#define STAR_RN_debugHelpPrint "*debugHelpPrint"
|
||||
#define STAR_RC_debugHelpPrint "*DebugHelpPrint"
|
||||
|
||||
/* not currently used */
|
||||
#define RN_leading ".leading"
|
||||
#define RC_leading ".Leading"
|
||||
|
||||
#define STAR_RN_helpColorUse "*helpColorUse"
|
||||
|
||||
|
||||
/* resource values */
|
||||
#define RV_letter "help_papersize_letter"
|
||||
#define RV_a4 "help_papersize_a4"
|
||||
#define RV_b5 "help_papersize_b5"
|
||||
#define RV_legal "help_papersize_legal"
|
||||
#define RV_executive "help_papersize_executive"
|
||||
|
||||
#define RV_bitonal "bitonal"
|
||||
|
||||
|
||||
/*========= Prototypes ===========*/
|
||||
|
||||
int _DtHPrPrintStringData(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options);
|
||||
int _DtHPrPrintDynamicStringData(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options);
|
||||
int _DtHPrPrintManPage(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options);
|
||||
int _DtHPrPrintHelpFile(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options);
|
||||
int _DtHPrPrintHelpTopic(
|
||||
Display * dpy,
|
||||
_DtHPrOptions * options);
|
||||
void _DtHPrBuildResourceDb(
|
||||
int * argc,
|
||||
char * * argv,
|
||||
XrmDatabase * appDB,
|
||||
Display * * pDpy);
|
||||
void _DtHPrGetResources(
|
||||
XrmDatabase db,
|
||||
_DtHPrOptions * options);
|
||||
char * _DtHPrCreateTmpFile(
|
||||
char * prefix,
|
||||
char * suffix);
|
||||
int _DtHPrGenFileOrPrint(
|
||||
_DtHPrOptions * options,
|
||||
char * userfile,
|
||||
char * printCommand);
|
||||
void _DtHPrGetPrOffsetArg(
|
||||
_DtHPrOptions * options,
|
||||
char * argStr);
|
||||
char * _DtHPrGetMessage(
|
||||
int set,
|
||||
int n,
|
||||
char *s);
|
||||
|
||||
#endif /* DTHELPRPINTP_H */
|
||||
|
||||
22
cde/programs/dthelp/dthelpprint/Imakefile
Normal file
22
cde/programs/dthelp/dthelpprint/Imakefile
Normal file
@@ -0,0 +1,22 @@
|
||||
XCOMM $TOG: Imakefile /main/11 1997/05/02 12:24:38 samborn $
|
||||
PROGRAMS = dthelpprint
|
||||
|
||||
INCLUDES = -I. -I$(DTHELPSRC)
|
||||
DEFINES = -DDTLIB $(ICONV_INBUF_DEFINE) \
|
||||
-DCDE_CONFIGURATION_TOP='"$(CDE_CONFIGURATION_TOP)"' \
|
||||
-DCDE_INSTALLATION_TOP='"$(CDE_INSTALLATION_TOP)"'
|
||||
|
||||
DEPLIBS = $(DEPDTHELPLIB) $(DEPDTSVCLIB) $(DEPTTLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
|
||||
LOCAL_LIBRARIES = $(DTHELPLIB) $(DTSVCLIB) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB)
|
||||
|
||||
/* Sun needs the widechar library */
|
||||
#ifdef SunArchitecture
|
||||
SYS_LIBRARIES = DtClientSysLibs -lw $(CXXLIB)
|
||||
#else
|
||||
SYS_LIBRARIES = DtClientSysLibs $(CXXLIB)
|
||||
#endif
|
||||
|
||||
SRCS = Main.c Initialize.c PrintUtil.c PrintTopics.c PrintManStrFile.c version.c
|
||||
OBJS = Main.o Initialize.o PrintUtil.o PrintTopics.o PrintManStrFile.o version.o
|
||||
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
1522
cde/programs/dthelp/dthelpprint/Initialize.c
Normal file
1522
cde/programs/dthelp/dthelpprint/Initialize.c
Normal file
File diff suppressed because it is too large
Load Diff
132
cde/programs/dthelp/dthelpprint/Main.c
Normal file
132
cde/programs/dthelp/dthelpprint/Main.c
Normal file
@@ -0,0 +1,132 @@
|
||||
#ifdef DOC
|
||||
/*===================================================================
|
||||
$FILEBEG$: Main.c
|
||||
$COMPONENT$: dthelpprint
|
||||
$PROJECT$: Cde1
|
||||
$SYSTEM$: HPUX 9.0; AIX 3.2; SunOS 5.3
|
||||
$REVISION$: $TOG: Main.c /main/6 1998/04/06 13:16:42 mgreess $
|
||||
$CHGLOG$:
|
||||
$COPYRIGHT$:
|
||||
(c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
(c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
(c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
(c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
|
||||
==$END$==============================================================*/
|
||||
#endif /*DOC*/
|
||||
|
||||
/*
|
||||
* Draws several different width lines on the same y axis
|
||||
* to determine how the lines are drawn.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xresource.h>
|
||||
|
||||
#include <Dt/Help.h>
|
||||
|
||||
#include "HelpPrintI.h"
|
||||
|
||||
|
||||
/*======== default values ==============*/
|
||||
|
||||
/*======== helper values ===============*/
|
||||
#define EOS '\0'
|
||||
#define EMPTY_STR s_EmptyStr
|
||||
|
||||
#define MASET 6 /* message catalog set */
|
||||
|
||||
static char s_EmptyStr[1] = { EOS };
|
||||
|
||||
|
||||
#if DOC
|
||||
/*===================================================================
|
||||
$FUNBEG$: main()
|
||||
$1LINER$: main() routine of helpprint
|
||||
$DESCRIPT$:
|
||||
$WARNING$:
|
||||
main() "knows" that we aren't using Xt in this program, and
|
||||
sets the Display->db field explicitly. That field is a Display
|
||||
structure member not used by X. It is used by Xt; if Xt is used
|
||||
by dthelpprint, this part of the code must be changed.
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
int main(
|
||||
int argc,
|
||||
char * * argv)
|
||||
{ /*$CODE$*/
|
||||
XrmDatabase appDB = NULL;
|
||||
_DtHPrOptions options;
|
||||
Display * dpy = NULL;
|
||||
int helpType;
|
||||
int status;
|
||||
|
||||
/* init first option */
|
||||
options.programName = argv[0];
|
||||
|
||||
/********************************************
|
||||
* Read resources and open printer
|
||||
*****************************************/
|
||||
|
||||
setlocale(LC_ALL,EMPTY_STR); /* set to user's desired locale */
|
||||
|
||||
_DtHPrBuildResourceDb(&argc, argv, &appDB, &dpy);
|
||||
|
||||
_DtHPrGetResources(appDB,&options);
|
||||
|
||||
if (dpy)
|
||||
XrmSetDatabase(dpy,appDB); /* WARNING: Xt also uses the db member of the
|
||||
Display structure. if Xt is used by
|
||||
dthelpprint, this part of the code must be
|
||||
changed. */
|
||||
|
||||
if (options.debugHelpPrint)
|
||||
{
|
||||
XrmPutFileDatabase(appDB,"db.dthelpprint"); /* dump rsrc for debug */
|
||||
system("cat db.dthelpprint|fgrep -i print");
|
||||
}
|
||||
|
||||
/****************************************
|
||||
* Evaluate helpType and activate printing
|
||||
*************************************/
|
||||
helpType = atoi(options.helpType);
|
||||
|
||||
if (helpType == DtHELP_TYPE_STRING)
|
||||
{
|
||||
status = _DtHPrPrintStringData(dpy, &options);
|
||||
exit(status); /* EXIT */
|
||||
}
|
||||
else if (helpType == DtHELP_TYPE_DYNAMIC_STRING)
|
||||
{
|
||||
status = _DtHPrPrintDynamicStringData(dpy, &options);
|
||||
exit(status); /* EXIT */
|
||||
}
|
||||
else if (helpType == DtHELP_TYPE_MAN_PAGE)
|
||||
{
|
||||
status = _DtHPrPrintManPage(dpy, &options);
|
||||
exit(status); /* EXIT */
|
||||
}
|
||||
else if (helpType == DtHELP_TYPE_FILE)
|
||||
{
|
||||
status = _DtHPrPrintHelpFile(dpy, &options);
|
||||
exit(status); /* EXIT */
|
||||
}
|
||||
else if (helpType == DtHELP_TYPE_TOPIC)
|
||||
{
|
||||
status = _DtHPrPrintHelpTopic(dpy,&options);
|
||||
exit(status); /* EXIT */
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(
|
||||
stderr,
|
||||
_DTGETMESSAGE(MASET, 1, "%s Error: Illegal helpType %d.\n"),
|
||||
argv[0], helpType);
|
||||
exit(1); /* EXIT */
|
||||
}
|
||||
exit(1); /* EXIT */
|
||||
} /*$END$*/
|
||||
|
||||
267
cde/programs/dthelp/dthelpprint/PrintManStrFile.c
Normal file
267
cde/programs/dthelp/dthelpprint/PrintManStrFile.c
Normal file
@@ -0,0 +1,267 @@
|
||||
#if DOC
|
||||
/*===================================================================
|
||||
$FILEBEG$: PrintManStrFile.c
|
||||
$COMPONENT$: dthelpprint
|
||||
$PROJECT$: Cde1
|
||||
$SYSTEM$: HPUX 9.0; AIX 3.2; SunOS 5.3
|
||||
$REVISION$: $XConsortium: PrintManStrFile.c /main/4 1996/10/30 11:35:27 drk $
|
||||
$CHGLOG$:
|
||||
$COPYRIGHT$:
|
||||
(c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
(c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
(c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
(c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
|
||||
==$END$==============================================================*/
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#if defined(sun)
|
||||
#include <locale.h>
|
||||
#else
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "HelpPrintI.h"
|
||||
|
||||
/*======== boundary values ==============*/
|
||||
#define MAX_COMMAND_LENGTH 5120 /* max system can handle */
|
||||
|
||||
/*======== dthelpprint.sh options ==============*/
|
||||
|
||||
/*======== helper values ===============*/
|
||||
#define EOS '\0'
|
||||
#define EMPTY_STR s_EmptyStr
|
||||
|
||||
#define PMSET 4 /* message catalog set */
|
||||
|
||||
/*======== helper variables ===============*/
|
||||
static char s_EmptyStr[1] = { EOS };
|
||||
|
||||
/*======== data structs ==============*/
|
||||
|
||||
/*======== static variables ===============*/
|
||||
|
||||
/*======== functions ==============*/
|
||||
|
||||
#if DOC
|
||||
===================================================================
|
||||
$FUNBEG$: _DtHPrPrintStringData()
|
||||
$1LINER$: Writes string data to file and then sends to printer
|
||||
$DESCRIPT$:
|
||||
Writes string data to file and then sends to printer
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
int _DtHPrPrintStringData(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options)
|
||||
{ /*$CODE$*/
|
||||
char *printCommand;
|
||||
char cmdFormat[100];
|
||||
char prOffsetArg[30];
|
||||
int status;
|
||||
|
||||
if ( NULL == options->stringData )
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,1,
|
||||
"%s: Error: helpType is string, "
|
||||
"but no stringData specified.\n"),
|
||||
options->programName);
|
||||
|
||||
return 1; /* RETURN */
|
||||
}
|
||||
|
||||
/* Alloc max shell command line len */
|
||||
printCommand = malloc(MAX_COMMAND_LENGTH*sizeof(char));
|
||||
if (printCommand == NULL)
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,5,
|
||||
"%s: Error: memory allocation failed\n"),
|
||||
options->programName );
|
||||
|
||||
return 2; /* RETURN error */
|
||||
}
|
||||
|
||||
/** generate the command **/
|
||||
_DtHPrGetPrOffsetArg(options,prOffsetArg);
|
||||
sprintf(cmdFormat, "%s %s|%s %s|%s %s %s", /* echo | fold | pr */
|
||||
options->echoCommand, options->echoArgs,
|
||||
options->foldCommand, options->foldArgs,
|
||||
options->prCommand, prOffsetArg, options->prArgs);
|
||||
sprintf(printCommand, cmdFormat,
|
||||
options->stringData, /* echo */
|
||||
options->colsTextWidth, EMPTY_STR, /* fold */
|
||||
options->topicTitle, options->rowsHeight, EMPTY_STR); /* pr */
|
||||
|
||||
return _DtHPrGenFileOrPrint(options,"String",printCommand);
|
||||
} /*$END$*/
|
||||
|
||||
|
||||
|
||||
#if DOC
|
||||
===================================================================
|
||||
$FUNBEG$: _DtHPrPrintDynamicStringData()
|
||||
$1LINER$: Writes string data to file, formats it, then sends to printer
|
||||
$DESCRIPT$:
|
||||
Writes string data to file, formats it, then sends to printer
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
int _DtHPrPrintDynamicStringData(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options)
|
||||
{ /*$CODE$*/
|
||||
char *printCommand;
|
||||
char cmdFormat[100];
|
||||
char prOffsetArg[30];
|
||||
int status;
|
||||
|
||||
if ( NULL == options->stringData )
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,2,
|
||||
"%s: Error: helpType is dynamic string, "
|
||||
"but no stringData specified.\n"),
|
||||
options->programName);
|
||||
|
||||
return 1; /* RETURN */
|
||||
}
|
||||
|
||||
/* Alloc max shell command line len */
|
||||
printCommand = malloc(MAX_COMMAND_LENGTH*sizeof(char));
|
||||
if (printCommand == NULL)
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,5,
|
||||
"%s: Error: memory allocation failed\n"),
|
||||
options->programName );
|
||||
|
||||
return 2; /* RETURN error */
|
||||
}
|
||||
|
||||
/** generate the command **/
|
||||
_DtHPrGetPrOffsetArg(options,prOffsetArg);
|
||||
sprintf(cmdFormat, "%s %s|%s %s|%s %s %s", /* echo | fold | pr */
|
||||
options->echoCommand, options->echoArgs,
|
||||
options->foldCommand, options->foldArgs,
|
||||
options->prCommand, prOffsetArg, options->prArgs);
|
||||
sprintf(printCommand, cmdFormat,
|
||||
options->stringData, /* echo */
|
||||
options->colsTextWidth, EMPTY_STR, /* fold */
|
||||
options->topicTitle, options->rowsHeight, EMPTY_STR); /* pr */
|
||||
|
||||
|
||||
return _DtHPrGenFileOrPrint(options,"String",printCommand);
|
||||
} /*$END$*/
|
||||
|
||||
|
||||
#if DOC
|
||||
===================================================================
|
||||
$FUNBEG$: _DtHPrPrintManPage()
|
||||
$1LINER$: Dumps formatted man page to file and then sends to printer
|
||||
$DESCRIPT$:
|
||||
Dumps formatted man page to file and then sends to printer
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
int _DtHPrPrintManPage(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options)
|
||||
{ /*$CODE$*/
|
||||
char *printCommand;
|
||||
char cmdFormat[100];
|
||||
int status;
|
||||
|
||||
if ( NULL == options->manPage )
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,3,
|
||||
"%s: Error: helpType is man page, "
|
||||
"but no manPage specified.\n"),
|
||||
options->programName);
|
||||
|
||||
return 1; /* RETURN */
|
||||
}
|
||||
|
||||
/* Alloc max shell command line len */
|
||||
printCommand = malloc(MAX_COMMAND_LENGTH*sizeof(char));
|
||||
if (printCommand == NULL)
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,5,
|
||||
"%s: Error: memory allocation failed\n"),
|
||||
options->programName );
|
||||
|
||||
return 2; /* RETURN error */
|
||||
}
|
||||
|
||||
/** generate the command **/
|
||||
sprintf(cmdFormat, "%s %s", /* man */
|
||||
options->manCommand, options->manArgs);
|
||||
sprintf(printCommand, cmdFormat,
|
||||
options->manPage); /* man */
|
||||
|
||||
|
||||
return _DtHPrGenFileOrPrint(options,options->manPage,printCommand);
|
||||
} /*$END$*/
|
||||
|
||||
|
||||
|
||||
#if DOC
|
||||
===================================================================
|
||||
$FUNBEG$: _DtHPrPrintHelpFile()
|
||||
$1LINER$: Format file and then sends to printer
|
||||
$DESCRIPT$:
|
||||
Format file and then sends to printer
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
int _DtHPrPrintHelpFile(
|
||||
Display *dpy,
|
||||
_DtHPrOptions * options)
|
||||
{ /*$CODE$*/
|
||||
char *printCommand;
|
||||
char cmdFormat[100];
|
||||
char prOffsetArg[30];
|
||||
int status;
|
||||
|
||||
if ( NULL == options->helpFile )
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,4,
|
||||
"%s: Error: helpType is file, "
|
||||
"but no helpFile specified.\n"),
|
||||
options->programName);
|
||||
|
||||
return 1; /* RETURN error */
|
||||
}
|
||||
|
||||
/* Alloc max shell command line len */
|
||||
printCommand = malloc(MAX_COMMAND_LENGTH*sizeof(char));
|
||||
if (printCommand == NULL)
|
||||
{
|
||||
fprintf(stderr, _DTGETMESSAGE(PMSET,5,
|
||||
"%s: Error: memory allocation failed\n"),
|
||||
options->programName );
|
||||
|
||||
return 2; /* RETURN error */
|
||||
}
|
||||
|
||||
/** generate the command **/
|
||||
_DtHPrGetPrOffsetArg(options,prOffsetArg);
|
||||
sprintf(cmdFormat, "%s %s|%s %s %s", /* fold | pr */
|
||||
options->foldCommand, options->foldArgs,
|
||||
options->prCommand, prOffsetArg, options->prArgs);
|
||||
sprintf(printCommand, cmdFormat,
|
||||
options->colsTextWidth, options->helpFile, /* fold */
|
||||
options->topicTitle, options->rowsHeight, EMPTY_STR); /* pr */
|
||||
|
||||
return _DtHPrGenFileOrPrint(options,options->helpFile,printCommand);
|
||||
} /*$END$*/
|
||||
|
||||
2859
cde/programs/dthelp/dthelpprint/PrintTopics.c
Normal file
2859
cde/programs/dthelp/dthelpprint/PrintTopics.c
Normal file
File diff suppressed because it is too large
Load Diff
267
cde/programs/dthelp/dthelpprint/PrintUtil.c
Normal file
267
cde/programs/dthelp/dthelpprint/PrintUtil.c
Normal file
@@ -0,0 +1,267 @@
|
||||
#if DOC
|
||||
/*===================================================================
|
||||
$FILEBEG$: PrintUtil.c
|
||||
$COMPONENT$: dthelpprint
|
||||
$PROJECT$: Cde1
|
||||
$SYSTEM$: HPUX 9.0; AIX 3.2; SunOS 5.3
|
||||
$REVISION$: $TOG: PrintUtil.c /main/6 1999/02/05 18:57:07 mgreess $
|
||||
$CHGLOG$:
|
||||
$COPYRIGHT$:
|
||||
(c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
(c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
(c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
(c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
|
||||
==$END$==============================================================*/
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <nl_types.h> /* for message cat processing */
|
||||
#if defined(sun)
|
||||
#include <locale.h>
|
||||
#else
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "HelpPrintI.h"
|
||||
|
||||
/*======== flexible constsnts ==============*/
|
||||
/* message catalog file */
|
||||
#define HELPPRINT_CAT_WITH_SUFFIX "dthelpprint.cat"
|
||||
#define HELPPRINT_CAT "dthelpprint"
|
||||
|
||||
/*======== dthelpprint.sh options ==============*/
|
||||
#define OPT_LPDEST "-d"
|
||||
#define OPT_COMMAND "-m"
|
||||
#define OPT_COPYCOUNT "-n"
|
||||
#define OPT_USERFILE "-u"
|
||||
#define OPT_FILE "-f"
|
||||
#define OPT_SILENT "-s"
|
||||
#define OPT_FILEREMOVE "-e"
|
||||
#define OPT_RAW "-w"
|
||||
|
||||
/*======== helper values ===============*/
|
||||
#define EOS '\0'
|
||||
|
||||
/*======== helper variables ===============*/
|
||||
|
||||
/* To do:
|
||||
* check roman 8/Latin 1
|
||||
* check PAGER env variable
|
||||
* do character wrap
|
||||
*/
|
||||
|
||||
/*======== data structs ==============*/
|
||||
|
||||
/*======== static variables ===============*/
|
||||
|
||||
/*======== functions ==============*/
|
||||
#if DOC
|
||||
===================================================================
|
||||
$PFUNBEG$: PutOpt()
|
||||
$1LINER$: Concats option and value strings into cmd str
|
||||
$DESCRIPT$:
|
||||
Concats option and value strings into cmd str
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
static
|
||||
void PutOpt(
|
||||
char * cmdStr,
|
||||
char * option,
|
||||
char * value,
|
||||
Boolean optionHasValue)
|
||||
{ /*$CODE$*/
|
||||
char * start;
|
||||
char * fmt;
|
||||
|
||||
/* check params */
|
||||
if ( option == NULL
|
||||
|| option[0] == EOS
|
||||
|| ( optionHasValue == True
|
||||
&& (value == NULL || value[0] == EOS) ) )
|
||||
return; /* RETURN */
|
||||
|
||||
start = &cmdStr[strlen(cmdStr)];
|
||||
if ( value == NULL ) fmt = " %s";
|
||||
else fmt = " %s '%s'";
|
||||
sprintf(start,fmt,option,value);
|
||||
} /*$END$*/
|
||||
|
||||
|
||||
#if DOC
|
||||
===================================================================
|
||||
$FUNBEG$: _DtHPrGetPrOffsetArg()
|
||||
$1LINER$: Builds the pr offset argument string, if needed
|
||||
$DESCRIPT$:
|
||||
Concats option and value strings into cmd str
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
void _DtHPrGetPrOffsetArg(
|
||||
_DtHPrOptions * options,
|
||||
char * argStr)
|
||||
{ /*$CODE$*/
|
||||
if ( options->outputFile && options->outputFile[0] != EOS )
|
||||
argStr[0] = EOS;
|
||||
else
|
||||
sprintf(argStr,options->prOffsetArg, options->colsAdjLeftMargin);
|
||||
} /*$END$*/
|
||||
|
||||
|
||||
#if DOC
|
||||
===================================================================
|
||||
$FUNBEG$: _DtHPrGenFileOrPrint()
|
||||
$1LINER$: Executes print Command to generate file; prints if needed
|
||||
$DESCRIPT$:
|
||||
Executes the printCommand that is passed in to generate
|
||||
either the desired output file or to print the results of
|
||||
the command. If printing the results, the results are first
|
||||
put in a temporary file, which is then printed indirectly
|
||||
by invoking a shell script that should print the file. The
|
||||
temp file is deleted after the shell script executes.
|
||||
$RETURNS$:
|
||||
If generating a file: result of system(printCommand)
|
||||
If printing a file: result of system(printCommand) if fails
|
||||
result of system("sh -c <shellCommand>") otherwise
|
||||
$ARGS$:
|
||||
printCommand: should pt to a very large (e.g. >5000 char) string
|
||||
that can be modified by this routine
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
int _DtHPrGenFileOrPrint(
|
||||
_DtHPrOptions * options,
|
||||
char * userfile,
|
||||
char * printCommand)
|
||||
{ /*$CODE$*/
|
||||
int status;
|
||||
char * tmpfile;
|
||||
char cmdFormat[30];
|
||||
|
||||
/* put into specified output file?? */
|
||||
if (options->outputFile[0] != EOS)
|
||||
{
|
||||
strcat(printCommand," ");
|
||||
sprintf(&printCommand[strlen(printCommand)],
|
||||
options->redirectCmdAndArgs,
|
||||
options->outputFile ); /* file */
|
||||
if(options->debugHelpPrint) printf("%s\n",printCommand);
|
||||
return (system(printCommand)); /* RETURN */
|
||||
}
|
||||
|
||||
/* put into private tmp file */
|
||||
strcat(printCommand," ");
|
||||
tmpfile = _DtHPrCreateTmpFile(TMPFILE_PREFIX,TMPFILE_SUFFIX);
|
||||
sprintf(&printCommand[strlen(printCommand)],
|
||||
options->redirectCmdAndArgs,
|
||||
tmpfile ); /* file */
|
||||
|
||||
if(options->debugHelpPrint)
|
||||
printf("%s\n",printCommand);
|
||||
|
||||
strcat(printCommand,"\n");
|
||||
if ( (status = system(printCommand))!= 0)
|
||||
{
|
||||
unlink(tmpfile);
|
||||
return status; /* RETURN */
|
||||
}
|
||||
|
||||
/* make sure there is a DISPLAY environment variable */
|
||||
{
|
||||
char *dispfmt = "DISPLAY=%s";
|
||||
char *dispenv = malloc(strlen(dispfmt) + strlen(options->display) + 1);
|
||||
sprintf(dispenv, dispfmt, options->display);
|
||||
putenv(dispenv);
|
||||
}
|
||||
|
||||
/* put the shell print script in there */
|
||||
sprintf(printCommand,"%s", options->shCommand,True);
|
||||
|
||||
/* set all the options that are IPC to the print script */
|
||||
PutOpt(printCommand,OPT_LPDEST,options->printer,True);
|
||||
PutOpt(printCommand,OPT_COMMAND,options->lpCommand,True);
|
||||
PutOpt(printCommand,OPT_COPYCOUNT,options->copies,True);
|
||||
PutOpt(printCommand,OPT_SILENT,NULL,False);
|
||||
PutOpt(printCommand,OPT_FILEREMOVE,NULL,False);
|
||||
PutOpt(printCommand,OPT_FILE,tmpfile,True);
|
||||
PutOpt(printCommand,OPT_USERFILE,userfile,True);
|
||||
|
||||
/* execute the shell command to cause printing */
|
||||
if(options->debugHelpPrint) printf("%s\n",printCommand);
|
||||
status = system(printCommand);
|
||||
|
||||
/* unlink(tmpfile); ** NOTE: don't unlink; let the printCommand do it */
|
||||
/* note the DTPRINTFILEREMOVE env var setting above */
|
||||
|
||||
return(status);
|
||||
} /*$END$*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef NO_MESSAGE_CATALOG
|
||||
#if DOC
|
||||
===================================================================
|
||||
$FUNBEG$: _DtHPrGetMessage()
|
||||
$1LINER$: Gets a message string from the msg cat; uses dflt if no msg
|
||||
$DESCRIPT$:
|
||||
Gets a message string from the msg cat; uses dflt if no message defined
|
||||
or LANG is undefined or "C".
|
||||
$RETURNS$:
|
||||
$ARGS$:
|
||||
========================================================$SKIP$=====*/
|
||||
#endif /*DOC*/
|
||||
|
||||
char * _DtHPrGetMessage(
|
||||
int set,
|
||||
int n,
|
||||
char *s)
|
||||
{ /*$CODE$*/
|
||||
char *msg;
|
||||
char *lang;
|
||||
nl_catd catopen();
|
||||
char *catgets();
|
||||
static int s_First = 1;
|
||||
static nl_catd s_Nlmsg_fd;
|
||||
static char * s_CatFileName = NULL;
|
||||
|
||||
if ( s_First )
|
||||
{
|
||||
/* Setup our default message catalog names if none have been set! */
|
||||
if (s_CatFileName == NULL)
|
||||
{
|
||||
/* Setup the short and long versions */
|
||||
#ifdef __ultrix
|
||||
s_CatFileName = strdup(HELPPRINT_CAT_WITH_SUFFIX);
|
||||
#else
|
||||
s_CatFileName = strdup(HELPPRINT_CAT);
|
||||
#endif
|
||||
}
|
||||
s_First = 0;
|
||||
|
||||
lang = (char *) getenv ("LANG");
|
||||
|
||||
/* If LANG is not set or if LANG=C, then there
|
||||
* is no need to open the message catalog - just
|
||||
* return the built-in string "s". */
|
||||
if (!lang || !(strcmp (lang, "C")))
|
||||
s_Nlmsg_fd = (nl_catd) -1;
|
||||
else
|
||||
s_Nlmsg_fd = catopen(s_CatFileName, 0);
|
||||
} /* end of first-time processing */
|
||||
|
||||
msg = catgets(s_Nlmsg_fd,set,n,s);
|
||||
return (msg);
|
||||
|
||||
}
|
||||
#endif /* NO_MESSAGE_CATALOG */
|
||||
|
||||
|
||||
|
||||
138
cde/programs/dthelp/dthelpprint/dthelpprint.msg
Normal file
138
cde/programs/dthelp/dthelpprint/dthelpprint.msg
Normal file
@@ -0,0 +1,138 @@
|
||||
$ $XConsortium: dthelpprint.msg /main/3 1995/11/07 13:18:21 rswiston $
|
||||
$ *************************************<+>*************************************
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** File: dthelpprint.msg
|
||||
$ **
|
||||
$ ** Project: Cde1 Help
|
||||
$ **
|
||||
$ ** Description:
|
||||
$ ** -----------
|
||||
$ ** This file is the source for the message catalog for dthelpprint
|
||||
$ **
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
$ ** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
$ ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
$ ** (c) Copyright 1993, 1994 Unix System Labs, Inc.,a subsidiary of Novell,Inc.
|
||||
$ ** All Rights reserved
|
||||
$ **
|
||||
$ **
|
||||
$ ** There are two types of messages in this file:
|
||||
$ **
|
||||
$ ** 1) Messages that appear in printed output
|
||||
$ ** These messages are the default and they should all be localized.
|
||||
$ ** These messages are marked with LOCALIZE THESE MESSAGES.
|
||||
$ **
|
||||
$ ** 2) Messages that should not be localized.
|
||||
$ ** These messages are marked with DO NOT LOCALIZE THESE MESSAGES.
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ **
|
||||
$ ** ------------------------- MODIFICATION RECORD --------------------------
|
||||
$ * Major Mods, 7/11/94 for dthelpprint
|
||||
$ *
|
||||
$ ** ----------------------- MODIFICATION RECORD END ------------------------
|
||||
$ *****************************************************************************
|
||||
$ *************************************<+>*************************************
|
||||
|
||||
$ Use the double quote char around all messages
|
||||
$quote "
|
||||
|
||||
$set 2
|
||||
$ ***** Module: PrintUtil.c *****
|
||||
$
|
||||
|
||||
$set 3
|
||||
$ ***** Module: PrintTopics.c *****
|
||||
$
|
||||
$ ** LOCALIZE THESE MESSAGES **
|
||||
1 "%s Error: helpType is topic, but no helpVolume specified.\n"
|
||||
2 "%s Error: unable to locate help volume %s\n"
|
||||
3 "%s Error: problem processing help volume %s\n"
|
||||
4 "%s Error: memory allocation failed\n"
|
||||
5 "%s Error: unable to get topic information:\nvolume %s, locationId %s\n"
|
||||
6 "%s Error: unable to open temporary file %s\n"
|
||||
$ String used to replace $SECTNUM when printing the index section
|
||||
10 "Index"
|
||||
$ String used to replace $SECTNUM when printing the table of contents section
|
||||
11 "Table of Contents"
|
||||
$ ** DO NOT LOCALIZE THESE MESSAGES **
|
||||
$ index entry, page number
|
||||
20 "%s, %d\n"
|
||||
$ index subentry, page number
|
||||
21 " %s, %d\n"
|
||||
$ location ID associated with the index in the TOC maintained by dthelpprint
|
||||
30 "__GENERATED-INDEX"
|
||||
$ string used by can't get a topic title associated with an index subentry
|
||||
31 ""
|
||||
|
||||
$set 4
|
||||
$ ***** Module: PrintManStrFile.c *****
|
||||
$
|
||||
$ ** LOCALIZE THESE MESSAGES **
|
||||
1 "%s Error: helpType is string, but no stringData specified.\n"
|
||||
2 "%s Error: helpType is dynamic string, but no stringData specified.\n"
|
||||
3 "%s Error: helpType is man page, but no manPage specified.\n"
|
||||
4 "%s Error: helpType is file, but no helpFile specified.\n"
|
||||
5 "%s Error: memory allocation failed\n"
|
||||
|
||||
$set 5
|
||||
$ ***** Module: Initialize.c *****
|
||||
$
|
||||
$ ** LOCALIZE THESE MESSAGES **
|
||||
$ Messages 1 to 29: dthelpprint usage message
|
||||
$ **DO NOT LOCALIZE** the command line option names (e.g. -copies).
|
||||
$ **DO LOCALIZE** the option argument (e.g. number) and description.
|
||||
1 "dthelpprint - Print program for Help\n\n"
|
||||
2 "Usage: dthelpprint [options]\n"
|
||||
3 "Options controlling how to print:\n"
|
||||
4 "\t-printer printername printer to use\n"
|
||||
5 "\t-copies number number of copies to print\n"
|
||||
6 "\t-outputFile filename write output to this file\n"
|
||||
7 "\t-paperSize size format content to this paper size\n"
|
||||
$ DO NOT LOCALIZE THE PAPER SIZE NAMES help_papersize_xxx
|
||||
8 "\t\tsize = { help_papersize_letter|help_papersize_legal|\n"
|
||||
9 "\t\t help_papersize_executive|help_papersize_a4|help_papersize_b5}\n"
|
||||
10 "\t-display displayname display from which to get resources\n"
|
||||
11 "\t-name program name used when getting resources\n"
|
||||
12 "\t-class class name used when getting resources\n"
|
||||
13 "\t-xrm resourcestring additional resources\n"
|
||||
14 "Options controlling what to print:\n"
|
||||
15 "\t-helpType type type of Help data\n"
|
||||
16 "\t\ttype = 0 (help volume), 1 (string), 2 (man page), 3 (help file)\n"
|
||||
17 "\t-helpVolume volume full path of help volume file\n"
|
||||
18 "\t-locationId location name of Help topic in the volume\n"
|
||||
19 "\t-all print all topics, toc, & index in the help volume\n"
|
||||
20 "\t-sub print topic locationId and all subtopics\n"
|
||||
21 "\t-one print topic locationId\n"
|
||||
22 "\t-toc print help volume table of contents\n"
|
||||
23 "\t-index print help volume index\n"
|
||||
24 "\t-frontMatter print help volume front matter\n"
|
||||
25 "\t-manPage manpagename name of man page\n"
|
||||
26 "\t-stringData string Help text to print\n"
|
||||
27 "\t-helpFile filename file containing Help text\n"
|
||||
28 "\t-jobTitle title title string for print job\n"
|
||||
29 "\t-topicTitle title title string for Help text\n"
|
||||
$ Warning and error messages
|
||||
$ Do NOT localize the default size name help_papersize_letter
|
||||
40 "%s Warning: Illegal paper size '%s'. help_papersize_letter used.\n"
|
||||
41 "%s Warning: Missing paper size, height, or width value. help_papersize_letter used.\n"
|
||||
42 "%s Warning: Unable to open display %s\n"
|
||||
45 "Error: unable to allocate memory for temporary file\n"
|
||||
$ ** DO NOT LOCALIZE THESE MESSAGES **
|
||||
$ arg order: directory prefix processid filecnt suffix
|
||||
50 "%1$s/%2$s%3$d_%4$d%5$s"
|
||||
|
||||
|
||||
$set 6
|
||||
$ ***** Module: Main.c *****
|
||||
$
|
||||
$ ** LOCALIZE THESE MESSAGES **
|
||||
1 "%s Error: Illegal helpType %d.\n"
|
||||
|
||||
|
||||
|
||||
169
cde/programs/dthelp/dthelpprint/dthelpprint.sh
Executable file
169
cde/programs/dthelp/dthelpprint/dthelpprint.sh
Executable file
@@ -0,0 +1,169 @@
|
||||
#!/bin/sh
|
||||
#######################################################
|
||||
### File: dthelpprint.sh
|
||||
###
|
||||
### Default Location: /usr/dt/bin/dthelpprint.sh
|
||||
###
|
||||
### (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
### (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
### (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
### (c) Copyright 1993, 1994 Novell, Inc.
|
||||
###
|
||||
### Purpose:
|
||||
###
|
||||
### The dthelpprint executable generates a fully formatted
|
||||
### temporary file and then calls the dthelpprint.sh script
|
||||
### with options to actually print the file.
|
||||
###
|
||||
### Through the use of a shell script, dthelpprint
|
||||
### does not need to link against libDtSvc and also
|
||||
### supports better customization of help printing.
|
||||
###
|
||||
### Description:
|
||||
###
|
||||
### This script determines whether the Cde1 environment
|
||||
### is installed and whether there is a Print action.
|
||||
### If there is an action, use it to print the file.
|
||||
### If there isn't and Cde1 is installed, try to use dtlp directly.
|
||||
### If no Cde1 components are available, lp is used.
|
||||
###
|
||||
### Product: @(#)Cde1
|
||||
###
|
||||
### Invoked by: dthelpprint (only!)
|
||||
###
|
||||
### Revision: $XConsortium: dthelpprint.sh /main/3 1995/11/07 13:18:44 rswiston $
|
||||
###
|
||||
#########################################################
|
||||
|
||||
# set -x # trace on
|
||||
|
||||
#########################################################
|
||||
### Function: usage()
|
||||
### Prints the usage message and exits
|
||||
#########################################################
|
||||
usage()
|
||||
{
|
||||
echo "usage: dthelpprint.sh options";
|
||||
echo "options:";
|
||||
echo "\t -d <lpdest> : printer to use";
|
||||
echo "\t -f <print file> : file to print";
|
||||
echo "\t -m <print command> : print command to use";
|
||||
echo "\t -n <num copies> : number copies to print";
|
||||
echo "\t -u <user file name> : filename to show user";
|
||||
echo "\t -w : print raw";
|
||||
echo "\t -s : print silent";
|
||||
echo "\t -e : remove file";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
#########################################################
|
||||
### Main()
|
||||
### set the env vars based on the arg list options
|
||||
### These env vars conform to the dtlp interface
|
||||
#########################################################
|
||||
# define which executables to use
|
||||
ProgDtKsh=/usr/dt/bin/dtksh
|
||||
ProgDtAction=/usr/dt/bin/dtaction
|
||||
ProgDtLp=/usr/dt/bin/dtlp # only executed directly if Print action not avail
|
||||
ProgLp=/usr/bin/lp
|
||||
ActionPrint=Print
|
||||
|
||||
# init vars and consts
|
||||
FlagActionOk=0;
|
||||
True="True"
|
||||
False="False"
|
||||
|
||||
# get the options
|
||||
if [ $# -lt 2 ]; then usage; fi;
|
||||
for argument in $*
|
||||
do
|
||||
case $argument in
|
||||
-d) LPDEST=$2; shift 2; export LPDEST; ## Cde1 Print API
|
||||
;;
|
||||
-e) DTPRINTFILEREMOVE=$True; shift; export DTPRINTFILEREMOVE; ## Cde1 Print API
|
||||
;;
|
||||
-s) DTPRINTSILENT=$True; shift; export DTPRINTSILENT; ## Cde1 Print API
|
||||
;;
|
||||
-u) DTPRINTUSERFILENAME=$2; shift 2; export DTPRINTUSERFILENAME; ## Cde1 Print API
|
||||
;;
|
||||
-f) OptFile=$2; shift 2; export OptFile; ## local variables
|
||||
;;
|
||||
-m) OptLpCommand=$2; shift 2; export OptLpCommand; ## local variables
|
||||
;;
|
||||
-n) OptCopyCnt=$2; shift 2; export OptCopyCnt; ## local variables
|
||||
;;
|
||||
-w) OptRaw=$True; shift; export OptRaw; ## local variables
|
||||
;;
|
||||
--) shift; break;
|
||||
;;
|
||||
-\?) usage;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# can't print if no file is spec'd
|
||||
if [ -z "$OptFile" -o ! -r "$OptFile" ];
|
||||
then exit 1;
|
||||
fi;
|
||||
|
||||
# is Cde1 installed and OptLpCommand not specified ?
|
||||
if [ -x $ProgDtAction -a -x $ProgDtKsh -a -z "$OptLpCommand" ];
|
||||
then
|
||||
# exec a dtksh script to determine whether the print action exists
|
||||
$ProgDtKsh -c "XtInitialize TOPLEVEL chkPntr Dtksh;\
|
||||
DtDbLoad;\
|
||||
if DtActionExists $ActionPrint;\
|
||||
then exit 1;\
|
||||
else exit 0;\
|
||||
fi;";
|
||||
# if action exists, use it; action removes the print file
|
||||
FlagActionOk=$?;
|
||||
if [ $FlagActionOk = 1 ];
|
||||
then
|
||||
# don't iterate wildly
|
||||
if [ -z "$OptCopyCnt" -o "$OptCopyCnt" -lt 0 -o "$OptCopyCnt" -gt "100" ]
|
||||
then OptCopyCnt=1;
|
||||
fi;
|
||||
|
||||
# honor copycount by looping
|
||||
# only set the DTPRINTFILEREMOVE for the last iteration
|
||||
VarOldFileRemove=$DTPRINTFILEREMOVE # save orig value
|
||||
DTPRINTFILEREMOVE=$False # deactivate the remove request
|
||||
while [ "$OptCopyCnt" -gt "1" ]
|
||||
do
|
||||
$ProgDtAction $ActionPrint $OptFile; # take other options from env vars
|
||||
OptCopyCnt=`expr "$OptCopyCnt" - 1`;
|
||||
done;
|
||||
DTPRINTFILEREMOVE=$VarOldFileRemove; # restore orig value
|
||||
$ProgDtAction $ActionPrint $OptFile; # take other options from env vars
|
||||
|
||||
exit 0;
|
||||
# else if dtlp is installed, use it directly; it removes the print file
|
||||
elif [ -x $ProgDtLp ]
|
||||
then
|
||||
$ProgDtLp ${LPDEST:+-d} ${LPDEST:+$LPDEST} \
|
||||
${DTPRINTFILEREMOVE:+-e} \
|
||||
${DTPRINTSILENT:+-s} \
|
||||
-u "${DTPRINTUSERFILENAME:-Help Information}" \
|
||||
-b "Help" \
|
||||
${OptLpCommand:+-m} ${OptLpCommand:+$OptLpCommand} \
|
||||
-n ${OptCopyCnt:-1} \
|
||||
${OptRaw:+-w} \
|
||||
"$OptFile";
|
||||
|
||||
exit 0;
|
||||
fi; # use Print actio or ProgDtLp
|
||||
fi; # if Cde1 installed
|
||||
|
||||
# if Cde1 not installed or print action & dtlp not avail or OptLpCommand set
|
||||
if [ -n "$FlagActionOk" -a "$FlagActionOk" = 0 -a -r "$OptFile" ];
|
||||
then
|
||||
${OptLpCommand:-$ProgLp} -s -t "Help" \
|
||||
${LPDEST:+-d} ${LPDEST:+$LPDEST} \
|
||||
${OptRaw:+"-oraw"} \
|
||||
-n ${OptCopyCnt:-1} \
|
||||
$OptFile;
|
||||
if [ "$DTPRINTFILEREMOVE" = $True ]; then rm -f $OptFile; fi;
|
||||
fi;
|
||||
|
||||
exit 0;
|
||||
119
cde/programs/dthelp/dthelpprint/papersize.ruler
Normal file
119
cde/programs/dthelp/dthelpprint/papersize.ruler
Normal file
@@ -0,0 +1,119 @@
|
||||
1 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
10 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
20 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
30 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
40 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
50 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
60 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
70 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
80 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
90 456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
100 56789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
110 56789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
28
cde/programs/dthelp/dthelpprint/version.c
Normal file
28
cde/programs/dthelp/dthelpprint/version.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/********************************************************
|
||||
|
||||
Copyright (c) 1988 by the Massachusetts Institute of Technology
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose and without fee is hereby
|
||||
granted, provided that the above copyright notice appear in all
|
||||
copies and that both that copyright notice and this permission
|
||||
notice appear in supporting documentation, and that the names of
|
||||
Hewlett-Packard or M.I.T. not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific, written
|
||||
prior permission.
|
||||
|
||||
(c) Copyright 1993-1994,1996 Digital Equipment Corporation.
|
||||
(c) Copyright 1988,1993-1994,1996 Hewlett-Packard Company.
|
||||
(c) Copyright 1993-1994,1996 International Business Machines Corp.
|
||||
(c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
|
||||
(c) Copyright 1996 Novell, Inc.
|
||||
(c) Copyright 1996 FUJITSU LIMITED.
|
||||
(c) Copyright 1996 Hitachi.
|
||||
|
||||
********************************************************/
|
||||
|
||||
#include <include/hpversion.h>
|
||||
|
||||
#ifndef lint
|
||||
version_tag("dthelpprint: $XConsortium: version.c /main/5 1996/08/30 15:37:29 drk $")
|
||||
#endif /* lint */
|
||||
Reference in New Issue
Block a user