moo_app_write_output(); fixed moo_app_output_write

master
Yevgen Muntyan 2006-05-14 18:43:39 -05:00
parent 482e85d837
commit 09cfe3a8de
4 changed files with 16 additions and 2 deletions

View File

@ -644,6 +644,16 @@ moo_app_get_output_pipe_name (G_GNUC_UNUSED MooApp *app)
} }
void
moo_app_write_output (const char *data,
gssize len)
{
g_return_if_fail (data != NULL);
g_return_if_fail (moo_app_output != NULL);
moo_app_output_write (moo_app_output, data, len);
}
const char* const char*
moo_app_get_rc_file_name (MooApp *app) moo_app_get_rc_file_name (MooApp *app)
{ {

View File

@ -93,6 +93,9 @@ const char *moo_app_get_rc_file_name (MooApp *app);
const char *moo_app_get_input_pipe_name (MooApp *app); const char *moo_app_get_input_pipe_name (MooApp *app);
const char *moo_app_get_output_pipe_name (MooApp *app); const char *moo_app_get_output_pipe_name (MooApp *app);
void moo_app_write_output (const char *data,
gssize len);
MooEditor *moo_app_get_editor (MooApp *app); MooEditor *moo_app_get_editor (MooApp *app);
void moo_app_prefs_dialog (GtkWidget *parent); void moo_app_prefs_dialog (GtkWidget *parent);

View File

@ -39,6 +39,7 @@ typedef enum
#if defined(WANT_MOO_APP_CMD_STRINGS) || defined(WANT_MOO_APP_CMD_CHARS) #if defined(WANT_MOO_APP_CMD_STRINGS) || defined(WANT_MOO_APP_CMD_CHARS)
/* 'g' is taken by ggap */
#define CMD_ZERO "\0" #define CMD_ZERO "\0"
#define CMD_PYTHON_STRING "p" #define CMD_PYTHON_STRING "p"
#define CMD_PYTHON_FILE "P" #define CMD_PYTHON_FILE "P"

View File

@ -203,7 +203,7 @@ moo_app_output_write (MooAppOutput *ch,
/* XXX make a buffer, and so on */ /* XXX make a buffer, and so on */
while (TRUE) while (len)
{ {
gssize result = write (ch->out, data, len); gssize result = write (ch->out, data, len);
@ -225,7 +225,7 @@ moo_app_output_write (MooAppOutput *ch,
return; return;
} }
} }
else if (result < len) else
{ {
data += result; data += result;
len -= result; len -= result;