File: sendmsg.c

package info (click to toggle)
gbatnav 1.0.4cvs20051004-8
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 4,780 kB
  • sloc: ansic: 14,122; sh: 11,667; makefile: 643; yacc: 288; xml: 42; sed: 16
file content (31 lines) | stat: -rw-r--r-- 659 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*	$Id: sendmsg.c,v 1.3 2001/04/06 15:15:22 riq Exp $	*/
#include <gtk/gtk.h>
#include <glib/gi18n.h>

#include "cliente.h"
#include "pantalla.h"
#include "gbnclient.h"
#include "bnwrite.h"
#include "net.h"

void inputline_return(GtkWidget *w, gpointer data)
{
	char *theinput;

	if( usuario.play==DISCON ) {
		gtk_entry_set_text(GTK_ENTRY(w), "");
		textfill(0,_("You need to be connected"));
		return;
	}

	theinput = gtk_entry_get_text(GTK_ENTRY(w));

	if(*theinput) {
		if(theinput[0]=='/') {
			net_printf( usuario.sock, "%s\n",&theinput[1]);
		} else  {
			bnwrite(usuario.sock,BN_MESSAGE"=%s",theinput);
		}
	}
	gtk_entry_set_text(GTK_ENTRY(w), "");
}