/home/dko/projects/mobilec/trunk/src/include/mc_platform.h

Go to the documentation of this file.
00001 /*[
00002  * Copyright (c) 2007 Integration Engineering Laboratory
00003                       University of California, Davis
00004  *
00005  * Permission to use, copy, and distribute this software and its
00006  * documentation for any purpose with or without fee is hereby granted,
00007  * provided that the above copyright notice appear in all copies and
00008  * that both that copyright notice and this permission notice appear
00009  * in supporting documentation.
00010  *
00011  * Permission to modify the software is granted, but not the right to
00012  * distribute the complete modified source code.  Modifications are to
00013  * be distributed as patches to the released version.  Permission to
00014  * distribute binaries produced by compiling modified sources is granted,
00015  * provided you
00016  *   1. distribute the corresponding source modifications from the
00017  *    released version in the form of a patch file along with the binaries,
00018  *   2. add special version identification to distinguish your version
00019  *    in addition to the base release version number,
00020  *   3. provide your name and address as the primary contact for the
00021  *    support of your modified version, and
00022  *   4. retain our contact information in regard to use of the base
00023  *    software.
00024  * Permission to distribute the released version of the source code along
00025  * with corresponding source modifications in the form of a patch file is
00026  * granted with same provisions 2 through 4 for binary distributions.
00027  *
00028  * This software is provided "as is" without express or implied warranty
00029  * to the extent permitted by applicable law.
00030 ]*/
00031 
00032 #ifndef _MC_PLATFORM_H_
00033 #define _MC_PLATFORM_H_
00034 #include "acc.h"
00035 #include "ams.h"
00036 #include "barrier.h"
00037 #include "cmd_prompt.h"
00038 #include "config.h"
00039 #include "connection.h"
00040 #include "data_structures.h"
00041 #include "df.h"
00042 #include "../mc_sync/sync_list.h"
00043 #include "../security/asm.h"
00044 
00045 struct mc_platform_s{
00046 #ifdef _WIN32
00047   WSADATA wsaData;
00048 #endif
00049   int err;
00050 #ifdef MC_SECURITY
00051   int enable_security;
00052 #endif
00053 
00054   char* hostname;
00055   unsigned short port;
00056 
00057   /* These are the standard agency data structs. */
00058   message_queue_p asm_message_queue;
00059 #ifdef MC_SECURITY
00060   asm_queue_p asm_queue; /* Holds encryption info for each remote hoste */
00061 #endif
00062   message_queue_p message_queue;
00063   agent_queue_p agent_queue;
00064   connection_queue_p connection_queue;
00065 
00066   df_p df;
00067   ams_p ams;
00068   acc_p acc;
00069   cmd_prompt_p cmd_prompt;
00070 #ifdef MC_SECURITY
00071   mc_asm_p security_manager;
00072 #endif
00073 
00074   syncList_p syncList;
00075   barrier_queue_p barrier_queue;
00076 
00077   listen_thread_arg_p listen_thread_arg;
00078   listen_thread_arg_p client_thread_arg;
00079 
00080   int default_agentstatus;
00081 
00082   int stack_size[MC_THREAD_ALL];
00083 
00084   ChOptions_t *interp_options;
00085 
00086   /* MC Cond Signal System */
00087   COND_T              *MC_signal_cond;
00088   COND_T              *MC_sync_cond;
00089   MUTEX_T             *MC_signal_lock;
00090   MUTEX_T             *MC_sync_lock;
00091   enum MC_Signal_e    MC_signal;
00092 
00093   /* MC Steer System */
00094   enum MC_SteerCommand_e MC_steer_command;
00095   MUTEX_T *MC_steer_lock;
00096   COND_T *MC_steer_cond;
00097 
00098   /* giant lock : Threads will pause if giant==0. 
00099    * giant_lock and giant_cond protect giant. */
00100   int giant;
00101   MUTEX_T *giant_lock;
00102   COND_T  *giant_cond;
00103   
00104   int quit;
00105   MUTEX_T *quit_lock;
00106 };
00107 typedef struct mc_platform_s mc_platform_t;
00108 typedef mc_platform_t* mc_platform_p;
00109 
00110 mc_platform_p 
00111 mc_platform_Initialize(MCAgency_t agency);
00112 
00113 int 
00114 mc_platform_Destroy(mc_platform_p mc_platform);
00115 #endif 

Generated on Fri May 16 14:49:54 2008 for Mobile-C by  doxygen 1.5.4