File: sendmsg.c

package info (click to toggle)
gbatnav 1.0.4cvs20051004-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,760 kB
  • ctags: 1,737
  • sloc: ansic: 13,879; sh: 11,667; makefile: 674; yacc: 288; sed: 16
file content (29 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (10)
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
/*	$Id: sendmsg.c,v 1.3 2001/04/06 15:15:22 riq Exp $	*/
#include <gnome.h>

#include "cliente.h"
#include "pantalla.h"
#include "gbnclient.h"
#include "bnwrite.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), "");
}