Skip to content
Permalink
Browse files

milter-manager executable file: remove Ruby dependency

  • Loading branch information...
kou committed May 31, 2016
1 parent 0bb6396 commit d6e8a33fc5ec04dac0934172ad7e0f82b45e6399
@@ -1,6 +1,6 @@
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Copyright (C) 2008 Kouhei Sutou <kou@cozmixng.org>
* Copyright (C) 2008-2016 Kouhei Sutou <kou@cozmixng.org>
*
* 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
@@ -37,6 +37,9 @@

G_BEGIN_DECLS

gpointer *milter_manager_get_stack_address (void);
void milter_manager_set_stack_address (gpointer *stack_address);

void milter_manager_init (int *argc, char ***argv);
void milter_manager_quit (void);
gboolean milter_manager_main (void);
@@ -41,6 +41,8 @@

#include "../manager.h"

static gpointer *stack_address = NULL;

static gboolean initialized = FALSE;
static MilterManager *the_manager = NULL;
static gchar *option_config_dir = NULL;
@@ -74,6 +76,18 @@ static gboolean set_sigusr1_action = TRUE;
} \
} G_STMT_END

gpointer *
milter_manager_get_stack_address (void)
{
return stack_address;
}

void
milter_manager_set_stack_address (gpointer *stack_address_)
{
stack_address = stack_address_;
}

static gboolean
print_version (const gchar *option_name, const gchar *value,
gpointer data, GError **error)
@@ -1,6 +1,6 @@
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Copyright (C) 2008-2011 Kouhei Sutou <kou@clear-code.com>
* Copyright (C) 2008-2016 Kouhei Sutou <kou@clear-code.com>
*
* 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
@@ -340,6 +340,8 @@ init_ruby (void)
static char args[sizeof "milter-manager\0-e;\0"];
char *argv[3], *arg;

ruby_init_stack((VALUE *)milter_manager_get_stack_address());

if (builtin_class && *builtin_class) {
add_load_path();
load_libraries();
@@ -4,12 +4,7 @@ AM_CPPFLAGS = \

AM_CFLAGS = \
-DLOCALEDIR=\""$(localedir)"\" \
$(MILTER_MANAGER_CFLAGS) \
$(RUBY_CFLAGS)

LIBS = \
$(RUBY_LDFLAGS) \
$(RUBY_LIBS)
$(MILTER_MANAGER_CFLAGS)

CLEANFILES = *.gcno *.gcda

@@ -1,6 +1,6 @@
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Copyright (C) 2008 Kouhei Sutou <kou@cozmixng.org>
* Copyright (C) 2008-2016 Kouhei Sutou <kou@cozmixng.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,23 +17,18 @@
*
*/

#include <ruby.h>
#include <milter/manager.h>
#include <stdlib.h>

#ifndef RUBY_INIT_STACK
# define RUBY_INIT_STACK \
VALUE variable_in_this_stack_frame; \
extern void Init_stack (VALUE *address); \
Init_stack(&variable_in_this_stack_frame)
#endif
#include <milter/manager.h>

int
main (int argc, char **argv)
{
gboolean success;

{
RUBY_INIT_STACK;
gpointer stack_address;
milter_manager_set_stack_address(&stack_address);
milter_manager_init(&argc, &argv);
success = milter_manager_main();
milter_manager_quit();

0 comments on commit d6e8a33

Please sign in to comment.
You can’t perform that action at this time.