<commit_before>#include <exec/types.h>
#include <exec/memory.h>
#include <intuition/intuition.h>
#include <dos/dos.h>
#include <dos/dostags.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "NiKomStr.h"
#include "NiKomLib.h"
#include "PreNodeFuncs.h"
#include "Logging.h"
#include "Terminal.h"
#include "NewUser.h"
#include "BasicIO.h"
#include "Languages.h"

#define EXIT_ERROR	10
#define EXIT_OK	0
#define EKO	1
#define EJEKO	0

int CXBRK(void) { return(0); }

struct IntuitionBase *IntuitionBase=NULL;
struct RsxLib *RexxSysBase=NULL;
struct Library *UtilityBase, *NiKomBase;
struct Window *NiKwind=NULL;
struct MsgPort *rexxport, *nikomnodeport;

char rexxportnamn[20], pubscreen[40],nodid[20], nikomnodeportnamn[15];
int inloggad, getty,gettybps,relogin=FALSE,ypos,xpos,ysize,xsize;

extern char commandhistory[], inmat[], outbuffer[];
extern int hangupdelay, dtespeed, highbaud, nodnr, nodestate;
extern struct System *Servermem;

struct NodeType *selectNodeType(void);

struct Window *openmywindow(char *screenname) {
	static char titel[32];
	sprintf(titel,"NiKom PreNode, nod #%d SER:",nodnr);
	return(OpenWindowTags(NULL,WA_Left,xpos,
										WA_Top,ypos,
										WA_Width,xsize,
										WA_Height,ysize,
										WA_IDCMP,IDCMP_CLOSEWINDOW,
										WA_MinWidth,50,
										WA_MinHeight,10,
										WA_MaxWidth,~0,
										WA_MaxHeight,~0,
										WA_SizeGadget,TRUE,
										WA_SizeBBottom, TRUE,
										WA_DragBar,TRUE,
										WA_DepthGadget,TRUE,
										WA_CloseGadget,TRUE,
										WA_SimpleRefresh,TRUE,
										WA_Title,titel,
										WA_ScreenTitle,"NiKom Prenode",
										WA_AutoAdjust,TRUE,
										WA_PubScreenName,screenname,
										TAG_DONE));
}


void cleanup(int errorCode, char *text) {
  LogEvent(SYSTEM_LOG, ERROR, "PreNode (%d) is exiting with error code %d: %s",
           nodnr, errorCode, text);

  CloseCatalog(g_Catalog);
  shutdownnode(NODSER);
  CloseIO();
  if(NiKwind) {
    CloseWindow(NiKwind);
  }
  if(LocaleBase) {
    CloseLibrary((struct Library *)LocaleBase);<commit_msg>Removing logging an error in System.log when PreNode shuts down normally.<commit_after>#include <exec/types.h>
#include <exec/memory.h>
#include <intuition/intuition.h>
#include <dos/dos.h>
#include <dos/dostags.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "NiKomStr.h"
#include "NiKomLib.h"
#include "PreNodeFuncs.h"
#include "Logging.h"
#include "Terminal.h"
#include "NewUser.h"
#include "BasicIO.h"
#include "Languages.h"

#define EXIT_ERROR	10
#define EXIT_OK	0
#define EKO	1
#define EJEKO	0

int CXBRK(void) { return(0); }

struct IntuitionBase *IntuitionBase=NULL;
struct RsxLib *RexxSysBase=NULL;
struct Library *UtilityBase, *NiKomBase;
struct Window *NiKwind=NULL;
struct MsgPort *rexxport, *nikomnodeport;

char rexxportnamn[20], pubscreen[40],nodid[20], nikomnodeportnamn[15];
int inloggad, getty,gettybps,relogin=FALSE,ypos,xpos,ysize,xsize;

extern char commandhistory[], inmat[], outbuffer[];
extern int hangupdelay, dtespeed, highbaud, nodnr, nodestate;
extern struct System *Servermem;

struct NodeType *selectNodeType(void);

struct Window *openmywindow(char *screenname) {
	static char titel[32];
	sprintf(titel,"NiKom PreNode, nod #%d SER:",nodnr);
	return(OpenWindowTags(NULL,WA_Left,xpos,
										WA_Top,ypos,
										WA_Width,xsize,
										WA_Height,ysize,
										WA_IDCMP,IDCMP_CLOSEWINDOW,
										WA_MinWidth,50,
										WA_MinHeight,10,
										WA_MaxWidth,~0,
										WA_MaxHeight,~0,
										WA_SizeGadget,TRUE,
										WA_SizeBBottom, TRUE,
										WA_DragBar,TRUE,
										WA_DepthGadget,TRUE,
										WA_CloseGadget,TRUE,
										WA_SimpleRefresh,TRUE,
										WA_Title,titel,
										WA_ScreenTitle,"NiKom Prenode",
										WA_AutoAdjust,TRUE,
										WA_PubScreenName,screenname,
										TAG_DONE));
}


void cleanup(int errorCode, char *text) {
  if(errorCode > 0) {
    LogEvent(SYSTEM_LOG, ERROR, "PreNode (%d) is exiting with error code %d: %s",
             nodnr, errorCode, text);
  }

  CloseCatalog(g_Catalog);
  shutdownnode(NODSER);
  CloseIO();
  if(NiKwind) {
    CloseWindow(NiKwind);
  }
  if(LocaleBase) {
    CloseLibrary((struct Library *)LocaleBase);
{'fraction_non_alphanumeric': 0.12511271415689812, 'fraction_numerical': 0.010144274120829576, 'mean_word_length': 3.9966216216216215, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2073069', 'n_tokens_mistral': 2058, 'n_tokens_neox': 1674, 'n_words': 331}