⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oomisc.pas

📁 Async Professional 4.04
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  eRM   {.} = 90;      {Reset mode}
  eSATM { } = 91;      {Selected area transfer mode}
  eSD   { } = 92;      {Scroll down}
  eSEM  { } = 93;      {selected editing extent mode}
  eSGR  {X} = eSetAttribute;{Select graphics rendition}
  eSL   { } = 94;      {Scroll left}
  eSM   {.} = eSetMode;{Set Mode}
  eSPA  { } = 95;      {Start of protected area}
  eSPI  { } = 96;      {Spacing increment}
  eSR   { } = 97;      {Scroll right}
  eSRM  { } = 98;      {Send-Receive mode}
  eSRTM { } = 99;      {Status report transfer mode}
  eSS2  { } = 100;     {Single shift 2}
  eSS3  { } = 101;     {Single shift 3}
  eSSA  { } = 102;     {Start of selected area}
  eST   { } = 103;     {String terminator}
  eSTS  { } = 104;     {Set transmit state}
  eSU   { } = 105;     {Scroll up}
  eTBC  {X} = 106;     {Tabulation clear}
  eTSM  { } = 107;     {Tabulation stop mode}
  eTSS  { } = 108;     {Thin space specification}
  eTTM  { } = 109;     {Transfer termination mode}
  eVEM  { } = 110;     {Vertical editing mode}
  eVPA  {X} = 111;     {Vertical position absolute}
  eVPR  {X} = eCUD;    {Vertical position relative}
  eVTS  {X} = 112;     {vertical tabulation set}
  eDECSTBM  = 113;     {dec private-set Top/Bottom margin}

  eENQ  {X} = 114;     {enquiry request}
  eBEL  {X} = 115;     {sound bell}
  eBS   {X} = 116;     {backspace}
  eLF   {X} = 117;     {line feed command}
  eCR   {X} = 118;     {carriage return}
  eSO   {X} = 119;     {invoke G1 charset}
  eSI   {X} = 120;     {invoke G0 charset}
  eIND2 {X} = 121;     {corrected eIND (<> eCUD, eDown) new term only}
  eDECALN   = 122;     {DEC PRIVATE-screen alignment display}
  eDECDHL   = 123;     {DEC PRIVATE-Double height line}
  eDECDWL   = 124;     {DEC PRIVATE-Double width line}
  eDECLL    = 125;     {DEC PRIVATE-load LEDs}
  eDECREQTPARM = 126;  {DEC PRIVATE-request terminal parameters}
  eDECSWL   = 127;     {DEC PRIVATE-single width line}
  eDECTST   = 128;     {DEC PRIVATE-Invoke confidence test}
  eDECSCS   = 129;     {DEC PRIVATE-select charset}

  {Extended attributes}
  eattrBlink      = $01;
  eattrInverse    = $02;
  eattrIntense    = $04;
  eattrInvisible  = $08;
  eattrUnderline  = $10;

  {ANSI color constants}
  emBlack       = 0;
  emRed         = 1;
  emGreen       = 2;
  emYellow      = 3;
  emBlue        = 4;
  emMagenta     = 5;
  emCyan        = 6;
  emWhite       = 7;
  emBlackBold   = 8;
  emRedBold     = 9;
  emGreenBold   = 10;
  emYellowBold  = 11;
  emBlueBold    = 12;
  emMagentaBold = 13;
  emCyanBold    = 14;
  emWhiteBold   = 15;

  {AnsiEmulator option flags}
  teMapVT100           = $0001;

  {Misc}
  MaxParams   = 5;       {Maximum parameters for our interpreter}
  MaxQueue    = 20;      {Maximum characters in queue}
  MaxOther    = 11;      {Maximum other data}
  MaxParamLength = 5;    {Maximum parameter length for interpreter}
  KeyMappingLen = 20;   {Maximum length of a keymapping}

