summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-04-08 20:23:37 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-04-08 20:23:37 +0000
commitea2d77a00733e7bd16766a825e2d38ba0b2f6ecc (patch)
treef0de9e7651ce4bf32ebfc62627cff81185b93837
parent55ace62d617644c40da6fbcb93c5b5f830f55086 (diff)
downloadmdk-ea2d77a00733e7bd16766a825e2d38ba0b2f6ecc.tar.gz
mdk-ea2d77a00733e7bd16766a825e2d38ba0b2f6ecc.tar.bz2
compilation on FreeBSD fixed
-rw-r--r--NEWS10
-rw-r--r--THANKS5
-rw-r--r--mixgtk/mixgtk_cmd_dispatcher.c57
3 files changed, 46 insertions, 26 deletions
diff --git a/NEWS b/NEWS
index 41381d5..0a9ce94 100644
--- a/NEWS
+++ b/NEWS
@@ -7,16 +7,20 @@ Please send mdk bug reports to bug-mdk@gnu.org.
*Version 0.3.1
+** New binary and html RPMs (RedHat) contributed by Agustin Navarro
+ <anp@cantv.net>.
+
+** The package can be correctly build in FreeBSD 4.2 (Ying-Chieh Liao)
+
** Fixed configuration process when included gettext is used.
** The info files are now properly categorized in a dir entry, so that
they can be properly installed.
-** New binary and html RPMs (RedHat) contributed by Agustin Navarro
- <anp@cantv.net>.
-
** Compilation warnings fixed.
+** getopt implementation provided for systems missing it.
+
*Version 0.3 (28/03/01)
** MDK is now an official GNU package.
diff --git a/THANKS b/THANKS
index 04ebc4e..8b114e6 100644
--- a/THANKS
+++ b/THANKS
@@ -13,10 +13,13 @@ a list of these people. Help me keep it complete and exempt of errors.
pinpointing bugs in the first MDK release, and useful discussions as well.
* Agustin Navarro <anp@cantv.net> kindly tested the installation on
- Mandrake and discovered a bug in the configuration process.
+ Mandrake and RedHat and helped debugging the package configuration.
* Vasilij Ozmetelenko <vasimba@mail.ru> kindly pointed out a bug in JRED.
+* Ying-Chieh Liao <ijliao@csie.nctu.edu.tw> kindly tested MDK on a
+ FreeBSD system, and developed a port for it.
+
* MDK was inspired by Darius Bacon's MIXAL program <djello@well.sf.ca.us>
which can be installed in Debian 2.3 as the package "mixal".
diff --git a/mixgtk/mixgtk_cmd_dispatcher.c b/mixgtk/mixgtk_cmd_dispatcher.c
index 180c480..d53e991 100644
--- a/mixgtk/mixgtk_cmd_dispatcher.c
+++ b/mixgtk/mixgtk_cmd_dispatcher.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_cmd_dispatcher.c :
* Implementation of the functions declared in mixgtk_cmd_dispatcher.h
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/04/01 15:22:09 jose"
+ * Last change: Time-stamp: "2001-04-08 01:34:09 jao"
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -21,11 +21,12 @@
*
*/
-#define _GNU_SOURCE 1
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
#include <mixlib/mix_vm_command.h>
#include "mixgtk_cmd_dispatcher.h"
@@ -36,15 +37,14 @@
/* a mix vm command dispatcher */
struct mixgtk_dispatch_
{
- mix_vm_cmd_dispatcher_t *dispatcher;
- FILE *out;
- char *out_buffer;
- size_t out_buffer_size;
- GtkWidget *prompt;
- GtkWidget *log;
- GtkWidget *status;
- guint context;
- GCompletion *completions;
+ mix_vm_cmd_dispatcher_t *dispatcher; /* the underlying cmd dispatcher */
+ FILE *out; /* the dispatcher's output file */
+ int fildes[2]; /* pipe for communication with the dispatcher */
+ GtkWidget *prompt; /* the command prompt widget */
+ GtkWidget *log; /* the dispatcher's messages echo area */
+ GtkWidget *status; /* the status bar widget */
+ guint context; /* context of the status bar messages */
+ GCompletion *completions; /* mixvm command completions */
};
static struct mixgtk_dispatch_ dis_data_ = {NULL};
@@ -91,13 +91,19 @@ static void
global_post_hook_ (mix_vm_cmd_dispatcher_t *dis,
mix_vm_command_t cmd, const gchar *arg, gpointer data)
{
+ enum {BLKSIZE = 100};
+ static gchar BUFFER[BLKSIZE];
+
+ ssize_t k;
fflush (dis_data_.out);
- if (cmd < MIX_CMD_INVALID)
+ while ((k = read (dis_data_.fildes[0], BUFFER, BLKSIZE)) != 0)
{
- gtk_text_insert (GTK_TEXT (dis_data_.log), NULL, NULL, NULL,
- dis_data_.out_buffer, dis_data_.out_buffer_size);
+ if (k == -1 && errno != EINTR) break;
+ if (cmd < MIX_CMD_INVALID)
+ gtk_text_insert (GTK_TEXT (dis_data_.log), NULL, NULL, NULL,
+ BUFFER, k);
}
- rewind (dis_data_.out);
+
mixgtk_mixvm_update_vm_widgets ();
}
@@ -112,7 +118,8 @@ load_post_hook_ (mix_vm_cmd_dispatcher_t *dis, const gchar *arg,
gchar *file = g_strdup (arg);
mixgtk_mixal_load_file ();
mixgtk_mixal_update ();
-
+ mixgtk_mixal_update_bp_all ();
+
if (id != -1)
gtk_statusbar_remove (GTK_STATUSBAR (dis_data_.status),
dis_data_.context, (guint)id);
@@ -206,11 +213,17 @@ mixgtk_cmd_dispatcher_init (void)
if (!dis_data_.dispatcher)
{
- FILE *out = open_memstream (&(dis_data_.out_buffer),
- &(dis_data_.out_buffer_size));
- g_return_val_if_fail (out != NULL, FALSE);
- dis_data_.out = out;
- dis_data_.dispatcher = mix_vm_cmd_dispatcher_new (out, out);
+ int r = pipe (dis_data_.fildes);
+ g_return_val_if_fail (r == 0, FALSE);
+ dis_data_.out = fdopen (dis_data_.fildes[1], "w");
+ g_return_val_if_fail (dis_data_.out != NULL, FALSE);
+ r = fcntl (dis_data_.fildes[0], F_GETFL, 0);
+ g_return_val_if_fail (r != -1, FALSE);
+ r |= O_NONBLOCK;
+ r = fcntl(dis_data_.fildes[0], F_SETFL, r);
+ g_return_val_if_fail (r != -1, FALSE);
+ dis_data_.dispatcher =
+ mix_vm_cmd_dispatcher_new (dis_data_.out, dis_data_.out);
mix_vm_cmd_dispatcher_print_time (dis_data_.dispatcher, FALSE);
install_hooks_ ();
}