Defines | Functions | Variables

client_msg.c File Reference

#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <netdb.h>
#include <pthread.h>
#include "../sft.h"

Go to the source code of this file.

Defines

#define _GNU_SOURCE
 gcc -lpthread -o client client_msg.c
#define MSG_CLI   150
#define FONT   "database.sft"

Functions

struct hostent * gethostbyname ()
int gravar_mensagem (void)
int ler_mensagens (void)
void * menu ()
void * gerencia (void)
int monta_pkt (char *aux)
 Monta o pacote para envio de pacote.
int send_pkt_msg (struct sft_hdr *sft)
int envia_mensagem ()
int cria_database (void)
 Cria um banco de dados para o cliente.
int gera_menu (void)
int main (int argc, char *argv[])
 Funcao principal do Cliente de mensagem.

Variables

pthread_t tid1
pthread_t tid2
struct sockaddr_in server
struct hostent * hp
char msg [TAMMSG]
FILE * dtSft
int id_msg = 0
int flag = 0
int tchau
int id_send

Define Documentation

#define _GNU_SOURCE

Definition at line 6 of file client_msg.c.

#define FONT   "database.sft"

Definition at line 32 of file client_msg.c.

#define MSG_CLI   150

Definition at line 31 of file client_msg.c.


Function Documentation

int cria_database ( void   ) 

Definition at line 54 of file client_msg.c.

int envia_mensagem (  ) 
int gera_menu ( void   ) 

Definition at line 67 of file client_msg.c.

void * gerencia ( void   ) 

Definition at line 399 of file client_msg.c.

Here is the call graph for this function:

struct hostent * gethostbyname (  ) 
int gravar_mensagem ( void   ) 

Definition at line 240 of file client_msg.c.

Here is the call graph for this function:

int ler_mensagens ( void   ) 

Definition at line 278 of file client_msg.c.

void * menu (  ) 

Definition at line 82 of file client_msg.c.

Here is the call graph for this function:

int monta_pkt ( char *  aux  ) 
Parameters:
aux Mensagem a ser enviada.

Definition at line 315 of file client_msg.c.

Here is the call graph for this function:

int send_pkt_msg ( struct sft_hdr sft  ) 

Definition at line 360 of file client_msg.c.

Here is the call graph for this function:


Variable Documentation

FILE* dtSft

Definition at line 35 of file client_msg.c.

int flag = 0

Definition at line 39 of file client_msg.c.

struct hostent* hp

Definition at line 27 of file client_msg.c.

int id_msg = 0

Definition at line 38 of file client_msg.c.

int id_send

Definition at line 39 of file client_msg.c.

char msg[TAMMSG]

Definition at line 30 of file client_msg.c.

struct sockaddr_in server

Definition at line 26 of file client_msg.c.

int tchau

Definition at line 39 of file client_msg.c.

pthread_t tid1

Definition at line 22 of file client_msg.c.

pthread_t tid2

Definition at line 22 of file client_msg.c.