亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tsr.doc

?? 多任務操作系統控制的DOS環境下的實現的C語言源程序。 利用時間片的方式
?? DOC
字號:


                                                                Page 1

    Class TSR: an abstract base class for DOS resident programs.
    ------------------------------------------------------------

      Author: John English (je@unix.brighton.ac.uk)
              Department of Computing
              University of Brighton
              Brighton BN2 4GJ, England.

      Copyright (c) J.English 1993.

      Permission is granted to use copy and distribute the
      information contained in this file provided that this
      copyright notice is retained intact and that any software
      or other document incorporating this file or parts thereof
      makes the source code for the TSR class of which this file
      is a part freely available.


    1. Introduction.
    ----------------
    This class provides a framework for writing memory-resident DOS
    programs (TSRs).  TSRs produced using this class can be woken up
    by a specific key (the "hotkey") or after a specified number of
    timer ticks (the "timeslice") or a combination of both.  Writing
    TSRs unaided is a non-trivial task, but this class provides the
    essential TSR functionality which allows you to concentrate on
    your application-specific requirements.  TSRs written using this
    class will require a PC/AT compatible machine running DOS version
    3 or higher.  Compile them with Borland C++ version 3.0 or higher.

    To create a TSR using this class, you must derive a class for your
    application from it.  You must supply a function "main" in your
    application class, which will be called whenever the TSR is woken
    up.  To create a TSR, declare an instance of your derived class.

    A program built using an instance of your class can make itself
    resident using the member function "run", it can test if a copy
    is already loaded using the member function "loaded", and it can
    unload a previously loaded copy using the member function "unload".
    A foreground copy can also communicate with a resident copy using
    the functions "request" and "respond".  Each TSR must be given a
    unique name up to 32 characters long which can be used to identify
    it once it is made resident.

    The constructor and "run" will set an internal status code if any
    errors are detected.  If "run" returns, this will show the cause
    of the error.  The status can be tested during program execution
    using the member function "status".  This can be used to display
    meaningful error messages or to return as the program exit status.
    The member function "name" returns the name of the TSR, which can
    also be used in error messages.

    If you find this class useful or have any suggestions as to how it
    can be enhanced, please contact the author at one of the addresses
    given above.  E-mail and postcards will both be welcome!


    2. Deriving a new TSR class "MyTSR" from class TSR.
    ---------------------------------------------------
    The constructor for your derived class "MyTSR" must invoke the
    constructor for class TSR.  The constructor for class TSR takes


                                                                Page 2

    two parameters:

      * a unique string which will be used to identify your TSR, and

      * the size in bytes of the stack to be used when the resident
        part of your TSR is active.  If no stack size is specified,
        the default stack size is taken to be 1024 bytes.

    Class MyTSR must also provide a definition of a member function
    called "main" which will contain the application-specific code
    for your TSR.  This will be executed whenever your TSR is woken
    up.  It must be declared as follows:

        void main (int hotkey);

    Class MyTSR may also provide a destructor (~MyTSR), but this will
    only be called when the TSR is not made resident.

    Having created a derived class, you should then declare a single
    instance of this class in your program, as for example:

        MyTSR my_tsr;

    You must not declare more than one instance of a class derived
    from TSR in your program.

    Your program can obtain status information by calling the following
    member functions:

      my_tsr.name ();
          This returns the name of the TSR instance (as specified
          in the constructor call to class TSR).

      my_tsr.loaded ();
          This returns an integer result which will be non-zero
          if a copy of the TSR is already loaded.

      my_tsr.status ();
          This returns an integer result which will be non-zero
          if any errors have been detected by the constructor or
          by "run".  The error codes are as follows:

            1: incompatible DOS version (version 3 or higher required)
            2: attempt to declare more than one instance of a TSR
            3: unable to create stack of specified size
            4: cannot allocate self-identify multiplex function
            5: TSR already loaded
            6: failed to make TSR resident (unlikely to occur)
            7: user "startup" function reported failure

      my_tsr.unload ();
          This attempts to unload a previously-loaded copy of the
          TSR.  It returns an integer result which will be non-zero
          if it failed, as follows:
 
            1: TSR not loaded, so it cannot be unloaded.
            2: Something else has hooked the same interrupts, so it
               cannot be unloaded.


                                                                Page 3

            3: Unable to free memory, so it cannot be unloaded (but it
               will now be disabled and will no longer respond to the
               hotkey or to timer ticks).  This is unlikely to occur.
            4: unable to free TSR environment space (although the TSR
               itself will have been successfully unloaded). This is
               unlikely to occur.


    3. Making your TSR resident.
    ----------------------------
    To make your TSR resident in memory, call the member function
    "run".  "Run" requires two parameters:

      * A value representing the hotkey to be used to activate the
        TSR.  This is described further below.

      * An optional timeslice size.  This is an integer giving the
        number of timer ticks between TSR activations (a timer tick
        is approximately 55 milliseconds).  If this parameter is
        omitted or zero, the TSR will only be activated when the
        hotkey is pressed.   

    The hotkey should be a combination of values from the following
    list:

      Modifiers: TSR::ALT, TSR::CTRL, TSR::LSHIFT, TSR::RSHIFT
      Keycodes:  TSR::KEY_A to TSR::KEY_Z, TSR::KEY_0 to TSR::KEY_9,
                 TSR::ENTER, TSR::SPACE, TSR::F1 to TSR::F10

    The hotkey value must not use more than one of the values from
    the "keycodes" list above.  If you do not wish a hotkey to be
    used, specify a value of TSR::NONE for the hotkey parameter.
    Some examples of valid hotkey specifications are shown below:

        my_tsr.run (TSR::ALT + TSR::F1);
            // "my_tsr" should be woken up whenever Alt-F1 is pressed.

        my_tsr.run (TSR::LSHIFT + TSR::RSHIFT);
            // "my_tsr" should be woken up whenever the left and right
            // shift keys are pressed at the same time.

    If you specify a hotkey of TSR::NONE and no timeslice is specified
    either, "main" will never be woken up.  You can use this to load
    interrupt handlers (using "startup" and "shutdown" as described
    below) which need to remain resident but do not need to interact
    with the user in any way.  "Main" should be an empty function if
    this is the case, since it will never be called.

    If the TSR is installed successfully, "run" will not return.
    If "run" returns, it indicates that an error has occurred.  The
    member function "status" (see above) can be used to determine
    the cause of the error.


    4. Writing the member function "main".
    --------------------------------------
    "MyTSR::main" (the main function of your derived class) will be
    called whenever the TSR is woken up, either as the result of the
    hotkey being pressed or the specified timeslice expiring.  The


                                                                Page 4

    parameter "hotkey" will be non-zero if the TSR was woken up by
    the hotkey being pressed and zero if it was woken up because the
    timeslice expired.  "Main" cannot perform operations which call
    DOS functions 00 - 0C (character I/O), 48 (allocate memory), 4C
    (terminate process) or 3E (close file, standard files only), but
    otherwise it is a normal C++ function.
    
    The following member functions can be used within "main":

      void pause ();
          This should be called whenever your "main" function is
          performing any lengthy processing.  It allows other TSRs
          to execute while your TSR is active.

      void sync ();
          Timed activations normally occur every N timer ticks after
          "run" is called.  This function resets the timer so that
          the next timed activation will happen N timer ticks from
          now, rather than when the current timer count expires.
          This can be useful to resynchronise timed activations if
          a hotkey is used to enable/disable TSR activity.

      int userbreak ();
          This returns a non-zero result if "control-break" has been
          pressed since it was last called.  This can be polled from
          "main" if control-break detection is required.

    Your class may also overload the following functions to perform
    error recovery for the resident part of your program:

      critical_code critical_error (int n);
          Called when a critical error (Abort, Retry, Fail?) occurs
          during execution of "main".  You must not call any DOS
          services other than functions 00 - 0C within this function.
          The result must be one of the values TSR::IGNORE, TSR::RETRY
          or TSR::FAIL.  The default action for this function is to
          return TSR::FAIL.

      void dos_error (int fn, int ce, int cs, int ip);
          Called when an illegal DOS function is called from within
          "main" or "critical_error" (see above).  The parameter "fn"
          is the function code from register AH; "ce" is non-zero if
          the error occurred while a critical error was being handled;
          "cs" and "ip" are the segment and offset of the return address
          from the offending interrupt.  If this function is called it
          indicates a bug in your "main" or "critical_error" functions.
          You must not use any DOS services in this function (although
          BIOS services can still be used).  The default action is to
          reset the screen to text mode if it is in graphics mode and
          then display an error message.

    These functions should not be called directly; they will be called
    automatically if an error occurs during execution of "main".


    5. Initialisation and finalisation.
    -----------------------------------
    Since a TSR which is made resident does not exit in the normal way,
    the destructor for your TSR will only be called if it is not made


                                                                Page 5

    resident.  However, you may need to perform some initialisation when
    the TSR is made resident (e.g. hooking interrupts) and finalisation
    when it is unloaded (e.g. restore the original interrupt vectors).
    There are two virtual functions which can be overloaded to perform
    this sort of initialisation and finalisation:

      void startup ();
        Called by "run" when the TSR is being installed in memory.  This
        can be used to provide application-specific initialisation (e.g.
        hooking interrupts).  The default is to do nothing.

      void shutdown ();
        Called by "unload" when the TSR is being unloaded from memory.
        This can be used to provide application-specific finalisation
        (e.g. restoring hooked interrupt vectors).  The default is to
        do nothing.

    These functions should not be called directly; they will be called
    automatically during TSR loading and unloading.


    6. Communicating with a resident TSR.
    -------------------------------------
    Sometimes it may be necessary to communicate with a resident copy of
    a TSR from a foreground program to adjust its parameters in some way.
    The functions "request" and "respond" provide a method to perform
    such communication.  The program should provide an appropriate
    implementation for the virtual function "respond", which has the
    following specification:

        int respond (int fn, int far& p1, int far& p2);

    The parameter "fn" will be a function code in the range 0 to 127, and
    the parameters "p1" and "p2" can be used for an application-specific
    parameter list (which could be the segment and offset of a far pointer
    of a lengthier parameter list).

    A copy of the program loaded in the foreground can communicate with
    a previously-loaded resident copy by calling the function "request".
    "Request" requires three reference-to-integer parameters which will
    be used to call "respond" in the resident copy; the first one should
    contain the function code to be passed to "respond" and the remaining
    two will be passed to "respond" as the parameters "p1" and "p2".  The
    result from "respond" will be stored in the first parameter, and the
    final values of "p1" and "p2" produced by "respond" will be stored in
    the last two.  "Request" returns zero if the call is successful, and
    a non-zero result (TSR::NOT_LOADED) if there is no resident copy to
    communicate with.


    7. A plea for feedback.
    -----------------------
    If you use this class, please contact the author via the addresses
    at the beginning; if you don't have e-mail access please send me a
    postcard (I like postcards!) just to let me know you've looked at
    it.  Feel free to suggest enhancements, find bugs or (better still)
    fix them and send me patches.  Happy hacking!

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女www一区二区| 亚洲一区在线观看免费观看电影高清 | 本田岬高潮一区二区三区| 亚洲激情图片小说视频| 日韩女优av电影在线观看| www.在线成人| 国产综合一区二区| 亚洲国产美女搞黄色| 国产三级三级三级精品8ⅰ区| 欧美揉bbbbb揉bbbbb| 国产99久久久精品| 日本视频在线一区| 一区二区三区蜜桃网| 久久久噜噜噜久久中文字幕色伊伊| 欧亚一区二区三区| 不卡在线视频中文字幕| 激情综合色综合久久综合| 亚洲国产综合色| 国产精品久久看| 久久久久久综合| 日韩午夜激情av| 欧美日韩国产高清一区| 99re热视频精品| 高清在线观看日韩| 久久99精品久久久久久国产越南| 亚洲r级在线视频| 亚洲嫩草精品久久| 国产精品福利影院| 国产日韩欧美精品电影三级在线 | 久久久精品免费网站| 91精品国产综合久久久久久漫画| 在线视频国内自拍亚洲视频| 91香蕉视频mp4| 99国产精品国产精品毛片| 成人免费的视频| 国产成人一区二区精品非洲| 激情欧美一区二区三区在线观看| 免费看日韩精品| 日本成人中文字幕在线视频 | 亚洲精品五月天| 国产精品美女一区二区在线观看| 欧美成人福利视频| 精品国产乱子伦一区| 精品久久久三级丝袜| 精品美女在线播放| 精品成人一区二区| 久久久www免费人成精品| 久久欧美中文字幕| 国产欧美一区视频| 中文字幕一区二区三区在线播放| 国产精品视频一二三区| 国产精品久久久久久户外露出 | 欧美亚州韩日在线看免费版国语版| 91社区在线播放| 欧美色成人综合| 欧美久久一二三四区| 欧美一区二区在线视频| 精品美女一区二区三区| 国产欧美一区二区精品仙草咪| 中文字幕精品一区| 亚洲黄网站在线观看| 五月激情丁香一区二区三区| 男女性色大片免费观看一区二区 | 自拍偷拍亚洲激情| 一区二区三区在线视频免费| 亚洲综合色网站| 日本美女一区二区三区| 国产一区三区三区| 不卡高清视频专区| 欧美性色黄大片| 日韩一区二区三区三四区视频在线观看 | 亚洲精品视频在线| 视频在线在亚洲| 国产中文字幕一区| 99国产欧美久久久精品| 91.com在线观看| 国产三级欧美三级日产三级99| 亚洲欧美日韩成人高清在线一区| 五月婷婷久久丁香| 国产精品1区2区3区在线观看| aa级大片欧美| 欧美一区二区网站| 国产精品色婷婷| 亚洲h动漫在线| 国产精品亚洲专一区二区三区 | 樱桃视频在线观看一区| 日韩avvvv在线播放| 国产成人在线看| 精品视频一区三区九区| 2020国产精品自拍| 一区二区日韩av| 国产一区二区久久| 在线一区二区视频| 久久久五月婷婷| 亚洲一区二区在线免费看| 久久99精品国产麻豆婷婷| 一本在线高清不卡dvd| 精品国产污网站| 亚洲精品自拍动漫在线| 国产一区二三区| 欧美日韩一区国产| 中文字幕亚洲区| 国内精品国产成人国产三级粉色| 在线亚洲人成电影网站色www| 久久精品一区蜜桃臀影院| 午夜国产精品一区| 91视视频在线观看入口直接观看www | 99re视频精品| 久久人人爽人人爽| 免费在线观看一区| 欧美性色综合网| 亚洲欧美在线视频| 国产成人综合在线| 日韩美女一区二区三区四区| 亚洲综合精品自拍| 99久久久精品| 欧美国产精品中文字幕| 加勒比av一区二区| 欧美一区2区视频在线观看| 一个色在线综合| 91尤物视频在线观看| 欧美高清在线精品一区| 国产一区视频网站| 26uuu亚洲| 精彩视频一区二区| 日韩欧美国产一区二区在线播放| 亚洲精品你懂的| 99久久婷婷国产| 中文字幕一区二区三区四区| 国产成人一级电影| 国产日韩精品一区二区三区在线| 极品销魂美女一区二区三区| 日韩欧美一区二区三区在线| 日韩精品电影在线观看| 欧美高清hd18日本| 日韩国产欧美三级| 欧美一区二区三区系列电影| 水野朝阳av一区二区三区| 欧美日韩国产123区| 亚洲va韩国va欧美va| 欧美日韩国产片| 丝袜美腿亚洲综合| 欧美一二三四在线| 久久av老司机精品网站导航| 欧美不卡一区二区三区四区| 激情国产一区二区| 国产日韩欧美综合在线| 风间由美一区二区av101 | 日韩成人一级片| 在线播放日韩导航| 蜜臀a∨国产成人精品| 欧美成人综合网站| 国产福利91精品一区| 亚洲国产成人高清精品| 欧美日韩高清一区二区三区| 日韩精品亚洲专区| 日韩免费在线观看| 国产成人午夜电影网| 中文字幕一区二区三区蜜月| 91在线观看成人| 亚洲午夜电影在线观看| 欧美一区二区视频在线观看2022 | 亚洲国产精品久久久男人的天堂 | 国产欧美一区二区在线| 成人黄色av网站在线| 亚洲另类色综合网站| 制服丝袜亚洲精品中文字幕| 激情综合网最新| 亚洲三级在线播放| 欧美精品第一页| 国产精品99久久久久久宅男| ●精品国产综合乱码久久久久| 欧美日韩在线免费视频| 久久精品国产久精国产| 国产精品伦理一区二区| 在线观看视频91| 久久精品国产精品青草| 国产精品色在线| 91麻豆精品久久久久蜜臀| 国产精品一区二区三区乱码| 亚洲黄色免费网站| 亚洲精品一区二区三区影院 | 精品国产网站在线观看| 99久久精品99国产精品| 天堂久久一区二区三区| 日本一区二区三区免费乱视频| 欧美伊人久久久久久午夜久久久久| 久久国产日韩欧美精品| 中文字幕在线不卡视频| 日韩一级完整毛片| 91蜜桃网址入口| 精彩视频一区二区三区| 亚洲国产欧美在线| 亚洲国产精品激情在线观看| 欧美精品乱码久久久久久| 风间由美一区二区三区在线观看| 日本午夜精品视频在线观看| 亚洲欧美一区二区在线观看| 精品国产麻豆免费人成网站| 欧美日韩一区二区在线观看视频|