type
  {AnsiEmulator's parser states}
  TAnsiParser = (GotNone, GotEscape, GotBracket, GotSemiColon, GotParam,
                 GotCommand, GotControlSeqIntro, GotLeftBrace, GotRightBrace,
                 GotSpace, GotQuestionMark, GotQuestionParam);

  {Array used for internal queue}
  TQueue = Array[1..MaxQueue] of Char;

  {Emulator for PC ANSI codes}
  PAnsiEmulator = ^TAnsiEmulator;
  TAnsiEmulator = record
    emuType        : Cardinal;       { Emulator Type }
    emuFlags       : Cardinal;
    emuFirst       : Bool;           {True if first time thru}
    emuAttr        : Byte;
    emuIndex       : Cardinal;       {Index into rcvd byte array}
    emuParamIndex  : Cardinal;       {Parameter index}
    emuQueue       : TQueue;         {Queue of recvd bytes}
    emuParamStr    : array[1..MaxParams] of string[MaxParamLength];
    emuParamInt    : array[1..MaxParams] of Integer;
    emuParserState : TAnsiParser;    {Current state}
    emuOther       : Pointer;
  end;

const
  {Terminal window Cardinal}
  gwl_Terminal = 0;

  {Terminal options}
  tws_WantTab        = $0001; {Process tabs internally}
  tws_IntHeight      = $0002; {Integral height}
  tws_IntWidth       = $0004; {Integral width}
  tws_AutoHScroll    = $0008; {Add/remove horiz scroll automatically}
  tws_AutoVScroll    = $0010; {Add/remove vert scroll automatically}

type
  {For general typecasting}
  LH = record
    L,H : Word;
  end;

const
  MaxDBRecs    = 999;         {Maximum number of database records}
  MaxNameLen   = 21;          {Maximum length of a profile string key}
  MaxIndexLen  = 31;          {Maximum length of an index string}
  NonValue     = '#';         {Value of DB fields SPECIFICALLY left blank}
  dbIndex      = 'Index';     {Item index section heading}
  dbDefaults   = 'Defaults';  {Default value section heading}
  dbNumEntries = '_Entries';  {Number of entries key name}
  dbBogus      = 'None';      {Bogus key name for creating sections}

type
  PIniDatabaseKey = ^TIniDatabaseKey;
  TIniDatabaseKey = record
    KeyName  : PChar;
    DataSize : Cardinal;
    StrType  : Bool;
    Index    : Bool;
    Next     : PIniDatabaseKey;
  end;

  PIniDatabase = ^TIniDatabase;
  TIniDatabase = record
    FName          : PChar;
    DictionaryHead : PIniDatabaseKey;
    DictionaryTail : PIniDatabaseKey;
    NumRecords     : Integer;
    RecordSize     : Cardinal;
    DefaultRecord  : Pointer;
    Prepared       : Bool;
  end;

const
  ApdMaxTags      = 5;     {Maximum number of err corr or data comp tags} 
  ApdTagSepChar   = ',';   {Character that separates tags in a profile string} 

const
  ApdModemNameLen = 31;    {Length of a modem name string}             
  ApdCmdLen       = 41;    {Maximum length of a modem command}         
  ApdRspLen       = 21;    {Maximum length of a modem response}        
  ApdTagLen       = 21;    {Maximum length of a tag string}            
  ApdTagProfLen   = 105;   {Maximum length of a tag profile string}    
  ApdBoolLen      = 5;     {Maximum length of a boolean string}        
  ApdBaudLen      = 7;     {Maximum length of a baud rate string}      
  ApdConfigLen    = 255;   {Maximum length of a configuration string}  

type
  {where these same variables are declared as Strings.}
  TModemNameZ     = array[0..ApdModemNameLen] of Char;                 
  TCmdStringZ     = array[0..ApdCmdLen] of Char;                       
  TRspStringZ     = array[0..ApdRspLen] of Char;                       
  TTagStringZ     = array[0..ApdTagLen] of Char;                       
  TTagProfStringZ = array[0..ApdTagProfLen] of Char;                   
  TConfigStringZ  = array[0..ApdConfigLen] of Char;                    
  TBoolStrZ       = array[0..ApdBoolLen] of Char;                      
  TBaudStrZ       = array[0..ApdBaudLen] of Char;                      

  TTagArrayZ = array[1..ApdMaxTags] of TTagStringZ;                    

  PModemBaseData = ^TModemBaseData;
  TModemBaseData = record
    Name          : TModemNameZ;
    InitCmd       : TCmdStringZ;
    DialCmd       : TCmdStringZ;
    DialTerm      : TCmdStringZ;
    DialCancel    : TCmdStringZ;
    HangupCmd     : TCmdStringZ;
    ConfigCmd     : TConfigStringZ;
    AnswerCmd     : TCmdStringZ;
    OkMsg         : TRspStringZ;
    ConnectMsg    : TRspStringZ;
    BusyMsg       : TRspStringZ;
    VoiceMsg      : TRspStringZ;
    NoCarrierMsg  : TRspStringZ;
    NoDialToneMsg : TRspStringZ;
    ErrorMsg      : TRspStringZ;
    RingMsg       : TRspStringZ;
  end;

  PModemData = ^TModemData;
  TModemData = record
    Data        : TModemBaseData;
    NumErrors   : Cardinal;
    Errors      : TTagArrayZ;
    NumComps    : Cardinal;
    Compression : TTagArrayZ;
    LockDTE     : Bool;
    DefBaud     : LongInt;
  end;

  PModemXFer = ^TModemXFer;
  TModemXFer = record
    Data     : TModemBaseData;
    Errors   : TTagProfStringZ;
    Compress : TTagProfStringZ;
    LockDTE  : TBoolStrZ;
    DefBaud  : TBaudStrZ;
  end;

  PModemDatabase = ^TModemDatabase;
  TModemDatabase = record
    DB : PIniDatabase;
  end;


const
  {keyboard shift state masks}
  ksControl = $02;
  ksAlt     = $04;
  ksShift   = $08;

  {keyboard toggle state masks}
  tsCapital = $02;
  tsNumlock = $04;
  tsScroll  = $08;

  {keyboard INI file constants}
  ApdKeyMapNameLen  = 30;    {Length of a KeyMap name string}          
  ApdMaxKeyMaps     = 100;   {Maximum possible key mapping per type}   

  ApdKeyIndexName    = 'EMULATOR';                                     
  ApdKeyIndexMaxLen  = 120;                                            

type
  TKeyMapName    = array[0..ApdKeyMapNameLen] of Char;                 
  TKeyMapping    = array[0..KeyMappingLen] of char;                 
  TKeyMappingStr = string[KeyMappingLen];


  PKeyMapXFerRec = ^TKeyMapXFerRec;
  TKeyMapXFerRec = record
    Name : TKeyMapName;
    Keys : array[1..ApdMaxKeyMaps] of TKeyMapping;
  end;

  PVKeyMapRec = ^TVKeyMapRec;
  TVKEyMapRec = record
    KeyCode   : Cardinal;
    ShiftState: Cardinal;
    Mapping   : TKeyMappingStr;
  end;

  PKeyEmulator = ^TKeyEmulator;
  TKeyEmulator = record
    kbKeyFileName : PChar;                            { current file name }
    kbKeyName     : TKeyMapName;                      { current key index name }
    kbProcessAll  : Bool;
    kbProcessExt  : Bool;
    kbKeyNameList : array[0..ApdKeyIndexMaxLen] of char;
    kbKeyMap      : array[1..ApdMaxKeyMaps] of TVKeyMapRec;
    kbKeyDataBase : PIniDataBase;          { pointer to the INI data base file }
  end;

const
  {---- Option codes for protocols ----}
  apIncludeDirectory   = $0001;   {Set to include directory in file names}
  apHonorDirectory     = $0002;   {Set to honor directory in file names}
  apRTSLowForWrite     = $0004;   {Set to lower RTS during disk writes}
  apAbortNoCarrier     = $0008;   {Set to abort protocol on DCD loss}
  apKermitLongPackets  = $0010;   {Set to support long packets}
  apKermitSWC          = $0020;   {Set to support SWC}
  apZmodem8K           = $0040;   {Set to support 8K blocks}
  apBP2KTransmit       = $0080;   {Set to support 2K transmit blocks}
  apAsciiSuppressCtrlZ = $0100;   {Set to stop transmitting on ^Z}

  {---- Default options for protocols ----}
  DefProtocolOptions = 0;
  BadProtocolOptions = apKermitLongPackets+apKermitSWC+apZmodem8K;

  {Block check codes}
  bcNone      = 0;        {No block checking}
  bcChecksum1 = 1;        {Basic checksum}
  bcChecksum2 = 2;        {Two byte checksum}
  bcCrc16     = 3;        {16 bit Crc}
  bcCrc32     = 4;        {32 bit Crc}
  bcCrcK      = 5;        {Kermit style Crc}

  {Convenient blockcheck string constants}
  bcsNone      = 'No check';
  bcsChecksum1 = 'Checksum';
  bcsChecksum2 = 'Checksum2';
  bcsCrc16     = 'Crc16';
  bcsCrc32     = 'Crc32';
  bcsCrck      = 'CrcKermit';

  {Constants for supported protocol types}
  NoProtocol  = 0;
  Xmodem      = 1;
  XmodemCRC   = 2;
  Xmodem1K   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -