/********************************************************************
                           CloseNoSave

  Description: Close the active document. If the active document has
               been modified, ask if it should be saved.

  Syntax:      CloseNoSave

  To assign this script to a shortcut key:

  1. Save this script in the Gwd Text Editor \script sub-directory.
  2. From the Macro menu, choose Macro command.
  3. Choose the New button.
  4. In the New Macro Name input box, type a name for the macro,
     for example, Script_CloseNoSave.
  5. Choose the OK button.
  6. In the Edit Macro dialog box edit box enter the following two
     lines:
        Param1 "ClosNoSv.c"
        ExecScript
  7. Choose the Close button. Then choose Close again.
  8. You can now define a shortcut key for the Script_CloseNoSave
     macro in the Options/Key Mapping dialog box. Click Show Macros
     to display the macros.
     The normal Control-key editing command (WordStar) shortcut for
     this function is Control-KQ.
  9. Note that C scripts like this one are automatically interpreted
     by the GWD Editor C interpreter. There is no need for a compile
     step.

  Author: Vedran Gaco and Michael Jennings
********************************************************************/

#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <editor/doc.h>

int main(void)
{
   HDOC hDoc = Gte_GetActiveDocument();

   if(hDoc != NULL)
   {
      Gte_CloseDocument(hDoc);
   }
   return 0;
}