Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Net.c File Reference

#include <stdlib.h>
#include <string.h>
#include <zlib.h>
#include "Gadget.h"
#include "debug.h"
#include "Memory.h"
#include "Net.h"
#include "NetCommon.h"
#include "Window.h"
#include "Module.h"
#include "Common.h"

Include dependency graph for Net.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  net_File
struct  net_FileCache
struct  net_Files

Defines

#define MAX_INIT_LEN   256

Functions

u32 net_GetServerId (void)
void net_SerSendApp (u32 conn)
int net_Server (u32 conn)
char * net_CheckClient (u32 conn, int *byteorder)
int net_ServerWindowEventHandler (gui_App_t *app, Window_t *win, u32 gadget_id, int event, u32 event_data)
int net_SerCreateCheckList (tag *taglist, u8 *msg)
void net_SerDeleteCheckList (tag *taglist)
int net_SerProcessMessage (u32 conn, u32 userdata, struct glw_SockMsg *msg)
net_FileCachenet_FindFileCache (u32 conn, char *name)
void net_InsertFileCache (u32 conn, char *name, u8 *data, int size)
u32 net_FilelistGetNext (u32 firsttag,...)
u32 net_FilelistGetNextTL (tag *taglist)
u32 net_FilelistFree (u32 firsttag,...)
u32 net_FilelistFreeTL (tag *taglist)
u32 net_FilelistLoad (u32 firsttag,...)
u32 net_FilelistLoadTL (tag *taglist)
u32 net_LoadFile (u32 firsttag,...)
u32 net_LoadFileTL (tag *taglist)
int net_Init (void)
void net_CleanUp (void)
u32 net_Call (int function, u32 firsttag,...)
u32 net_CallTL (int function, tag *taglist)

Variables

u32(* call_vector [NET_FUNC_DONE-NET_FUNCBASE+1])(tag *)


Define Documentation

#define MAX_INIT_LEN   256
 

Definition at line 147 of file Net.c.

Referenced by net_CheckClient.


Function Documentation

u32 net_Call int    function,
u32    firsttag,
...   
 

Definition at line 851 of file Net.c.

References net_CallTL.

Referenced by net_Init.

u32 net_CallTL int    function,
tag   taglist
 

Definition at line 855 of file Net.c.

References call_vector, debug_Begin, debug_End, debug_Message, debug_Warning, NET_FUNC_DONE, and NET_FUNCBASE.

Referenced by net_Init.

char* net_CheckClient u32    conn,
int *    byteorder
 

Definition at line 149 of file Net.c.

References ARCH, common_strdup, debug_Begin, debug_End, debug_Warning, glw_Recv, glw_Send, MAX_INIT_LEN, NULL, and u32.

void net_CleanUp void   
 

Definition at line 842 of file Net.c.

References debug_Begin, and debug_End.

Referenced by gui_CleanUp.

u32 net_FilelistFree u32    firsttag,
...   
 

Parameters:
TAG_NET_CONN  u32
TAG_NET_FILELIST  struct net_Files *

Definition at line 621 of file Net.c.

References net_FilelistFreeTL.

u32 net_FilelistFreeTL tag   taglist
 

Definition at line 625 of file Net.c.

References net_Files::data, debug_Begin, debug_End, mem_free, NULL, tag_GetTagData, and TAG_NET_CONN.

Referenced by net_Init.

u32 net_FilelistGetNext u32    firsttag,
...   
 

Parameters:
TAG_NET_CONN  u32
TAG_NET_FILELIST  struct net_Files *
TAG_NET_LEN  int *

Definition at line 556 of file Net.c.

References net_FilelistGetNextTL.

u32 net_FilelistGetNextTL tag   taglist
 

Definition at line 560 of file Net.c.

References net_File::data, debug_Begin, debug_End, debug_Error, net_Files::file_count, FT_DEFLATED, mem_free, mem_malloc, net_MarshalGetBinary, net_MarshalGetLong, net_Files::next_data, NULL, net_Files::readed, net_File::realsize, net_File::size, tag_GetTagData, TAG_NET_CONN, TAG_NET_LEN, net_File::type, and u8.

Referenced by net_Init.

u32 net_FilelistLoad u32    firsttag,
...   
 

Parameters:
TAG_NET_CONN  u32
TAG_NET_NAMES  char **

Definition at line 665 of file Net.c.

References net_FilelistLoadTL.

u32 net_FilelistLoadTL tag   taglist
 

Definition at line 669 of file Net.c.

References net_File::data, net_Files::data, net_Files::data_size, debug_Begin, debug_End, net_Files::file_count, FL_REPLY, glw_MainLoop, glw_SendMsg, mem_free, mem_malloc, net_GetServerId, net_MarshalPutLong, net_MarshalPutString, net_SetState, net_StrMsgLen, net_Files::next_data, NULL, net_Files::readed, REQ_SLOADFILES, net_File::size, tag_GetTagData, TAG_NET_CONN, TAG_NET_NAMES, and u8.

Referenced by net_Init.

struct net_FileCache* net_FindFileCache u32    conn,
char *    name
 

Definition at line 482 of file Net.c.

References debug_Begin, debug_End, glw_ConnUser::file_cache, list_GetNodeHead, list_GetNodeNext, list_InsertNodeHead, list_RemoveNode, net_FileCache::name, and NULL.

Referenced by net_LoadFileTL.

u32 net_GetServerId void    [static]
 

Definition at line 74 of file Net.c.

References debug_Begin, debug_End, and u32.

Referenced by net_FilelistLoadTL, net_LoadFileTL, net_SerSendApp, and net_ServerWindowEventHandler.

int net_Init void   
 

Definition at line 819 of file Net.c.

