00001 /* SVN FILE INFO 00002 * $Revision: 402 $ : Last Committed Revision 00003 * $Date: 2009-08-23 13:44:39 -0700 (Sun, 23 Aug 2009) $ : 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 _AGENT_DATASPACE_H_ 00036 #define _AGENT_DATASPACE_H_ 00037 #include <mxml.h> 00038 #include "agent_task.h" 00039 00040 00041 typedef struct agent_datastate_s 00042 { 00043 char** agent_code_ids; /* Stores all of the agent code ids */ 00044 char** agent_codes; /* Stores all of the agent code blocks */ 00045 char* agent_code; /* This points to the code block to be executed. */ 00046 00047 /* an array of tasks */ 00048 agent_task_p *tasks; 00049 00050 /* xml Parsing attributes */ 00051 mxml_node_t *xml_agent_root; 00052 mxml_node_t *xml_root; 00053 00054 /* place in the task list that corresponds to current task */ 00055 int task_progress; 00056 int return_data; 00057 00058 /* size variables */ 00059 int number_of_tasks; 00060 00061 /* execution flags */ 00062 int persistent; 00063 int init_agent_status; 00064 00065 /* The progress modifier is a variable that holds an amount to vary the 00066 progress by at the end of the agents execution. This is necessary because 00067 some cleanup routines after an agent finished rely on an accurate 00068 "progress" variable. This means that the progress variable cannot be 00069 changed during an agent's execution. During an agent's execution, only 00070 the progress_modifier variable should be modified. */ 00071 int progress_modifier; 00072 } agent_datastate_t; 00073 typedef agent_datastate_t* agent_datastate_p; 00074 00075 agent_datastate_p 00076 agent_datastate_Copy(const agent_datastate_p datastate); 00077 00078 agent_datastate_p 00079 agent_datastate_New(void); 00080 00081 int 00082 agent_datastate_Destroy( agent_datastate_p agent_datastate ); 00083 #endif