Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.5 KiB

  1. /*** skel.c - skeleton for editor extension
  2. *
  3. * Copyright <C> 1988, Microsoft Corporation
  4. *
  5. * Purpose:
  6. * Example source code for a loadable C editor extension.
  7. *
  8. * NOTE: This code is shipped with the product! This note and the revision
  9. * history should be removed before shipping.
  10. *
  11. * Revision History:
  12. * 24-Sep-1991 rs Ported to Windows NT
  13. * 16-Jan-1987 mz Add pascal typing. Export switch set
  14. * 21-May-1987 bw Add return from WhenLoaded for OS/2
  15. * 22-Oct-1987 mz Correct definitions as headers
  16. * 22-Jun-1988 ln Updated and documented
  17. * 12-Sep-1988 mz Made WhenLoaded match declaration
  18. *
  19. *************************************************************************/
  20. #include "ext.h"
  21. /** Skel - Sample Editing Function
  22. *
  23. * Purpose:
  24. * Sample editing function entry point.
  25. *
  26. * Editor functions are commands that can be attached to keys and are invoked
  27. * when those keys are struck.
  28. *
  29. * Input:
  30. * argData = Value of the keystroke used to invoke the function
  31. * pArg = Far pointer to a structure which defines the type of argument
  32. * passed by the invoker of the function
  33. * fMeta = Flag indicating whether the meta modifier was on at the time
  34. * the function was executed.
  35. *
  36. * Output:
  37. * Editor functions are expected to return a boolean value indicating success
  38. * or failure. Typically, TRUE is returned in the normal case. These values
  39. * can be tested inside of macros.
  40. *
  41. ************************************************************************/
  42. flagType
  43. pascal
  44. EXTERNAL
  45. Skel (
  46. unsigned int argData,
  47. ARG far * pArg,
  48. flagType fMeta
  49. )
  50. {
  51. return TRUE;
  52. }
  53. /*** WhenLoaded - Extension Initialization
  54. *
  55. * Purpose:
  56. * This function is called whenever the extension is loaded into memory.
  57. * Extension initialization may occur here.
  58. *
  59. * Input:
  60. * none
  61. *
  62. * Output:
  63. * none
  64. *
  65. *************************************************************************/
  66. void
  67. EXTERNAL
  68. WhenLoaded (
  69. void
  70. )
  71. {
  72. }
  73. //
  74. // Command description table. This is a vector of command descriptions that
  75. // contain the textual name of the function (for user assignment), a pointer
  76. // to the function to be called, and some data describing the type of
  77. // arguments that the function can take.
  78. //
  79. struct cmdDesc cmdTable[] = {
  80. { "skel", Skel, 0, NOARG },
  81. { NULL, NULL, NULL, NULL }
  82. };
  83. //
  84. // Switch description table. This is a vector of switch descriptions that
  85. // contain the textual name of the switch (for user assignment), a pointer to
  86. // the switch itself or a function to be called, and some data describing the
  87. // type of switch.
  88. //
  89. struct swiDesc swiTable[] =
  90. {
  91. {NULL, NULL, NULL }
  92. };