<commit_before>/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/


#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif
//windows.h for win machines
#if defined(_WIN32) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#include <gtk/gtk.h>
#include <gtk/gtkgl.h>
#include <glade/glade.h>
#include "gui.h"
#include "viewport.h"
#include "menucallbacks.h"
#include "gltemplate.h"
#include "memory.h"
#ifdef ENABLE_NLS
#include "libintl.h"
#endif

#ifdef G_OS_WIN32
gchar *package_prefix;
gchar *package_data_dir;
#endif
gchar *package_locale_dir;
static char* smyrnaDir;
char* smyrnaGlade;

char*
smyrnaPath (char* suffix)
{
    char* buf;
    if (!smyrnaDir) return NULL;
    buf = N_NEW(strlen(smyrnaDir)+strlen(suffix)+2,char);
    sprintf (buf, "%s/%s", smyrnaDir, suffix);
    return buf;
}

int main(int argc, char *argv[])
{
    GdkGLConfig *glconfig;
    char* smyrnaDir;

	load_attributes();

    smyrnaDir = getenv ("SMYRNA_PATH");

#ifdef G_OS_WIN32
    package_prefix =
	g_win32_get_package_installation_directory(NULL, NULL);
    package_data_dir = g_build_filename(package_prefix, "share", NULL);
    package_locale_dir =
	g_build_filename(package_prefix, "share", "locale", NULL);
#else
    if (smyrnaDir)
	package_locale_dir = g_build_filename(smyrnaDir, "locale", NULL);
    else
	package_locale_dir = g_build_filename(SMYRNA_PATH, "locale", NULL);
#endif	/* # */
#ifdef ENABLE_NLS
    bindtextdomain(GETTEXT_PACKAGE, package_locale_dir);
    bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
    textdomain(GETTEXT_PACKAGE);
#endif
    view = malloc(sizeof(ViewInfo));
    init_viewport(view);




	gtk_set_locale();
    gtk_init(&argc, &argv);<commit_msg>In Unix, always set smyrnaDir Make sure load_attributes happens after smyrnaDir is set, as that function will look for data files Convert malloc into NEW<commit_after>/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/


#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif
//windows.h for win machines
#if defined(_WIN32) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#include <gtk/gtk.h>
#include <gtk/gtkgl.h>
#include <glade/glade.h>
#include "gui.h"
#include "viewport.h"
#include "menucallbacks.h"
#include "gltemplate.h"
#include "memory.h"
#ifdef ENABLE_NLS
#include "libintl.h"
#endif

#ifdef G_OS_WIN32
gchar *package_prefix;
gchar *package_data_dir;
#endif
gchar *package_locale_dir;
static char* smyrnaDir;
char* smyrnaGlade;

char*
smyrnaPath (char* suffix)
{
    char* buf;
    if (!smyrnaDir) return NULL;
    buf = N_NEW(strlen(smyrnaDir)+strlen(suffix)+2,char);
    sprintf (buf, "%s/%s", smyrnaDir, suffix);
    return buf;
}

int main(int argc, char *argv[])
{
    GdkGLConfig *glconfig;

    smyrnaDir = getenv ("SMYRNA_PATH");
#ifndef _WIN32
    if (!smyrnaDir)
	smyrnaDir = SMYRNA_PATH;
#endif

    load_attributes();

#ifdef G_OS_WIN32
    package_prefix =
	g_win32_get_package_installation_directory(NULL, NULL);
    package_data_dir = g_build_filename(package_prefix, "share", NULL);
    package_locale_dir =
	g_build_filename(package_prefix, "share", "locale", NULL);
#else
    if (smyrnaDir)
	package_locale_dir = g_build_filename(smyrnaDir, "locale", NULL);
    else
	package_locale_dir = g_build_filename(SMYRNA_PATH, "locale", NULL);
#endif	/* # */
#ifdef ENABLE_NLS
    bindtextdomain(GETTEXT_PACKAGE, package_locale_dir);
    bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
    textdomain(GETTEXT_PACKAGE);
#endif
    view = NEW(ViewInfo);
    init_viewport(view);

    gtk_set_locale();
    gtk_init(&argc, &argv);
{'fraction_non_alphanumeric': 0.15551142005958293, 'fraction_numerical': 0.010327706057596822, 'mean_word_length': 2.7893152746425884, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4579264', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1632, 'n_words': 366}