#include <gtk/gtk.h>#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <sys/socket.h>#include <sys/types.h>#include <arpa/inet.h>#include <netinet/in.h>Go to the source code of this file.
Defines | |
| #define | LISTEN_PORT 9999 |
| compile with the following command gcc -Wall -g hello.c -o hello `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` | |
| #define | BUFFER_SIZE 4096*1000 |
| #define | WAIT_TIME 10 |
Functions | |
| int | login_window () |
| this is first window login form | |
| int | welcome () |
| Perform when click the new user button then a new window will opened. | |
| int | useracc () |
| login with user name and password.function for the user window | |
| char * | connect_server (char *output_data, char *ip) |
| connect the server | |
| gboolean | delete1 (GtkWidget *widget, GdkEvent *event, gpointer user_data) |
| Delete Event processing, returning FALSE allows the window to be destroyed, TRUE would stop further processing and window remains. | |
| void | destroy1 (GtkObject *object, gpointer user_data) |
| Exit the Gtk Main Loop. | |
| gboolean | update1 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of username. | |
| gboolean | update2 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of password. | |
| gboolean | fun1 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of user fullname. | |
| gboolean | fun2 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of email-id. | |
| gboolean | fun3 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of login-id. | |
| gboolean | fun4 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of password. | |
| gboolean | fun5 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of organization. | |
| gboolean | funs4 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of delete a file. | |
| gboolean | funs1 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of search Query. | |
| gboolean | funs2 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of filename to upload. | |
| gboolean | funs3 (GtkWidget *entry1, GdkEventKey *event, gpointer label1) |
| Perform the update of the label of download a file. | |
| void | submit1 (GtkWidget *widget, gpointer window) |
| Perform when click the submit button. | |
| void | clos1 (GtkWidget *widget, gpointer data) |
| Perform when click the close button. | |
| void | submit (GtkWidget *widget, gpointer window) |
| Perform when click the submit button. | |
| void | clos (GtkWidget *widget, gpointer data) |
| Perform when click the close button. | |
| void | newuser (GtkWidget *widget, gpointer data) |
| Perform when click the newuser button. | |
| void | search (GtkWidget *widget, gpointer window) |
| Perform when click the search button. | |
| void | delete_file (GtkWidget *widget, gpointer window) |
| Perform when click the delete file button. | |
| void | upload (GtkWidget *widget, gpointer window) |
| Perform when click the upload button. | |
| void | logout (GtkWidget *widget, gpointer window) |
| Perform when click the logout button. | |
| void | delete (GtkWidget *widget, gpointer window) |
| Perform when click the delete account button.this function is for deleting the user account. | |
| void | find (GtkWidget *widget, gpointer window) |
| Perform when click the download button. | |
| int | search_window () |
| Perform when click the search button then a new window will opened. | |
| int | main (int argc, char *argv[]) |
| main function | |
Variables | |
| char | uname [100] |
| char | pwd [100] |
| char | name [100] |
| char | pass [100] |
| char | login [100] |
| char | orga [100] |
| char | email [100] |
| char | srch [100] |
| char | uplod [100] |
| char | file [1000] |
| char | dfile [1000] |
| char | fnd [1000] |
| char | ip [100] |
| char | new [1000] |
| char | msg0 [1000] |
| char | msg1 [1000] |
| char | msg2 [1000] |
| char | msg3 [1000] |
| char | msg4 [BUFFER_SIZE] |
| char | msg5 [1000] |
| char | msg7 [100] |
| GtkWidget * | window1 |
| GtkWidget * | window2 |
| GtkWidget * | windowL |
| GtkWidget * | window3 |
| char | input_data [BUFFER_SIZE] |
| int | socket_file_descriptor |
| #define BUFFER_SIZE 4096*1000 |
| #define LISTEN_PORT 9999 |
compile with the following command gcc -Wall -g hello.c -o hello `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0`
Definition at line 19 of file client.c.
Referenced by connect_server(), and main().
| void clos | ( | GtkWidget * | widget, | |
| gpointer | data | |||
| ) |
Perform when click the close button.
| widget | ||
| data |
Definition at line 478 of file client.c.
Referenced by login_window().
| void clos1 | ( | GtkWidget * | widget, | |
| gpointer | data | |||
| ) |
| char* connect_server | ( | char * | output_data, | |
| char * | ip | |||
| ) |
connect the server
| output_data | ||
| ip |
Definition at line 53 of file client.c.
References BUFFER_SIZE, input_data, LISTEN_PORT, and socket_file_descriptor.
Referenced by delete(), delete_file(), find(), logout(), search(), submit(), submit1(), and upload().
| void delete | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
Perform when click the delete account button.this function is for deleting the user account.
| widget | ||
| window |
Definition at line 681 of file client.c.
References connect_server(), ip, and result.
| gboolean delete1 | ( | GtkWidget * | widget, | |
| GdkEvent * | event, | |||
| gpointer | user_data | |||
| ) |
Delete Event processing, returning FALSE allows the window to be destroyed, TRUE would stop further processing and window remains.
| widget | ||
| event | ||
| usre_data |
Definition at line 98 of file client.c.
Referenced by login_window(), and welcome().
| void delete_file | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
| void destroy1 | ( | GtkObject * | object, | |
| gpointer | user_data | |||
| ) |
Exit the Gtk Main Loop.
| object | ||
| usre_data |
Definition at line 107 of file client.c.
Referenced by login_window().
| void find | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
Perform when click the download button.
| widget | ||
| window |
Definition at line 700 of file client.c.
References connect_server(), fnd, ip, msg5, and result.
Referenced by search_window().
| gboolean fun1 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| gboolean fun2 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| gboolean fun3 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| gboolean fun4 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| gboolean fun5 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| gboolean funs1 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| gboolean funs2 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| gboolean funs3 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
Perform the update of the label of download a file.
| entry1 | ||
| event | ||
| label1 |
Definition at line 321 of file client.c.
References fnd.
Referenced by search_window().
| gboolean funs4 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
| int login_window | ( | ) |
| void logout | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
Perform when click the logout button.
| widget | ||
| window |
Definition at line 660 of file client.c.
References connect_server(), ip, result, and socket_file_descriptor.
Referenced by useracc().
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
main function
| argc | No. of command line arguements | |
| argv | contains all the arguemtns in the command line |
Definition at line 1034 of file client.c.
References ip, and login_window().
| void newuser | ( | GtkWidget * | widget, | |
| gpointer | data | |||
| ) |
Perform when click the newuser button.
| widget | ||
| data |
Definition at line 487 of file client.c.
References welcome().
Referenced by login_window().
| void search | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
Perform when click the search button.
| widget | ||
| window |
Definition at line 495 of file client.c.
References connect_server(), ip, msg2, result, search_window(), and srch.
Referenced by useracc().
| int search_window | ( | ) |
| void submit | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
| void submit1 | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
| gboolean update1 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
Perform the update of the label of username.
| entry1 | ||
| event | ||
| label1 |
Definition at line 118 of file client.c.
References uname.
Referenced by login_window().
| gboolean update2 | ( | GtkWidget * | entry1, | |
| GdkEventKey * | event, | |||
| gpointer | label1 | |||
| ) |
Perform the update of the label of password.
| entry1 | ||
| event | ||
| label1 |
Definition at line 140 of file client.c.
References pwd.
Referenced by login_window().
| void upload | ( | GtkWidget * | widget, | |
| gpointer | window | |||
| ) |
| int useracc | ( | ) |
| int welcome | ( | ) |
| char dfile[1000] |
| char input_data[BUFFER_SIZE] |
| char ip[100] |
| char msg7[100] |
| GtkWidget* window1 |
| GtkWidget* window3 |
| GtkWidget* windowL |
1.5.8