client.c File Reference

This program is created for implementing the Exam Evaluator project client. More...

#include <gtk/gtk.h>
#include <glib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <time.h>
#include <signal.h>
#include <sqlite3.h>

Go to the source code of this file.

Defines

#define BUFFER   4096

Functions

void onExit (GtkWidget *window, gpointer data)
 This function is called when someone tries to close top level window.
void close_properly (int signal)
 This function is called when user types ctrl+c which will shut down the client completely.
void send_message (GtkWidget *button, gpointer data)
 This function is called when user clicks the next button on the window .
void send_message1 (GtkWidget *button, gpointer data)
 This function is called when user clicks the previous button on the window .
int main (int argc, char *argv[])
 Used to connect to tcp server and print the results on the window.

Variables

GtkWidget * text_view
GtkTextBuffer * buffer
char ** result
char temp [BUFFER]
char msg [10 *BUFFER]
int nrow
int ncol
int rc
int re
sqlite3 * database1
int roll = 0
int num = 0
char * port
char * addr
int sfd

Detailed Description

This program is created for implementing the Exam Evaluator project client.

It will ask u for the cut off marks and create a window which will have three options next,previous and exit.

Author:
Khaja Peer Syed

Definition in file client.c.


Define Documentation

#define BUFFER   4096

Definition at line 21 of file client.c.

Referenced by main(), send_message(), and send_message1().


Function Documentation

void close_properly ( int  signal  ) 

This function is called when user types ctrl+c which will shut down the client completely.

Parameters:
signal is the file descriptor which needs to be closed.

Definition at line 67 of file client.c.

References sfd.

int main ( int  argc,
char *  argv[] 
)

Used to connect to tcp server and print the results on the window.

The use must provide the i.p. address of tcp day tine server and port number through command line argument and then time is printed in human readable format. Note that it will work only for ipv4 servers.

Returns:
zero to calling program on success, else 1.
Parameters:
argc number of command line arguments passed to the program including program name itself.
argv array of command line arguments.

Definition at line 172 of file client.c.

References addr, buffer, BUFFER, database1, msg, ncol, nrow, num, onExit(), port, rc, re, result, send_message(), send_message1(), sfd, temp, and text_view.

void onExit ( GtkWidget *  window,
gpointer  data 
)

This function is called when someone tries to close top level window.

Parameters:
widget1 Widget that generated the event
data Additional data passed by widget while generating the signal

Definition at line 54 of file client.c.

Referenced by main().

void send_message ( GtkWidget *  button,
gpointer  data 
)

This function is called when user clicks the next button on the window .

All arguments are passed to gtk for processing, which removes any arguments relevant to it. All other arguments are ignored.

Definition at line 91 of file client.c.

References buffer, BUFFER, msg, num, re, result, roll, sfd, and text_view.

Referenced by main().

void send_message1 ( GtkWidget *  button,
gpointer  data 
)

This function is called when user clicks the previous button on the window .

All arguments are passed to gtk for processing, which removes any arguments relevant to it. All other arguments are ignored.

Definition at line 127 of file client.c.

References buffer, BUFFER, msg, re, result, roll, sfd, and text_view.

Referenced by main().


Variable Documentation

char * addr

Definition at line 45 of file client.c.

Referenced by main().

GtkTextBuffer* buffer

Definition at line 26 of file client.c.

Referenced by main(), send_message(), and send_message1().

sqlite3* database1

Definition at line 39 of file client.c.

Referenced by main().

char msg[10 *BUFFER]

Definition at line 33 of file client.c.

Referenced by main(), send_message(), and send_message1().

int ncol

Definition at line 36 of file client.c.

Referenced by main().

int nrow

Definition at line 36 of file client.c.

Referenced by main().

int num = 0

Definition at line 42 of file client.c.

Referenced by main(), and send_message().

char* port

Definition at line 45 of file client.c.

Referenced by main().

int rc

Definition at line 36 of file client.c.

Referenced by main().

int re

Definition at line 36 of file client.c.

Referenced by main(), send_message(), and send_message1().

char** result

Definition at line 27 of file client.c.

Referenced by main(), send_message(), and send_message1().

int roll = 0

Definition at line 42 of file client.c.

Referenced by send_message(), and send_message1().

int sfd

Definition at line 60 of file client.c.

Referenced by close_properly(), main(), send_message(), and send_message1().

char temp[BUFFER]

Definition at line 30 of file client.c.

Referenced by main().

GtkWidget* text_view

Definition at line 25 of file client.c.

Referenced by main(), send_message(), and send_message1().

Generated on Wed Apr 7 23:41:26 2010 for Course_Project by  doxygen 1.6.3