/home/dko/projects/mobilec/tags/MobileC-v1.10.2/MobileC-v1.10.2/src/include/mc_platform.h

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

Generated on Fri Jul 11 17:59:45 2008 for Mobile-C by  doxygen 1.5.4