Changeset 14
- Timestamp:
- 07/08/06 18:42:16 (2 years ago)
- Files:
-
- trunk/sam2/sam2.c (modified) (1 diff)
- trunk/sam3/sam3.c (modified) (1 diff)
- trunk/sam4/sam4.c (modified) (1 diff)
- trunk/sam5/sam5.c (modified) (1 diff)
- trunk/sam6/sam6.c (modified) (1 diff)
- trunk/sam7/sam7.c (modified) (1 diff)
- trunk/txlib/include/txcon.h (modified) (4 diffs)
- trunk/txlib/include/txlib.h (modified) (1 diff)
- trunk/txlib/include/txwin.h (modified) (14 diffs)
- trunk/txlib/makefile.mif (modified) (1 diff)
- trunk/txlib/txcon.c (modified) (7 diffs)
- trunk/txlib/txlogfil.c (modified) (2 diffs)
- trunk/txlib/txparse.c (modified) (2 diffs)
- trunk/txlib/txstdcmd.c (modified) (2 diffs)
- trunk/txlib/txvers.h (modified) (1 diff)
- trunk/txlib/txwdraw.c (modified) (25 diffs)
- trunk/txlib/txwdraw.h (modified) (4 diffs)
- trunk/txlib/txwhelp.c (modified) (1 diff)
- trunk/txlib/txwind.c (modified) (1 diff)
- trunk/txlib/txwpriv.h (modified) (1 diff)
- trunk/txlib/txwproc.c (modified) (6 diffs)
- trunk/txlib/txwstdlg.c (modified) (2 diffs)
- trunk/txlib/txwutil.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/sam2/sam2.c
r1 r14 53 53 if (TxaExeSwitch('l')) // start logfile now ? 54 54 { 55 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam") );55 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam"), TRUE); 56 56 } 57 57 if ((TxaExeSwitch('?')) || // switch help requested trunk/sam3/sam3.c
r1 r14 54 54 if (TxaExeSwitch('l')) // start logfile now ? 55 55 { 56 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam") );56 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam"), TRUE); 57 57 } 58 58 if ((TxaExeSwitch('?')) || // switch help requested trunk/sam4/sam4.c
r1 r14 84 84 if (TxaExeSwitch('l')) // start logfile now ? 85 85 { 86 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam") );86 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam"), TRUE); 87 87 } 88 88 if ((TxaExeSwitch('?')) || // switch help requested trunk/sam5/sam5.c
r1 r14 72 72 if (TxaExeSwitch('l')) // start logfile now ? 73 73 { 74 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam") );74 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam"), TRUE); 75 75 } 76 76 if ((TxaExeSwitch('?')) || // switch help requested trunk/sam6/sam6.c
r1 r14 93 93 if (TxaExeSwitch('l')) // start logfile now ? 94 94 { 95 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam") );95 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam"), TRUE); 96 96 } 97 97 if (TxaExeSwitch('?')) // switch help requested trunk/sam7/sam7.c
r1 r14 184 184 if (TxaExeSwitch('l')) // start logfile now ? 185 185 { 186 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam") );186 TxAppendToLogFile( TxaExeSwitchStr( 'l', NULL, "sam"), TRUE); 187 187 } 188 188 if (TxaExeSwitch('?')) // switch help requested trunk/txlib/include/txcon.h
r13 r14 781 781 #undef TRCRCD 782 782 #undef TRDUMP 783 #undef TRHEAP 783 784 #undef TRINIT 784 785 #undef TREXIT … … 956 957 957 958 959 #define TRHEAP(lev) \ 960 { \ 961 if (TxTrLevel >= lev) \ 962 { \ 963 switch (_heapchk()) \ 964 { \ 965 case _HEAPOK: \ 966 case _HEAPEMPTY: \ 967 TRLEVX(lev,( "Heap is still OK\n")); \ 968 break; \ 969 \ 970 default: \ 971 TRLEVX(lev,( "Heap corruption!\n")); \ 972 break; \ 973 } \ 974 } \ 975 } 976 977 958 978 #define TRINIT(lev) \ 959 979 if (TxTrLevel >= lev) \ … … 1051 1071 #define TRCRCD(l,a,b,d) 1052 1072 #define TRDUMP(lev,l,a,b,o) 1073 #define TRHEAP(lev) 1053 1074 #define TRINIT(lev) if (TxTrLevel >= lev) \ 1054 1075 { … … 1219 1240 ( 1220 1241 ULONG seq, // IN sequence number 1242 ULONG retain, // IN nr of files kept 1221 1243 TXLN buf // IN filename buffer 1222 1244 ); trunk/txlib/include/txlib.h
r13 r14 1625 1625 1626 1626 // Remove ANSI control code from a text-string (in place conversion) 1627 char *TxStripAnsiCodes // RETstripped string1627 ULONG TxStripAnsiCodes // RET length stripped string 1628 1628 ( 1629 1629 char *text // INOUT ANSI text to strip trunk/txlib/include/txwin.h
r11 r14 84 84 TXW_BUTTON = 7, // button - push/radio/checkbox 85 85 TXW_LISTBOX = 8, // simple selection-list 86 TXW_HEXEDIT = 9, // Hex (sector) editor 86 87 } TXWCLASS; // end of enum "txwclass" 87 88 … … 315 316 } TXSTLINE; // end of struct "txstatic" 316 317 317 typedef struct txbutton 318 typedef struct txbutton // any button class 318 319 { 319 320 BOOL *checked; // button state … … 321 322 } TXBUTTON; // end of struct "txbutton" 322 323 323 typedef struct txlistbox 324 typedef struct txlistbox // listbox, popup/submenu 324 325 { 325 326 short cpos; // current position (cursor) … … 334 335 TXSELIST *list; // actual selection list data 335 336 } TXLISTBOX; // end of struct "txlistbox" 337 338 339 typedef enum txhexedcmd 340 { 341 TXHE_CB_UPD_DESC, // update buffer desc (hex/dec) 342 TXHE_CB_INIT_POS, // load initial buffers 343 TXHE_CB_NEXT_BUF, // make 'next' buffer current 344 TXHE_CB_PREV_BUF, // make 'prev' buffer current 345 TXHE_CB_TO_START, // to start of object 346 TXHE_CB_TO_FINAL, // to end of object 347 TXHE_CB_GOTOITEM, // go to specified item (sn) 348 TXHE_CB_FINDDATA, // find data, goto found item 349 TXHE_CB_FNDAGAIN, // find data again, same data 350 TXHE_CB_WRITEBUF, // write (changed) buffer 351 } TXHEXEDCMD; // end of enum "txhexedcmd" 352 353 354 typedef ULONG (* TXHEXEDIT_CALLBACK) // Hex editor action callback 355 ( 356 ULONG cmd, // IN action command 357 struct txhexedit *data // INOUT hexedit data 358 ); 359 360 361 typedef struct txhebuf // hex editor data buffer 362 { 363 BYTE *data; // start of data buffer 364 LLONG start; // abs start position (ref) 365 ULONG size; // size of buffer (item) 366 TXLN desc; // buffer description (76) 367 } TXHEBUF; // end of struct "txhebuf" 368 369 370 typedef struct txhexedit // hex editor control 371 { 372 //- note: a negative offset in the buffer means the current item (buffer) 373 //- is NOT at the top of the display, but further down, and part of 374 //- the PREV buffer is also visible. (0 = buffer start at top-left) 375 376 LONG posCurBuf; // offset in buffer, 1st byte 377 LONG posCursor; // offset in screen, cursor 378 USHORT hexLsb; // hex LSB nibble (0 or 1) 379 USHORT rows; // nr of rows shown (16) 380 USHORT cols; // nr of bytes per row (16) 381 BOOL autocols; // get 8/16/32/cols from width 382 BOOL ascii; // cursor in ascii area 383 BOOL decimal; // use decimal positions 384 TXHEBUF *prev; // buffer BEFORE current one 385 TXHEBUF *curr; // current buffer (item) 386 TXHEBUF *next; // buffer AFTER current one 387 BYTE *diff; // difference buf (original) 388 ULONG diffSize; // size of difference buf 389 ULONG currCrc; // 32-bit buf CRC (original) 390 void *userdata; // application user data 391 TXHEXEDIT_CALLBACK actionCallback; // application action handler 392 } TXHEXEDIT; // end of struct "txhexedit" 336 393 337 394 … … 363 420 TXBUTTON bu; // push- radio or checkbox 364 421 TXLISTBOX lb; // listbox with selection list 422 TXHEXEDIT he; // hex editor control 365 423 }; 366 424 } TXWINDOW; // end of struct "txwindow" … … 409 467 #define TXStdStatic( text) "", TXW_STATIC, 0, NULL, TXWgStatic(text) 410 468 #define TXStdStline( text) "", TXW_STLINE, 0, NULL, TXWgStline(text) 411 #define TXStdButton(var,text) "", TXW_BUTTON, 0, NULL, TXWgButton( &(var),text)469 #define TXStdButton(var,text) "", TXW_BUTTON, 0, NULL, TXWgButton(var,text) 412 470 #define TXStdLstBox(v,p,text) text, TXW_LISTBOX, 0, NULL, TXWgListbox((p),0,0,0,0,0,0,0,0,(v)) 413 471 … … 492 550 #define TXVS_CLOSE_BUTTON 0x01000000 // include close button in border 493 551 552 // TXHE_ hex editor control styles 553 #define TXHE_CLOSE_BUTTON 0x01000000 // include close button in border 554 #define TXHE_WRITE_PROMPT 0x10000000 // prompt before write-back 555 #define TXHE_TAB_HTOGGLE 0x20000000 // TAB toggles hex/ascii 556 494 557 //- often used Dialog frame/child window combinations 495 #define TXWS_CANVAS TXWS_DISABLED | TXWS_VISIBLE | TXWS_SAVEBITS | TXWS_SYNCPAINT 558 #define TXWS_CANVAS TXWS_DISABLED | TXWS_VISIBLE | TXWS_SAVEBITS \ 559 | TXWS_SYNCPAINT 496 560 #define TXWS_DIALOG TXWS_STDWINDOW | TXWS_FOURBORDERS 497 #define TXWS_DFRAME TXWS_DIALOG | TXWS_DISABLED | TXWS_MOVEABLE561 #define TXWS_DFRAME TXWS_DIALOG | TXWS_DISABLED | TXWS_MOVEABLE 498 562 #define TXWS_FRAMED TXWS_CHILDWINDOW | TXWS_FOURBORDERS 499 #define TXWS_PBUTTON TXWS_FRAMED | TXBS_PUSHBUTTON | TXWS_FOCUS_PAINT500 #define TXWS_AUTORAD TXWS_CHILDWINDOW | TXBS_AUTORADIO | TXWS_FOCUS_PAINT501 #define TXWS_RADIOB TXWS_CHILDWINDOW | TXBS_RADIOBUTTON | TXWS_FOCUS_PAINT502 #define TXWS_AUTOCHK TXWS_CHILDWINDOW | TXBS_AUTOCHECK | TXWS_FOCUS_PAINT503 #define TXWS_CHECKB TXWS_CHILDWINDOW | TXBS_CHECKBOX | TXWS_FOCUS_PAINT504 #define TXWS_EFOCUS TXWS_LEFTJUSTIFY | TXWS_BRACKETSIDE | TXWS_FOCUS_PAINT563 #define TXWS_PBUTTON TXWS_FRAMED | TXBS_PUSHBUTTON | TXWS_FOCUS_PAINT 564 #define TXWS_AUTORAD TXWS_CHILDWINDOW | TXBS_AUTORADIO | TXWS_FOCUS_PAINT 565 #define TXWS_RADIOB TXWS_CHILDWINDOW | TXBS_RADIOBUTTON | TXWS_FOCUS_PAINT 566 #define TXWS_AUTOCHK TXWS_CHILDWINDOW | TXBS_AUTOCHECK | TXWS_FOCUS_PAINT 567 #define TXWS_CHECKB TXWS_CHILDWINDOW | TXBS_CHECKBOX | TXWS_FOCUS_PAINT 568 #define TXWS_EFOCUS TXWS_LEFTJUSTIFY | TXWS_BRACKETSIDE | TXWS_FOCUS_PAINT 505 569 #define TXWS_EF_BASE TXWS_EFOCUS | TXES_DLGE_FIELD 506 #define TXWS_ENTRYF TXWS_CHILD_BASE | TXWS_EF_BASE | TXWS_SIDEBORDERS570 #define TXWS_ENTRYF TXWS_CHILD_BASE | TXWS_EF_BASE | TXWS_SIDEBORDERS 507 571 #define TXWS_ENTRYT TXWS_ENTRYF | TXWS_TITLEBORDER 508 #define TXWS_ENTRYB TXWS_CHILDWINDOW | TXWS_EF_BASE | TXWS_SIDEBORDERS \572 #define TXWS_ENTRYB TXWS_CHILDWINDOW | TXWS_EF_BASE | TXWS_SIDEBORDERS \ 509 573 | TXWS_BRACKETSIDE 510 #define TXWS_ENTRYBT TXWS_ENTRYB | TXWS_TITLEBORDER | TXWS_TF_TEXTONLY511 #define TXWS_OUTPUT TXWS_CHILD_BASE | TXWS_DISABLED | TXWS_LEFTJUSTIFY574 #define TXWS_ENTRYBT TXWS_ENTRYB | TXWS_TITLEBORDER | TXWS_TF_TEXTONLY 575 #define TXWS_OUTPUT TXWS_CHILD_BASE | TXWS_DISABLED | TXWS_LEFTJUSTIFY 512 576 #define TXWS_OUTPUTT TXWS_OUTPUT | TXWS_TITLEBORDER 513 577 #define TXWS_DROPMENU TXWS_CHILD_BASE | TXLS_DROP_MENU 514 578 #define TXWS_A_MENU TXWS_DROPMENU | TXWS_TITLEBORDER 515 #define TXWS_D_DOWN TXWS_CHILD_BASE | TXWS_TITLEBORDER | TXLS_DROP_VALUE 516 #define TXWS_D_SPIN TXWS_D_DOWN | TXWS_BRACKETSIDE | TXWS_SIDEBORDERS \ 517 | TXLS_SPIN_WRAP | TXWS_FOCUS_PAINT 518 #define TXWS_DSPINB TXWS_CHILDWINDOW | TXLS_DROP_VALUE | TXWS_BRACKETSIDE \ 519 | TXWS_SIDEBORDERS | TXLS_SPIN_WRAP | TXWS_FOCUS_PAINT 520 #define TXWS_DSPINBT TXWS_DSPINB | TXWS_TITLEBORDER | TXWS_TF_TEXTONLY 521 579 #define TXWS_D_DOWN TXWS_CHILD_BASE | TXWS_TITLEBORDER | TXLS_DROP_VALUE 580 #define TXWS_D_SPIN TXWS_D_DOWN | TXWS_BRACKETSIDE | TXWS_SIDEBORDERS \ 581 | TXLS_SPIN_WRAP | TXWS_FOCUS_PAINT 582 #define TXWS_DSPINB TXWS_CHILDWINDOW | TXLS_DROP_VALUE | TXWS_BRACKETSIDE \ 583 | TXWS_SIDEBORDERS | TXLS_SPIN_WRAP | TXWS_FOCUS_PAINT 584 #define TXWS_DSPINBT TXWS_DSPINB | TXWS_TITLEBORDER | TXWS_TF_TEXTONLY 585 586 #define TXWS_HEXECTL TXWS_CHILDWINDOW | TXHE_TAB_HTOGGLE 587 #define TXWS_HEXEDIT TXWS_HEXECTL | TXHE_CLOSE_BUTTON | TXWS_FOURBORDERS 522 588 523 589 // TXWM_COMMAND msg source codes … … 669 735 #define TXLN_ENTER 5 670 736 737 // Hex edit tandard dialog flags 738 #define TXHE_MOVEABLE 0x2000 671 739 672 740 // Scroll-buffer related color conversions … … 963 1031 cMLEntTextStand, // Multi-line entry field text 964 1032 cMLEntTextFocus, 1033 cHexEdCurByteChg, // Hex Editor control 1034 cHexEdCursorByte, 1035 cHexEdHexByteStd, 1036 cHexEdHexByteChg, 1037 cHexEdAscByteStd, 1038 cHexEdAscBracket, 1039 cHexEdRelPosPrev, 1040 cHexEdRelPosCurr, 1041 cHexEdRelPosNext, 1042 cHexEdAbsBytePos, 1043 cHexEdAbsByteCur, 1044 cHexEdRelCursorP, 1045 cHexEdButtonText, 1046 cHexEdButBracket, 1047 cHexEdByteNumber, 1048 cHexEdItemSnText, 1049 cHexEdItemHlight, 1050 cHexEdModifyText, 965 1051 cNrOfSchemeColors 966 1052 } TXW_WINCOLORS; // end of enum "txw_wincolors" … … 1023 1109 #define TX_Red_on_White (TXwCnW + TXwCNR) 1024 1110 #define TX_Magenta_on_White (TXwCnW + TXwCNM) 1111 #define TX_Brown_on_White (TXwCnW + TXwCNY) 1025 1112 #define TX_Yellow_on_White (TXwCnW + TXwCBY) 1026 1113 #define TX_Grey_on_White (TXwCnW + TXwCBZ) … … 1043 1130 #define TX_Black_on_Magenta (TXwCnM + TXwCNZ) 1044 1131 #define TX_White_on_Magenta (TXwCnM + TXwCNW) 1132 #define TX_Lcyan_on_Magenta (TXwCnM + TXwCBC) 1045 1133 #define TX_Lwhite_on_Magenta (TXwCnM + TXwCBW) 1046 1134 #define TX_Magenta_on_Magenta (TXwCnM + TXwCNM) … … 2037 2125 ); 2038 2126 2039 /*======== Help related functions, TXWHELP.C ================================ */2127 /*======== Help related functions, TXWHELP.C ================================ */ 2040 2128 2041 2129 #define TXHELPITEM(nr,title) \ … … 2064 2152 ); 2065 2153 2154 /*======== Hex Editor standard dialog, TXWHEXED.C ===========================*/ 2155 2156 // Initialize the Hex-editor dialog/control data structures 2157 // To be called by CUSTOM hex-editor control users (not standard dialog) 2158 BOOL txwInitHexeditDialogs 2159 ( 2160 void 2161 ); 2162 2163 // Display standard Hex editor dialog 2164 ULONG txwHexEditor 2165 ( 2166 TXWHANDLE parent, // IN parent window 2167 TXWHANDLE owner, // IN owner window 2168 TXHEXEDIT *hedat, // IN hex edit data 2169 char *title, // IN title for the dialog 2170 ULONG helpid, // IN help on message 2171 ULONG flags // IN specification flags 2172 ); 2173 2066 2174 /*======== Window drawing functions, TXWDRAW.C ==============================*/ 2067 2175 … … 2094 2202 ); 2095 2203 2204 #define txwStringAt(r,c,s,a) txwDrawCharStrCol(hwnd,r,c,s,a) 2096 2205 // Draw a character-string at position in specified color, using clip-rect 2097 2206 void txwDrawCharStrCol trunk/txlib/makefile.mif
r1 r14 137 137 txwdraw.obj txwhelp.obj txwikey.obj txwind.obj txwutil.obj & 138 138 txwprint.obj txwproc.obj txwstdlg.obj txwidget.obj txselist.obj & 139 txwmsg.obj txwehook.obj 139 txwmsg.obj txwehook.obj txwhexed.obj 140 140 winspec= & 141 141 +txwdraw +txwhelp +txwikey +txwind +txwutil & 142 142 +txwprint +txwproc +txwstdlg +txwidget +txselist & 143 +txwmsg +txwehook 143 +txwmsg +txwehook +txwhexed 144 144 !endif 145 145 trunk/txlib/txcon.c
r13 r14 75 75 static char txc_ansi = A_ON; 76 76 77 //- logfile cycling and size control 78 static ULONG log_written = 0;// bytes written on this file77 //- logfile cycling and size control, first size includes closing message ... 78 static ULONG log_written = 50; // bytes written on this file 79 79 static ULONG log_maxsize = 0; // maximum size per logfile 80 80 static ULONG log_seq_num = 0; // sequence number 0..n … … 542 542 if ((log_handle != 0) || (txh_clean != NULL)) 543 543 { 544 TxStripAnsiCodes( txm_buff);544 size = TxStripAnsiCodes( txm_buff); // update size as well! 545 545 for (hinfo = txh_clean; hinfo != NULL; hinfo = hinfo->next) 546 546 { … … 564 564 TXLN fname; 565 565 566 log_written = 0; // avoid recursive cycling 566 log_written = size + 150; // start size new logfile 567 567 568 fprintf( log_handle, "\nClosing logfile at size limit\n"); 568 569 … … 570 571 if (log_seq_num >= log_retain) // need to delete one 571 572 { 572 TxBuildLogName( log_seq_num - log_retain, fname); 573 TxBuildLogName( log_seq_num - log_retain, 574 log_retain, fname); 573 575 remove( fname); // delete a logfile (cycle) 574 576 } 575 TxBuildLogName( (log_retain) ? ++log_seq_num : 0, fname); 577 TxBuildLogName( (log_retain) ? ++log_seq_num : 0, 578 log_retain, fname); 576 579 TxAppendToLogFile( fname, FALSE); // open next logfile, quiet 577 580 log_handle = TxQueryLogFile( &log7bit, &logreopen); 578 fprintf( log_handle, "Start next logfile: '%s'\n", fname); 581 fprintf( log_handle, "Start logfile nr %lu : '%s'\n", 582 log_seq_num, fname); 579 583 } 580 584 else … … 603 607 // Remove ANSI control code from a text-string (in place conversion) 604 608 /*****************************************************************************/ 605 char *TxStripAnsiCodes // RETstripped string606 ( 609 ULONG TxStripAnsiCodes // RET length stripped string 610 ( // corrected for CR/LF 607 611 char *text // INOUT ANSI text to strip 608 612 ) … … 610 614 char *rd = text; // read-pointer in string 611 615 char *wr = text; // write pointer 616 ULONG ls = 0; // length stripped string 612 617 613 618 while (*rd) … … 624 629 { 625 630 *(wr++) = *rd; // copy the character 631 632 #if !defined(LINUX) 633 if (*rd == '\n') // when end of line 634 { 635 ls++; // correct for CR/LF char 636 } 637 ls++; // count for length 638 #endif 626 639 } 627 640 rd++; 628 641 } 629 642 *wr = '\0'; // terminate stripped string 630 return( text);643 return( ls); 631 644 } // end 'TxStripAnsiCodes' 632 645 /*---------------------------------------------------------------------------*/ trunk/txlib/txlogfil.c
r13 r14 181 181 ( 182 182 ULONG seq, // IN sequence number 183 ULONG retain, // IN nr of files kept 183 184 TXLN buf // IN filename buffer 184 185 ) … … 193 194 else 194 195 { 196 if ((seq >= 100) && (retain < 100)) // OK to use modulo seq ? 197 { 198 seq %= 100; // reduce to two digits, to 199 } // limit extension to three 195 200 sprintf( ext, "l%02lu", seq); 196 201 } trunk/txlib/txparse.c
r13 r14 249 249 250 250 /*****************************************************************************/ 251 // Get option value num/string, with bytes/kilo/mega/giga modifier and default252 /*****************************************************************************/253 ULONG TxaOptBkmg // RET number value in bytes254 (255 TXHANDLE txh, // IN TXA handle256 char option, // IN option character257 ULONG def, // IN default value258 BYTE mod // IN b,kb,mb,gb modifier259 )260 {261 ULONG rc = 0; // function return262 BYTE unit = TXA_DFUNIT;263 TXA_OPTION *opt; // option pointer264 265 ENTER();266 TRACES(("Option: '%c' default: %8.8lx mod:%2.2hx = '%c'\n",267 option, def, mod, mod));268 269 if ((opt = TxaOptValue( option)) != NULL) // get the option details270 {271 switch (opt->type)272 {273 case TXA_STRING:274 rc = TxaParseNumber( opt->value.string, TX_RADIX_STD_CLASS, &unit);275 case TXA_NO_VAL:276 rc = def;277 break;278 279 default: // convert, default is MiB!280 rc = opt->value.number;281 unit = opt->unit;282 break;283 }284 }285 if (unit == TXA_DFUNIT)286 {287 unit = mod;288 }289 switch (tolower(unit))290 {291 case 'g':292 if (rc >= 4)293 {294 rc = 0xffffffff;295 break;296 }297 else298 {299 rc *= 1024; // Giga300 }301 case 'm': rc *= 1024; // Mega302 case 'k': rc *= 1024; // Kilo303 default: break; // Bytes, OK304 }305 RETURN (rc);306 } // end 'TxaParseBkmgNumber'307 /*---------------------------------------------------------------------------*/308 309 310 /*****************************************************************************/311 251 // Read one item (option or argument) and store it in the txa element 312 252 /*****************************************************************************/ … … 780 720 switch (tolower(unit)) 781 721 { 782 case 'g': rc *= 1024; // Giga 722 case 'g': 723 if (rc >= 4) 724 { 725 rc = 0xffffffff; // limit at 4GiB -1 726 break; 727 } 728 else 729 { 730 rc *= 1024; // Giga 731 } 783 732 case 'm': rc *= 1024; // Mega 784 733 case 'k': rc *= 1024; // Kilo trunk/txlib/txstdcmd.c
r13 r14 97 97 if (stricmp(c0, "log" ) == 0) 98 98 { 99 if (TxaOptSet('r')) 100 { 101 TxSetLogReOpen( TxaOption('r')); 102 } 103 if (TxaOptSet('m')) 104 { 105 TxSetLogMaxSize( TxaOptBkmg( 'm', 2047, 'k')); 106 } 107 if (TxaOptSet('f')) 108 { 109 TxSetLogRetain( TxaOptNum('f', NULL, 1)); 110 } 111 TxAppendToLogFile( c1, TRUE); 99 if (TxaOption('?')) 100 { 101 TxPrint( "\nStart or stop logging to a file\n\n" 102 "Usage: log [filename] [-r] [-f:ff] [-m:mm]\n\n" 103 " -f[:ff] retain ff numbered logfiles when cycling\n" 104 " -m[:mm] cycle to next logfile after size mm Kb\n" 105 " -r close and reopen log on each line (slow)\n" 106 " filename filename with optional path for logfile\n" 107 " When not specified, logging is STOPPED\n\n"); 108 } 109 else 110 { 111 if (TxaOptSet('r')) 112 { 113 TxSetLogReOpen( TxaOption('r')); 114 } 115 if (TxaOptSet('m')) 116 { 117 TxSetLogMaxSize( TxaOptBkmg( 'm', 2047, 'k')); 118 } 119 if (TxaOptSet('f')) 120 { 121 TxSetLogRetain( TxaOptNum('f', NULL, 1)); 122 } 123 TxAppendToLogFile( c1, TRUE); 124 } 112 125 } 113 126 else if (stricmp(c0, "trace" ) == 0) 114 127 { 115 if ( (c1[0] == '?') ||TxaOption('?'))128 if (TxaOption('?')) 116 129 { 117 130 TxPrint( "\nSet and check TRACE level, format and destinations\n\n" 118 "Usage: trace [-r] [-s] [-t] [level | filename]\n\n"131 "Usage: trace [level | filename] [-r] [-s] [-t] [-d] [-f] [-m]\n\n" 119 132 " -d[:xx] add xx ms delay for each trace line, slowdown\n" 120 133 " -f[:ff] retain ff numbered logfiles when cycling\n" 121 " -m[:mm] cycle to next logfile after size mm \n"134 " -m[:mm] cycle to next logfile after size mm Kb\n" 122 135 " -r close and reopen log on each line (slow)\n" 123 136 " -r- open log just once (this is the default)\n" … … 266 279 char *filter[5] = {NULL,NULL,NULL,NULL,NULL}; 267 280 268 if (TxaOption('?') || (c1[0] == '?'))// explicit help request281 if (TxaOption('?')) // explicit help request 269 282 { 270 283 TxPrint("\nShow files and/or directories in selectable format\n"); trunk/txlib/txvers.h
r13 r14 40 40 // Originally developed for LPTool/DFSee utilities, open-sourced in 2005 41 41 // 42 #define TXLIB_V "1.08 12-05-2006" // JvW Logfile maximum size and auto-cycling 42 #define TXLIB_V "1.09 05-07-2006" // JvW HEXEDIT Home/End if PgUp/PgDn fails 43 //efine TXLIB_V "1.09 03-07-2006" // JvW HEXEDIT Added Find/find-Again logic 44 //efine TXLIB_V "1.09 28-06-2006" // JvW HEXEDIT Added highlighted item 0x SN 45 //efine TXLIB_V "1.09 25-06-2006" // JvW HEXEDIT RC check on all write-backs 46 //efine TXLIB_V "1.09 22-06-2006" // JvW Fix border repaint overlapping popups 47 //efine TXLIB_V "1.09 22-06-2006" // JvW HEXEDIT DEL/BACKSPACE and writeback 48 //efine TXLIB_V "1.09 20-06-2006" // JvW HEXEDIT keyboard & mouse implemented 49 //efine TXLIB_V "1.09 18-06-2006" // JvW HEXEDIT paint/movement logic implemented 50 //efine TXLIB_V "1.09 14-06-2006" // JvW Basic HEXEDIT paint logic implemented 51 //efine TXLIB_V "1.08 14-05-2006" // JvW Accurate logfile size, ext length 3 52 //efine TXLIB_V "1.08 12-05-2006" // JvW Logfile maximum size and auto-cycling 43 53 //efine TXLIB_V "1.07 04-05-2006" // JvW Avoid (history) popup from other list 44 54 //efine TXLIB_V "1.07 02-05-2006" // JvW Ctrl-D on cmdline, auto NEXT history trunk/txlib/txwdraw.c
r11 r14 461 461 fill.top = fill.bottom; 462 462 txwIntersectRect( &clip, &fill, &fill); 463 bc.ch = lc[TXLP_BOT]; 464 bc.at = TxwSC( cWinBorder_bot + csi_offset); 465 if ((style & TXWS_TF_TEXTONLY) == 0) // unless lines surpressed 466 { 467 txwScrFillRectangle( &fill, bc); 468 } 469 if (win->footer && strlen(win->footer)) 470 { 471 TRACES(( "Window footer: '%s'\n", win->footer)); 472 if ((style & TXWS_LEFTJUSTIFY) || (strlen(win->footer) > sx -2)) 473 { 474 pos = win->border.left; 475 if (style & TXWS_SIDEBORDERS) 476 { 477 pos++; 478 } 479 } 480 else 481 { 482 pos = win->border.left + ((sx - strlen(win->footer)) / 2); 483 } 484 if ( (style & TXWS_BORDERLINES) && (pos > 1) && 485 ((style & TXWS_TF_TEXTONLY) == 0)) // unless lines surpressed 486 { 487 bc.ch = lc[TXLP_TXL]; 488 txwScrDrawCellString( win->border.bottom, 489 pos -1, 490 &clip, &bc, (short ) 1, TXSB_COLOR_NORMAL); 491 492 bc.ch = lc[TXLP_TXR]; 493 txwScrDrawCellString( win->border.bottom, 494 pos +strlen(win->footer), 495 &clip, &bc, (short ) 1, TXSB_COLOR_NORMAL); 496 } 497 TRACES(("Write %u length footer to pos %hd\n", strlen(win->footer), pos)); 498 txwScrDrawCharStrCol( win->border.bottom, pos, &fill, win->footer, ((act) ? 499 TxwAC( cWinFooterFocus + csi_offset, win->footerfocus) : 500 TxwAC( cWinFooterStand + csi_offset, win->footercolor))); 463 464 if (txwIsRectShowing( hwnd, &fill)) // whole footer visible ? 465 { 466 bc.ch = lc[TXLP_BOT]; 467 bc.at = TxwSC( cWinBorder_bot + csi_offset); 468 if ((style & TXWS_TF_TEXTONLY) == 0) // unless lines surpressed 469 { 470 txwScrFillRectangle( &fill, bc); 471 } 472 if (win->footer && strlen(win->footer)) 473 { 474 TRACES(( "Window footer: '%s'\n", win->footer)); 475 if ((style & TXWS_LEFTJUSTIFY) || (strlen(win->footer) > sx -2)) 476 { 477 pos = win->border.left; 478 if (style & TXWS_SIDEBORDERS) 479 { 480 pos++; 481 } 482 } 483 else 484 { 485 pos = win->border.left + ((sx - strlen(win->footer)) / 2); 486 } 487 if ( (style & TXWS_BORDERLINES) && (pos > 1) && 488 ((style & TXWS_TF_TEXTONLY) == 0)) // unless lines surpressed 489 { 490 bc.ch = lc[TXLP_TXL]; 491 txwScrDrawCellString( win->border.bottom, 492 pos -1, 493 &clip, &bc, (short ) 1, TXSB_COLOR_NORMAL); 494 495 bc.ch = lc[TXLP_TXR]; 496 txwScrDrawCellString( win->border.bottom, 497 pos +strlen(win->footer), 498 &clip, &bc, (short ) 1, TXSB_COLOR_NORMAL); 499 } 500 TRACES(("Write %u length footer to pos %hd\n", strlen(win->footer), pos)); 501 txwScrDrawCharStrCol( win->border.bottom, pos, &fill, win->footer, ((act) ? 502 TxwAC( cWinFooterFocus + csi_offset, win->footerfocus) : 503 TxwAC( cWinFooterStand + csi_offset, win->footercolor))); 504 } 501 505 } 502 506 } … … 506 510 fill.bottom = fill.top; 507 511 txwIntersectRect( &clip, &fill, &fill); 508 bc.ch = lc[TXLP_TOP]; 509 bc.at = TxwSC( cWinBorder_top + csi_offset); 510 if ((style & TXWS_TF_TEXTONLY) == 0) // unless lines surpressed 511 { 512 txwScrFillRectangle( &fill, bc); 513 } 514 if (win->title && strlen(win->title)) 515 { 516 TRACES(( "Window title: '%s'\n", win->title)); 517 if ((style & TXWS_LEFTJUSTIFY) || (strlen(win->title) > sx -2)) 518 { 519 pos = win->border.left; 520 if (style & TXWS_SIDEBORDERS) 521 { 522 pos++; 523 } 524 } 525 else 526 { 527 pos = win->border.left + ((sx - strlen(win->title)) / 2); 528 } 529 if ( (style & TXWS_BORDERLINES) && (pos > 1) && 530 ((style & TXWS_TF_TEXTONLY) == 0)) // unless lines surpressed 531 { 532 bc.ch = lc[TXLP_TXL]; 533 txwScrDrawCellString( win->border.top, 534 pos -1, 535 &clip, &bc, (short ) 1, TXSB_COLOR_NORMAL); 536 537 bc.ch = lc[TXLP_TXR];