<commit_before>/***************************************************************************

 TextEditor.mcc - Textediting MUI Custom Class
 Copyright (C) 1997-2000 <NAME>
 Copyright (C) 2005 by TextEditor.mcc Open Source Team

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 TextEditor class Support Site:  http://www.sf.net/projects/texteditor-mcc

 $Id$

***************************************************************************/

#include <stdio.h>

#include <exec/tasks.h>
#include <exec/memory.h>
#include <libraries/mui.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/locale.h>
#include <proto/muimaster.h>
#include <proto/intuition.h>

#include "locale.h"
#include "private.h"

#include "SDI_hook.h"

#if defined(__amigaos4__)
struct Library *IntuitionBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *UtilityBase = NULL;
#elif defined(__MORPHOS__)
struct IntuitionBase *IntuitionBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *UtilityBase = NULL;
#else
struct IntuitionBase *IntuitionBase = NULL;
struct Library *MUIMasterBase = NULL;
struct LocaleBase *LocaleBase = NULL;
struct Library *UtilityBase = NULL;
#endif

#if defined(__amigaos4__)
struct IntuitionIFace *IIntuition = NULL;
struct MUIMasterIFace *IMUIMaster = NULL;
struct LocaleIFace *ILocale = NULL;
struct UtilityIFace *IUtility = NULL;
#endif

extern DISPATCHERPROTO(_DispatcherP);

int main(void)
{
  if((UtilityBase = OpenLibrary("utility.library", 38)) &&
    GETINTERFACE(IUtility, UtilityBase))
  {
    if((IntuitionBase = OpenLibrary("intuition.library", 38)) &&
      GETINTERFACE(IIntuition, IntuitionBase))
    {
      if((LocaleBase = OpenLibrary("locale.library", 38)) &&
        GETINTERFACE(ILocale, LocaleBase))
      {
        OpenCat();

        #if defined(DEBUG)
        SetupDebug();
        #endif

        if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN)) &&
           GETINTERFACE(IMUIMaster, MUIMasterBase))
        {
          Object *app = NULL;
          Object *window;
          struct MUI_CustomClass *mcc = NULL;

          if(CreateSubClasses())
            mcc = MUI_CreateCustomClass(NULL, "Group.mui", NULL, sizeof(struct InstData_MCP), ENTRY(_DispatcherP));
      
          if(mcc)
          {
            app = MUI_NewObject("Application.mui",
                MUIA_Application_Author,    "<NAME>",
                MUIA_Application_Base,      "TextEditor-Prefs",
                MUIA_Application_Copyright, "1997 <NAME>",
                MUIA_Application_Description, "Preference for TextEditor.mcc",
                MUIA_Application_Title,     "TextEditor-Prefs",
                MUIA_Application_Version,   "$VER: TextEditor-Prefs V1.0 (18-Feb-97)",

                MUIA_Application_Window,
                  window = MUI_NewObject("Window.mui",
                  MUIA_Window_Title,    "TextEditor-Prefs",
                  MUIA_Window_RootObject,
                    MUI_NewObject("Group.mui",
                    MUIA_Background, MUII_PageBack,
                    MUIA_Frame, MUIV_Frame_Text,
                    MUIA_InnerBottom, 11,
                    MUIA_InnerLeft,  6,
                    MUIA_InnerRight,   6,
                    MUIA_InnerTop,    11,

  //                  Child, RectangleObject, End,
                    Child, NewObject(mcc->mcc_Class, NULL, TAG_DONE),

                    TAG_DONE ),
                  TAG_DONE ),
                TAG_DONE );
          }

          if(app)
          {
              unsigned long sigs;

            DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
            set(window, MUIA_Window_Open, TRUE);
            while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != MUIV_Application_ReturnID_Quit)
            {
              if(sigs)
              {
                sigs = Wait(sigs | SIGBREAKF_CTRL_C);
                if(sigs & SIGBREAKF_CTRL_C)
                  break;
              }
            }

            MUI_DisposeObject(app);

            if(mcc)
              MUI_DeleteCustomClass(mcc);

            DeleteSubClasses();
          }

          DROPINTERFACE(IMUIMaster);
          CloseLibrary(MUIMasterBase);
        }

        CloseCat();

        DROPINTERFACE(ILocale);
        CloseLibrary(LocaleBase);
      }

      DROPINTERFACE(IIntuition);
      CloseLibrary(IntuitionBase);
    }

    DROPINTERFACE(IUtility);
    CloseLibrary(UtilityBase);
  }

  return 0;
}
<commit_msg>- minor compiler warning fixes.<commit_after>/***************************************************************************

 TextEditor.mcc - Textediting MUI Custom Class
 Copyright (C) 1997-2000 <NAME>
 Copyright (C) 2005 by TextEditor.mcc Open Source Team

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 TextEditor class Support Site:  http://www.sf.net/projects/texteditor-mcc

 $Id$

***************************************************************************/

