diff options
Diffstat (limited to 'apps/sympathy.c')
-rw-r--r-- | apps/sympathy.c | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/apps/sympathy.c b/apps/sympathy.c index bb141b1..7c68529 100644 --- a/apps/sympathy.c +++ b/apps/sympathy.c @@ -11,6 +11,9 @@ static char rcsid[] = /* * $Log$ + * Revision 1.38 2008/03/07 13:56:39 james + * *** empty log message *** + * * Revision 1.37 2008/03/07 13:16:02 james * *** empty log message *** * @@ -142,6 +145,7 @@ static char rcsid[] = #include "mainloop.h" extern void usage (void); +extern char * expand(const char *); static char hostname[1024]; char *socket_dirs[] = @@ -409,7 +413,6 @@ list_sockets (void) return 0; } - void get_hostname (void) { @@ -425,6 +428,12 @@ get_hostname (void) strcat (hostname, "."); } +void send_to_server(Socket *c,char *s) +{ +s=expand(s); +//FIXME + +} int main (int argc, char *argv[]) @@ -760,34 +769,37 @@ main (int argc, char *argv[]) } - if (oflags['I']) { - // FIXME ... - - } else { - if (client_socket) - ipc_msg_send_initialize(client_socket); - - if (oflags['c'] || oflags['t']) { - if (oflags['N']) { - ctx->r = rx_new_raw (0, 1); - ansi = ansi_new_raw (0, 1); - } else if (oflags['H']) { - ansi = ansi_new_html (stdout); - } else { - terminal_register_handlers (); - ansi = - ansi_new_from_terminal (terminal_open (0, 1), oflags['u'] ? 0 : 1); - ansi->reset (ansi, NULL); - if (ansi->set_title) - ansi->set_title (ansi, oargs['k']); + if (oflags['I']) { + if (!client_socket) + fatal_moan ("-I requires either -c or -r", oargs['k']); + if (!oargs['I']) + fatal_moan ("-I requires an arugment"); + send_to_server(client_socket,oargs['I']); + } else { + if (client_socket) + ipc_msg_send_initialize (client_socket); + + if (oflags['c'] || oflags['t']) { + if (oflags['N']) { + ctx->r = rx_new_raw (0, 1); + ansi = ansi_new_raw (0, 1); + } else if (oflags['H']) { + ansi = ansi_new_html (stdout); + } else { + terminal_register_handlers (); + ansi = + ansi_new_from_terminal (terminal_open (0, 1), oflags['u'] ? 0 : 1); + ansi->reset (ansi, NULL); + if (ansi->set_title) + ansi->set_title (ansi, oargs['k']); + } } - } - ctx->v = vt102_new (&size); - ctx->h = history_new (history); + ctx->v = vt102_new (&size); + ctx->h = history_new (history); - mainloop (ctx, ansi, server_socket, client_socket); + mainloop (ctx, ansi, server_socket, client_socket); } if (ansi) { |