/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 "libmc.h"
00043 #include "../mc_sync/sync_list.h"
00044 #include "../security/asm.h"
00045 
00046 struct mc_platform_s{
00047 #ifdef _WIN32
00048   WSADATA wsaData;
00049 #endif
00050   int err;
00051 #ifdef MC_SECURITY
00052   int enable_security;
00053 #endif
00054 
00055   char* hostname;
00056   unsigned short port;
00057 
00058   /* These are the standard agency data structs. */
00059   message_queue_p asm_message_queue;
00060 #ifdef MC_SECURITY
00061   asm_queue_p asm_queue; /* Holds encryption info for each remote hoste */
00062 #endif
00063   message_queue_p message_queue;
00064   agent_queue_p agent_queue;
00065   connection_queue_p connection_queue;
00066 
00067   df_p df;
00068   ams_p ams;
00069   acc_p acc;
00070   cmd_prompt_p cmd_prompt;
00071 #ifdef MC_SECURITY
00072   mc_asm_p security_manager;
00073 #endif
00074 
00075   syncList_p syncList;
00076   barrier_queue_p barrier_queue;
00077 
00078   listen_thread_arg_p listen_thread_arg;
00079   listen_thread_arg_p client_thread_arg;
00080 
00081   int default_agentstatus;
00082 
00083   int stack_size[MC_THREAD_ALL];
00084 
00085   ChOptions_t *interp_options;
00086 
00087   /* MC Cond Signal System */
00088   COND_T              *MC_signal_cond;
00089   COND_T              *MC_sync_cond;
00090   MUTEX_T             *MC_signal_lock;
00091   MUTEX_T             *MC_sync_lock;
00092   enum MC_Signal_e    MC_signal;
00093 
00094   /* MC Steer System */
00095   enum MC_SteerCommand_e MC_steer_command;
00096   MUTEX_T *MC_steer_lock;
00097   COND_T *MC_steer_cond;
00098 
00099   /* giant lock : Threads will pause if giant==0. 
00100    * giant_lock and giant_cond protect giant. */
00101   int giant;
00102   MUTEX_T *giant_lock;
00103   COND_T  *giant_cond;
00104   
00105   int quit;
00106   MUTEX_T *quit_lock;
00107 };
00108 typedef struct mc_platform_s mc_platform_t;
00109 typedef mc_platform_t* mc_platform_p;
00110 
00111 mc_platform_p 
00112 mc_platform_Initialize(MCAgency_t agency);
00113 
00114 int 
00115 mc_platform_Destroy(mc_platform_p mc_platform);
00116 #endif 

Generated on Mon Jun 23 16:01:10 2008 for Mobile-C by  doxygen 1.5.4