#include <stdio.h>

#include <exec/tasks.h>
#include <exec/memory.h>
#include <libraries/mui.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/locale.h>
#include <proto/muimaster.h>
#include <proto/intuition.h>

#include "locale.h"
#include "private.h"

#include "SDI_hook.h"

#if defined(__amigaos4__)
struct Library *IntuitionBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *UtilityBase = NULL;
#elif defined(__MORPHOS__)
struct IntuitionBase *IntuitionBase = NULL;
struct Library *MUIMasterBase = NULL;
struct Library *LocaleBase = NULL;
struct Library *UtilityBase = NULL;
#else
struct IntuitionBase *IntuitionBase = NULL;
struct Library *MUIMasterBase = NULL;
struct LocaleBase *LocaleBase = NULL;
struct Library *UtilityBase = NULL;
#endif

#if defined(__amigaos4__)
struct IntuitionIFace *IIntuition = NULL;
struct MUIMasterIFace *IMUIMaster = NULL;
struct LocaleIFace *ILocale = NULL;
struct UtilityIFace *IUtility = NULL;
#endif

extern DISPATCHERPROTO(_DispatcherP);

int main(void)
{
  if((UtilityBase = OpenLibrary("utility.library", 38)) &&
    GETINTERFACE(IUtility, UtilityBase))
  {
    if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 38)) &&
      GETINTERFACE(IIntuition, IntuitionBase))
    {
      if((LocaleBase = (APTR)OpenLibrary("locale.library", 38)) &&
        GETINTERFACE(ILocale, LocaleBase))
      {
        OpenCat();

        #if defined(DEBUG)
        SetupDebug();
        #endif

        if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN)) &&
           GETINTERFACE(IMUIMaster, MUIMasterBase))
        {
          Object *app = NULL;
          Object *window = NULL;
          struct MUI_CustomClass *mcc = NULL;

          if(CreateSubClasses())
            mcc = MUI_CreateCustomClass(NULL, "Group.mui", NULL, sizeof(struct InstData_MCP), ENTRY(_DispatcherP));
      
          if(mcc)
          {
            app = MUI_NewObject("Application.mui",
                MUIA_Application_Author,    "<NAME>",
                MUIA_Application_Base,      "TextEditor-Prefs",
                MUIA_Application_Copyright, "1997 <NAME>",
                MUIA_Application_Description, "Preference for TextEditor.mcc",
                MUIA_Application_Title,     "TextEditor-Prefs",
                MUIA_Application_Version,   "$VER: TextEditor-Prefs V1.0 (18-Feb-97)",

                MUIA_Application_Window,
                  window = MUI_NewObject("Window.mui",
                  MUIA_Window_Title,    "TextEditor-Prefs",
                  MUIA_Window_RootObject,
                    MUI_NewObject("Group.mui",
                    MUIA_Background, MUII_PageBack,
                    MUIA_Frame, MUIV_Frame_Text,
                    MUIA_InnerBottom, 11,
                    MUIA_InnerLeft,  6,
                    MUIA_InnerRight,   6,
                    MUIA_InnerTop,    11,

  //                  Child, RectangleObject, End,
                    Child, NewObject(mcc->mcc_Class, NULL, TAG_DONE),

                    TAG_DONE ),
                  TAG_DONE ),
                TAG_DONE );
          }

          if(app)
          {
            unsigned long sigs;

            DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
            set(window, MUIA_Window_Open, TRUE);
            while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != MUIV_Application_ReturnID_Quit)
            {
              if(sigs)
              {
                sigs = Wait(sigs | SIGBREAKF_CTRL_C);
                if(sigs & SIGBREAKF_CTRL_C)
                  break;
              }
            }

            MUI_DisposeObject(app);

            if(mcc)
              MUI_DeleteCustomClass(mcc);

            DeleteSubClasses();
          }

          DROPINTERFACE(IMUIMaster);
          CloseLibrary(MUIMasterBase);
        }

        CloseCat();

        DROPINTERFACE(ILocale);
        CloseLibrary((struct Library *)LocaleBase);
      }

      DROPINTERFACE(IIntuition);
      CloseLibrary((struct Library *)IntuitionBase);
    }

    DROPINTERFACE(IUtility);
    CloseLibrary(UtilityBase);
  }

  return 0;
}

{'fraction_non_alphanumeric': 0.11902659209106074, 'fraction_numerical': 0.007850063781768227, 'mean_word_length': 2.4916067146282974, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4071011', 'n_tokens_mistral': 3170, 'n_tokens_neox': 2931, 'n_words': 687}