* contrib/directx/w32_ddrw.cpp
* contrib/directx/w32_ddrw.h
! Cleanup, formatting.
! Tabs converted to spaces.
* contrib/libnf/aading.prg
* contrib/libnf/aavg.prg
* contrib/libnf/acctadj.prg
* contrib/libnf/acctmnth.prg
* contrib/libnf/acctqtr.prg
* contrib/libnf/acctweek.prg
* contrib/libnf/acctyear.prg
* contrib/libnf/adessort.prg
* contrib/libnf/aemaxlen.prg
* contrib/libnf/aeminlen.prg
* contrib/libnf/amedian.prg
* contrib/libnf/anomatch.prg
* contrib/libnf/any2any.prg
* contrib/libnf/aredit.prg
* contrib/libnf/asum.prg
* contrib/libnf/at2.prg
* contrib/libnf/bitclr.prg
* contrib/libnf/bitset.prg
* contrib/libnf/blink.prg
* contrib/libnf/byt2bit.prg
* contrib/libnf/byt2hex.prg
* contrib/libnf/byteand.prg
* contrib/libnf/byteneg.prg
* contrib/libnf/bytenot.prg
* contrib/libnf/byteor.prg
* contrib/libnf/bytexor.prg
* contrib/libnf/calendar.prg
* contrib/libnf/clrsel.prg
* contrib/libnf/cntryset.prg
* contrib/libnf/d2e.prg
* contrib/libnf/datecnfg.prg
* contrib/libnf/dayofyr.prg
* contrib/libnf/daytobow.prg
* contrib/libnf/dectobin.prg
* contrib/libnf/descend.c
* contrib/libnf/dfile.prg
* contrib/libnf/dhkey.h
* contrib/libnf/diskfunc.prg
* contrib/libnf/dispmsg.prg
* contrib/libnf/dosver.prg
* contrib/libnf/e2d.prg
* contrib/libnf/easter.prg
* contrib/libnf/elapmil.prg
* contrib/libnf/elapsed.prg
* contrib/libnf/eltime.prg
* contrib/libnf/findith.prg
* contrib/libnf/firstday.prg
* contrib/libnf/floptst.prg
* contrib/libnf/ftattr.c
* contrib/libnf/ftint86.ch
* contrib/libnf/ftmenuto.ch
* contrib/libnf/fttext.c
* contrib/libnf/gcd.prg
* contrib/libnf/getenvrn.c
* contrib/libnf/getver.c
* contrib/libnf/getvid.c
* contrib/libnf/hex2dec.prg
* contrib/libnf/idle.c
* contrib/libnf/invclr.prg
* contrib/libnf/isbit.prg
* contrib/libnf/isbiton.prg
* contrib/libnf/isshare.prg
* contrib/libnf/kspeed.c
* contrib/libnf/lastday.prg
* contrib/libnf/linked.prg
* contrib/libnf/madd.prg
* contrib/libnf/menu1.prg
* contrib/libnf/menuto.prg
* contrib/libnf/metaph.prg
* contrib/libnf/miltime.prg
* contrib/libnf/min2dhm.prg
* contrib/libnf/month.prg
* contrib/libnf/mouse.c
* contrib/libnf/mouse1.prg
* contrib/libnf/mouse2.prg
* contrib/libnf/netpv.prg
* contrib/libnf/nooccur.prg
* contrib/libnf/ntow.prg
* contrib/libnf/nwlstat.prg
* contrib/libnf/nwsem.prg
* contrib/libnf/nwuid.prg
* contrib/libnf/ontick.c
* contrib/libnf/origin.c
* contrib/libnf/page.prg
* contrib/libnf/pchr.prg
* contrib/libnf/peek.c
* contrib/libnf/pegs.prg
* contrib/libnf/pending.prg
* contrib/libnf/pickday.prg
* contrib/libnf/poke.c
* contrib/libnf/popadder.prg
* contrib/libnf/prtesc.prg
* contrib/libnf/prtscr.c
* contrib/libnf/pvid.prg
* contrib/libnf/qtr.prg
* contrib/libnf/rand1.prg
* contrib/libnf/readme.txt
* contrib/libnf/restsets.prg
* contrib/libnf/round.prg
* contrib/libnf/savearr.prg
* contrib/libnf/savesets.prg
* contrib/libnf/scancode.prg
* contrib/libnf/scregion.prg
* contrib/libnf/setdate.prg
* contrib/libnf/settime.prg
* contrib/libnf/sinkey.prg
* contrib/libnf/sleep.prg
* contrib/libnf/sqzn.prg
* contrib/libnf/sysmem.prg
* contrib/libnf/tbwhile.prg
* contrib/libnf/test.prg
* contrib/libnf/vertmenu.prg
* contrib/libnf/vidcur.prg
* contrib/libnf/vidmode.prg
* contrib/libnf/wda.prg
* contrib/libnf/week.prg
* contrib/libnf/workdays.prg
* contrib/libnf/woy.prg
* contrib/libnf/xbox.prg
* contrib/libnf/year.prg
- contrib/libnf/idle.c
+ contrib/libnf/ftidle.c
+ contrib/libnf/iamidle.c
* contrib/libnf/Makefile
* contrib/libnf/makefile.bc
* contrib/libnf/makefile.vc
+ Added svn headers.
! Fixed FT_IDLE()
! Renamed idle.c to not clash with core idle.obj.
! FT_F*() functions fully ported from original NFLIB.
Pls test.
* Some minor cleanups, formatting.
* include/filesys.api
! _fsRead(), _fsWrite() now more compatible.
* include/hbundoc.api
+ Added _lcopy(), _ncopyuc(), _ncopylc() compatibility
functions.
* include/hbapi.h
* source/common/hbstr.c
+ Added hb_strncpyLower()
233 lines
6.0 KiB
Plaintext
233 lines
6.0 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
/*
|
|
* File......: DFILE.PRG
|
|
* Author....: Mike Taylor
|
|
* CIS ID....: ?
|
|
*
|
|
* This is an original work by Mike Taylor and is placed in the
|
|
* public domain.
|
|
*
|
|
* Modification history:
|
|
* ---------------------
|
|
*
|
|
* Rev 1.3 17 Aug 1991 15:24:14 GLENN
|
|
* Don Caton corrected some spelling errors in the doc
|
|
*
|
|
* Rev 1.2 15 Aug 1991 23:03:24 GLENN
|
|
* Forest Belt proofread/edited/cleaned up doc
|
|
*
|
|
* Rev 1.1 14 Jun 1991 19:51:32 GLENN
|
|
* Minor edit to file header
|
|
*
|
|
* Rev 1.0 01 Apr 1991 01:01:08 GLENN
|
|
* Nanforum Toolkit
|
|
*
|
|
*/
|
|
|
|
|
|
|
|
static nHandle := 0
|
|
|
|
#ifdef FT_TEST
|
|
|
|
FUNCTION MAIN()
|
|
|
|
@ 0,0 CLEAR
|
|
|
|
cInFile := "FT_DFILE.PRG"
|
|
CKEY := ""
|
|
NNCOLOR := 7
|
|
NHCOLOR := 15
|
|
NCOLSKIP := 5
|
|
NRMARGIN := 132
|
|
CEXITKEYS := "AABBC "
|
|
LBROWSE := .F.
|
|
NSTART := 1
|
|
NBUFFSIZE := 4096
|
|
|
|
@ 0,0 SAY "ENTER FILENAME: " GET CINFILE
|
|
@ 1,0 SAY " FOREGROUND: " GET NNCOLOR PICTURE "999"
|
|
@ 2,0 SAY " HIGHLIGHT: " GET NHCOLOR PICTURE "999"
|
|
@ 3,0 SAY " EXIT KEYS: " GET CEXITKEYS
|
|
@ 4,0 SAY " BUFFER SIZE: " GET NBUFFSIZE PICTURE "9999"
|
|
@ 1,40 SAY "COLUMN INCREMENT: " GET NCOLSKIP PICTURE "999"
|
|
@ 2,40 SAY " MAX LINE SIZE: " GET NRMARGIN PICTURE "999"
|
|
@ 3,40 SAY " BROWSE MODE? " GET LBROWSE PICTURE "Y"
|
|
|
|
READ
|
|
|
|
/*
|
|
* REMEMBER A WINDOW WILL BE ONE SIZE LESS AND GREATER THAN THE PASSED COORD.'S
|
|
*
|
|
* THE 9TH PARAMETER CONTAINS THE KEYS THAT THE ROUTINE WILL TERMINATE ON
|
|
* AND THE CHR(143) represents the F3 key.
|
|
*
|
|
*/
|
|
|
|
@ 4,9 TO 11,71
|
|
|
|
FT_DFSETUP(cInFile, 5, 10, 10, 70, nStart,;
|
|
nNColor, nHColor, cExitKeys + CHR(143),;
|
|
lBrowse, nColSkip, nRMargin, nBuffSize)
|
|
|
|
cKey := FT_DISPFILE()
|
|
|
|
FT_DFCLOSE()
|
|
|
|
@ 20,0 SAY "Key pressed was: " + '[' + cKey + ']'
|
|
|
|
return (NIL)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* $DOC$
|
|
* $FUNCNAME$
|
|
* FT_DFSETUP()
|
|
* $CATEGORY$
|
|
* File I/O
|
|
* $ONELINER$
|
|
* Set up parameters for FT_DISPFILE()
|
|
* $SYNTAX$
|
|
* FT_DFSETUP( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ;
|
|
* <nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>, ;
|
|
* <lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) -> nResult
|
|
* $ARGUMENTS$
|
|
* <cInFile> - text file to display (full path and filename)
|
|
* <nTop> - upper row of window
|
|
* <nLeft> - left col of window
|
|
* <nBottom> - lower row of window
|
|
* <nRight> - right col of window
|
|
* <nStart> - line to place highlight at startup
|
|
* <nCNormal> - normal text color (numeric attribute)
|
|
* <nCHighlight> - text highlight color (numeric attribute)
|
|
* <cExitKeys> - terminating key list (each byte of string is a
|
|
* key code)
|
|
* <lBrowse> - act-like-a-browse-routine flag
|
|
* <nColSkip> - col increment for left/right arrows
|
|
* <nRMargin> - right margin - anything to right is truncated
|
|
* <nBuffSize> - size of the paging buffer
|
|
* $RETURNS$
|
|
* 0 if successful, FError() code if not
|
|
* $DESCRIPTION$
|
|
* Note: make sure you allocate a buffer large enough to hold enough
|
|
* data for the number of lines that you have in the window. Use the
|
|
* following formula as a guideline:
|
|
*
|
|
* buffer size = (# of line) + 1 * RMargin
|
|
*
|
|
* This is the smallest you should make the buffer. For normal use,
|
|
* 4096 bytes is recommended
|
|
* $EXAMPLES$
|
|
* @ 4,9 TO 11,71
|
|
*
|
|
* FT_DFSETUP("test.txt", 5, 10, 10, 70, 1, 7, 15,;
|
|
* "AaBb" + Chr(143), .T., 5, 132, 4096)
|
|
*
|
|
* cKey = FT_DISPFILE()
|
|
*
|
|
* FT_DFCLOSE()
|
|
*
|
|
* @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']'
|
|
* $SEEALSO$
|
|
* FT_DISPFILE() FT_DFCLOSE()
|
|
* $END$
|
|
*/
|
|
|
|
|
|
|
|
function FT_DFSETUP(cInFile, nTop, nLeft, nBottom, nRight,;
|
|
nStart, nCNormal, nCHighlight, cExitKeys,;
|
|
lBrowse, nColSkip, nRMargin, nBuffSize )
|
|
|
|
local rval := 0
|
|
|
|
if File(cInFile)
|
|
nTop := if(ValType(nTop) == "N", nTop, 0)
|
|
nLeft := if(ValType(nLeft) == "N", nLeft, 0)
|
|
nBottom := if(ValType(nBottom) == "N", nBottom, MaxRow())
|
|
nRight := if(ValType(nRight) == "N", nRight, MaxCol())
|
|
|
|
nCNormal := if(ValType(nCNormal) == "N", nCNormal, 7)
|
|
nCHighlight := if(ValType(nCHighlight) == "N", nCHighlight, 15)
|
|
|
|
nStart := if(ValType(nStart) == "N", nStart, 1)
|
|
nColSkip := if(ValType(nColSkip) == "N", nColSkip, 1)
|
|
lBrowse := if(ValType(lBrowse) == "L", lBrowse, .F.)
|
|
|
|
nRMargin := if(ValType(nRMargin) == "N", nRMargin, 255)
|
|
nBuffSize := if(ValType(nBuffSize) == "N", nBuffSize, 4096)
|
|
|
|
cExitKeys := if(ValType(cExitKeys) == "C", cExitKeys, "")
|
|
|
|
cExitKeys := if(Len(cExitKeys) > 25, SubStr(cExitKeys, 1, 25), cExitKeys)
|
|
|
|
nHandle := FOpen(cInFile)
|
|
|
|
rval := FError()
|
|
|
|
if ( rval == 0 )
|
|
rval := _FT_DFINIT(nHandle, nTop, nLeft, nBottom, nRight,;
|
|
nStart, nCNormal, nCHighlight, cExitKeys,;
|
|
lBrowse, nColSkip, nRMargin, nBuffSize)
|
|
endif
|
|
else
|
|
rval := 2 // simulate a file-not-found DOS file error
|
|
endif
|
|
|
|
return (rval)
|
|
|
|
|
|
|
|
/* $DOC$
|
|
* $FUNCNAME$
|
|
* FT_DFCLOSE()
|
|
* $CATEGORY$
|
|
* File I/O
|
|
* $ONELINER$
|
|
* Close file displayed by FT_DISPFILE()
|
|
* $SYNTAX$
|
|
* FT_DFCLOSE() -> NIL
|
|
* $ARGUMENTS$
|
|
* None
|
|
* $RETURNS$
|
|
* NIL
|
|
* $DESCRIPTION$
|
|
* Closes the file opened by FT_DFSETUP()
|
|
* $EXAMPLES$
|
|
* @ 4,9 TO 11,71
|
|
*
|
|
* FT_DFSETUP("test.txt", 5, 10, 10, 70, 1, 7, 15,;
|
|
* "AaBb" + Chr(143), .T., 5, 132, 4096)
|
|
*
|
|
* cKey = FT_DISPFILE()
|
|
*
|
|
* FT_DFCLOSE()
|
|
*
|
|
* @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + '[' + cKey + ']'
|
|
* $SEEALSO$
|
|
* FT_DFSETUP() FT_DISPFILE()
|
|
* $END$
|
|
*/
|
|
|
|
|
|
|
|
|
|
function FT_DFCLOSE()
|
|
|
|
if ( nHandle > 0 )
|
|
_FT_DFCLOS()
|
|
|
|
FClose(nHandle)
|
|
|
|
nHandle := 0
|
|
endif
|
|
|
|
return (NIL)
|
|
|