References call_vector, debug_Begin, debug_End, net_Call, net_CallTL, NET_FILELISTFREE, net_FilelistFreeTL, NET_FILELISTGETNEXT, net_FilelistGetNextTL, NET_FILELISTLOAD, net_FilelistLoadTL, NET_FUNCBASE, NET_LOADFILE, and net_LoadFileTL.

Referenced by gui_Init.

void net_InsertFileCache u32    conn,
char *    name,
u8   data,
int    size
 

Definition at line 512 of file Net.c.

References net_FileCache::data, debug_Begin, debug_End, glw_ConnUser::file_cache, list_CreateNode, list_InsertNodeHead, list_SetNodeData, mem_malloc, net_FileCache::name, NULL, net_FileCache::size, and u8.

Referenced by net_LoadFileTL.

u32 net_LoadFile u32    firsttag,
...   
 

Parameters:
TAG_NET_CONN  u32
TAG_NET_NAME  char *
TAG_NET_LEN  int *

Definition at line 725 of file Net.c.

References net_LoadFileTL.

u32 net_LoadFileTL tag   taglist
 

Definition at line 729 of file Net.c.

References net_File::data, net_FileCache::data, debug_Begin, debug_End, debug_Error, debug_Message, FL_REPLY, FT_DEFLATED, glw_MainLoop, glw_SendMsg, mem_free, mem_malloc, net_FindFileCache, net_GetServerId, net_GetWaitfor, net_InsertFileCache, net_MarshalPutString, net_SetState, net_StrMsgLen, NULL, net_File::realsize, REQ_NONE, REQ_SLOADFILE, net_File::size, net_FileCache::size, tag_GetTagData, TAG_NET_CONN, TAG_NET_LEN, TAG_NET_NAME, net_File::type, and u8.

Referenced by net_Init.

int net_SerCreateCheckList tag   taglist,
u8   msg
 

Definition at line 212 of file Net.c.

References tag::Data, debug_Begin, debug_End, GADGET_ILLEGAL_ID, mem_malloc, net_MarshalGetLong, net_MarshalGetString, NULL, tag_FindTag, TAG_WIN_CHECKLIST, and u8.

Referenced by net_SerProcessMessage.

void net_SerDeleteCheckList tag   taglist
 

Definition at line 248 of file Net.c.

References gadget_Check_t::class_name, tag::Data, debug_Begin, debug_End, gadget_Check_t::gadget_id, GADGET_ILLEGAL_ID, mem_free, NULL, tag_FindTag, and TAG_WIN_CHECKLIST.

Referenced by net_SerProcessMessage.

int net_SerProcessMessage u32    conn,
u32    userdata,
struct glw_SockMsg   msg
 

Definition at line 270 of file Net.c.

References glw_SockMsg::body, CBK_WINDOW_OPENED, net_File::data, debug_Begin, debug_End, debug_Error, debug_Message, FL_REPLY, gadget_MethodCall, gadget_SearchInWindow, gadget_SetDiscardMask, glw_htonl, glw_SendMsg, glw_SockMsg::id, mem_free, mem_malloc, net_MarshalFreeTaglist, net_MarshalGetBinary, net_MarshalGetLong, net_MarshalGetString, net_MarshalGetTaglist, net_MarshalPutLong, net_MsgFromWaitList, net_MsgToWaitList, net_SerCreateCheckList, net_SerDeleteCheckList, net_ServerWindowEventHandler, NULL, glw_ConnUser::quit, net_File::realsize, REQ_CCALLGAD, REQ_CCLOSEAPP, REQ_CCLOSEWIN, REQ_CECHO, REQ_CNEWSKIN, REQ_COPENWIN, REQ_CWINAWAKE, REQ_CWINSLEEP, REQ_NONE, REQ_SAPP, REQ_SECHO, REQ_SLOADFILE, REQ_SLOADFILES, REQ_SWINEVENT, net_File::size, Window_s::sleep, TAG_DONE, TAG_GADGET_GADGET_ID, TAG_GADGET_METHOD, TAG_GADGET_WINDOW, TAG_MORE, TAG_WIN_APP, TAG_WIN_EVENT_HANDLER, TAG_WIN_FLAGS, TAG_WIN_NAME, TAG_WIN_OBJECT, TAG_WIN_SKINNAME, net_File::type, glw_SockMsg::type, u32, u8, glw_ConnUser::userdata, glw_ConnUser::waitfor, window_ChangeSkin, window_CloseWindow, window_OpenWindow, and window_WindowEvent.

void net_SerSendApp u32    conn
 

Definition at line 88 of file Net.c.

References glw_ConnUser::app, debug_Begin, debug_End, glw_htonl, glw_SendMsg, net_GetServerId, REQ_SAPP, u32, and u8.

int net_Server u32    conn
 

Definition at line 102 of file Net.c.

References net_FileCache::data, debug_Begin, debug_End, glw_ConnUser::file_cache, gui_ServerMain, list_CreateList, list_DeleteList, list_DeleteNode, list_RemoveNodeHead, mem_free, net_FileCache::name, net_ClearMsgList, NULL, u32, and glw_ConnUser::waitlist.

int net_ServerWindowEventHandler gui_App_t   app,
Window_t   win,
u32    gadget_id,
int    event,
u32    event_data
 

Definition at line 190 of file Net.c.

References debug_Begin, debug_End, glw_SendMsg, net_GetServerId, net_MarshalPutLong, REQ_SWINEVENT, u32, u8, and window_GetConnection.

Referenced by net_SerProcessMessage.


Variable Documentation

u32(* call_vector[NET_FUNC_DONE-NET_FUNCBASE+1])(tag *) [static]
 

Definition at line 70 of file Net.c.

Referenced by net_CallTL, and net_Init.


Generated on Tue Jan 7 12:12:38 2003 for THEGUI by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002