<commit_before>#include "slate.h"

// For platform information:
#ifndef WIN32
#include <sys/utsname.h>
#else
typedef struct utsname {
  char sysname[256];
  char nodename[256];
  char release[256];
  char version[256];
  char machine[256];
};

int uname(struct utsname *un) {
  DWORD dwVersion = 0;
  DWORD dwMajorVersion = 0;
  DWORD dwMinorVersion = 0;
  DWORD dwBuild = 0;
#ifdef WIN32
#ifdef WIN64
  strcpy(un->sysname,"Win64");
#else
  strcpy(un->sysname,"Win32");
#endif
#endif
  dwVersion = GetVersion();
  if (dwVersion < 0x80000000) dwBuild = (DWORD)(HIWORD(dwVersion)); else dwBuild=0;
  sprintf(un->release, "%d", dwBuild);
  sprintf(un->version, "%d %d", (DWORD)(LOBYTE(LOWORD(dwVersion))), (DWORD)(HIBYTE(LOWORD(dwVersion))));
#ifdef WIN32
#ifdef WIN64
  strcpy(un->machine,"x64");
#else
  strcpy(un->machine,"x86");
#endif
#endif
  if(gethostname(un->nodename, 256)!=0) strcpy(un->nodename, "localhost");
  return 0;
};
#endif
struct utsname info;

#ifdef WIN32
int getpid() {
  return GetProcessId();
}
#endif

//Template for defining Slate primitive signatures. Not a macro because IDEs don't process it:
//#define SLATE_PRIM(prim_name) void prim_name(struct object_heap* oh, struct Object* args[], word_t arity, struct OopArray* opts, word_t resultStackPointer)

#ifdef SLATE_DAEMONIZE
#include <pwd.h>
#include <sys/stat.h><commit_msg>Fixed a transcription mistake with getpid() for WIN32.<commit_after>#include "slate.h"

// For platform information:
#ifndef WIN32
#include <sys/utsname.h>
#else
typedef struct utsname {
  char sysname[256];
  char nodename[256];
  char release[256];
  char version[256];
  char machine[256];
};

int uname(struct utsname *un) {
  DWORD dwVersion = 0;
  DWORD dwMajorVersion = 0;
  DWORD dwMinorVersion = 0;
  DWORD dwBuild = 0;
#ifdef WIN32
#ifdef WIN64
  strcpy(un->sysname,"Win64");
#else
  strcpy(un->sysname,"Win32");
#endif
#endif
  dwVersion = GetVersion();
  if (dwVersion < 0x80000000) dwBuild = (DWORD)(HIWORD(dwVersion)); else dwBuild=0;
  sprintf(un->release, "%d", dwBuild);
  sprintf(un->version, "%d %d", (DWORD)(LOBYTE(LOWORD(dwVersion))), (DWORD)(HIBYTE(LOWORD(dwVersion))));
#ifdef WIN32
#ifdef WIN64
  strcpy(un->machine,"x64");
#else
  strcpy(un->machine,"x86");
#endif
#endif
  if(gethostname(un->nodename, 256)!=0) strcpy(un->nodename, "localhost");
  return 0;
};
#endif
struct utsname info;

#ifdef WIN32
int getpid() {
  return GetCurrentProcessId();
}
#endif

//Template for defining Slate primitive signatures. Not a macro because IDEs don't process it:
//#define SLATE_PRIM(prim_name) void prim_name(struct object_heap* oh, struct Object* args[], word_t arity, struct OopArray* opts, word_t resultStackPointer)

#ifdef SLATE_DAEMONIZE
#include <pwd.h>
#include <sys/stat.h>
{'fraction_non_alphanumeric': 0.15068990559186637, 'fraction_numerical': 0.03994190268700073, 'mean_word_length': 5.5439429928741095, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '5283137', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1014, 'n_words': 260}