GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

self.c

Go to the documentation of this file.
00001 /** @file adaptorname.c
00002  *  Source file for the GATSelfCPI provider class for the 
00003  *  adaptorname adaptor.
00004  *
00005  *  TODO: Fill in the description of the new CPI provider here
00006  *
00007  *  @date Mon Jan 26 2004
00008  *
00009  *  @version $Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/self.c,v 1.12 2004/04/26 15:45:00 hartmutkaiser Exp $
00010  *
00011  *  Copyright (C) Hartmut Kaiser
00012  *  This file is part of the GAT Engine.
00013  *  Contributed by Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.
00014  *
00015  *  Use, modification and distribution is subject to the Gridlab Software
00016  *  License. (See accompanying file GLlicense.txt or copy at
00017  *  http://www.gridlab.org/GLlicense.txt)
00018  */
00019 
00020 static const char *rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/self.c,v 1.12 2004/04/26 15:45:00 hartmutkaiser Exp $";
00021  
00022 /*
00023  *  Note, that since the GATSelf object is a singleton object, there is no need 
00024  *  to implement the ..._CloneInstance and ..._EqualsInstance functions.
00025  */
00026  
00027 /* System Header Files */
00028 #include <stdio.h>
00029 #include <stdlib.h>
00030 #include <string.h>
00031 
00032 #include <unistd.h>
00033 
00034 /* GAT Header Files */
00035 #include "GATCPI.h"
00036 
00037 #include "GATJobCPIInstanceData.h"
00038 #include "GATRequestCPIInstanceData.h"
00039 #include "resourcebroker.h"
00040 #include "self.h"
00041 
00042 /* Macros */
00043 
00044 /* Structures, unions and enums */
00045 
00046 /* Static function prototypes */
00047 static void
00048 resourcebroker_adaptor_GATSelfCPI_Destroy(void *data);
00049 
00050 /* instance specific functions */
00051 static GATResult
00052 resourcebroker_adaptor_GATSelfCPI_ServiceActions(void *data, 
00053   GATSelfCPI_Instance *instance_data, GATTimePeriod_const timeout);
00054 
00055 static GATResult 
00056   resourcebroker_adaptor_GATSelfCPI_CreateInstance(
00057     void *data, GATSelfCPI_Instance *instance_data);
00058 
00059 static void 
00060   resourcebroker_adaptor_GATSelfCPI_DestroyInstance(
00061     void *data, GATSelfCPI_Instance *instance_data);
00062 
00063 /* CPI API functionality */
00064 static GATResult
00065   resourcebroker_adaptor_GATSelfCPI_GetJob(
00066     void *data, GATSelfCPI_Instance *instance_data, GATContext context, 
00067       GATJob *job);
00068 
00069 static GATResult 
00070   resourcebroker_adaptor_GATSelfCPI_CreateRequestForListener(GATSelfCPI cpi, 
00071     GATSelfCPI_Instance *instance_data, GATContext context, 
00072     GATRequestListener listener, void *data, GATRequestType type, 
00073     GATTable_const parameters, const char *name, GATRequest *request);
00074 
00075 static GATResult 
00076   resourcebroker_adaptor_GATSelfCPI_DestroyRequestForListener(GATSelfCPI cpi, 
00077     GATSelfCPI_Instance *instance_data, GATContext context, GATRequest *request);
00078 
00079 /* local functions */
00080 static GATResult
00081 resourcebroker_adaptor_GATSelfCPI_create_self_jobdescription(GATContext context,
00082   GATJobDescription *jobdesc);
00083 
00084 static GATResult
00085 resourcebroker_adaptor_GATSelfCPI_create_self_resource(GATContext context, 
00086   GATResource *resource);
00087 
00088 static GATSoftwareDescription
00089   resourcebroker_adaptor_CreateSoftwareDescription(GATContext context);
00090 
00091 static GATResult
00092   resourcebroker_adaptor_GetCommandLine(GATContext context, GATTable attributes);
00093 
00094 static GATResult
00095   resourcebroker_adaptor_GetEnvironment(GATContext context, GATTable attributes);
00096 
00097 static GATResult
00098   resourcebroker_adaptor_FillCommandLine(GATContext context, 
00099     GATTable attributes, int argc, char *argv[]);
00100 
00101 static GATResult
00102   resourcebroker_adaptor_FillEnvironment(GATContext context, char **glb_environ, 
00103     GATTable environment);
00104 
00105 #if !defined(WIN32)
00106 static GATResult
00107   resourcebroker_adaptor_GetCommandLineArgs(int *argc, char ***argv);
00108 #endif 
00109 
00110 /* File scope variables */
00111 
00112 /* External functions */
00113 
00114 /* Register the CPI to implement */
00115 GATResult resourcebroker_adaptor_Register_GATSelfCPI(
00116   GATContext error_context, GATRegistry registry, 
00117   GATTable_const system_config, GATTable_const instance_config, void *token)
00118 {
00119   GAT_USES_STATUS(error_context, "resourcebroker_adaptor_Register_GATSelfCPI");
00120   
00121   GATSelfCPI cpi = NULL;
00122   GATSelfCPI_Data cpidata;
00123 
00124   {
00125     memset(&cpidata, 0, sizeof(GATSelfCPI_Data));
00126       
00127     /*
00128      *  provide the appropriate callback functions
00129      */
00130     cpidata.data = NULL;   /* no adaptor instance data */
00131     cpidata.destroy = resourcebroker_adaptor_GATSelfCPI_Destroy;
00132     
00133     /* instance data handling */
00134     cpidata.service_actions = resourcebroker_adaptor_GATSelfCPI_ServiceActions;
00135     cpidata.create_instance = resourcebroker_adaptor_GATSelfCPI_CreateInstance;
00136     cpidata.destroy_instance = resourcebroker_adaptor_GATSelfCPI_DestroyInstance;
00137     
00138     /* CPI specific API functions */
00139     cpidata.get_selfjob = resourcebroker_adaptor_GATSelfCPI_GetJob;
00140     cpidata.create_requestforlistener = 
00141       resourcebroker_adaptor_GATSelfCPI_CreateRequestForListener;
00142     cpidata.destroy_requestforlistener = 
00143       resourcebroker_adaptor_GATSelfCPI_DestroyRequestForListener;
00144     
00145     /* Create a GATSelfCPI object. */
00146     cpi = GATSelfCPI_Create(GATSELFCPI_VERSION, &cpidata);
00147     if(NULL != cpi)
00148     {
00149       /* Need to pass preferences to allow matching
00150        * of a user's preferences with what this adaptor does.
00151        */
00152       GATPreferences preferences = GATPreferences_Create();
00153       if(NULL != preferences)
00154       {
00155         GAT_CREATE_STATUS(GATPreferences_Add(preferences, "Name", 
00156           "resourcebroker_adaptor"));
00157         GAT_CREATE_STATUS(GATPreferences_Add(preferences, "Security", "none"));
00158         GAT_CREATE_STATUS(GATPreferences_Add(preferences, "Local", "true"));
00159         
00160         GAT_CREATE_STATUS(GATRegistry_AddGATSelfCPI(registry, cpi, token, 
00161           preferences));
00162         
00163         GATPreferences_Destroy(&preferences);
00164       }
00165     }
00166   }
00167 
00168   if (GAT_FAILED(GAT_CURRENT_STATUS()))
00169   {
00170     GATSelfCPI_Destroy(&cpi);
00171   }
00172 
00173   return GAT_RETURN_STATUS();
00174 }
00175 
00176 /* Local functions */
00177 
00178 static void
00179 resourcebroker_adaptor_GATSelfCPI_Destroy(void *data)
00180 {
00181   /* nothing to do here (no internal data allocated) */
00182   assert(NULL == data);
00183 }
00184 
00185 
00186 /* instance specific functions */
00187 
00188 /** resourcebroker_adaptor_GATSelfCPI_CreateInstance
00189  *  Create a new CPI object instance.
00190  *  Adaptor implementation of create instance capability.
00191  *
00192  * @param data Adaptor-provided data object.
00193  * @param new_instance_data The pointer to the variable, where the instance 
00194  *      data of this CPI object is to be returned to.
00195  * 
00196  * @return An error code.
00197  */
00198 static GATResult 
00199 resourcebroker_adaptor_GATSelfCPI_CreateInstance(void *data, 
00200   GATSelfCPI_Instance *new_instance_data)
00201 {
00202   GATResult retval = GAT_INVALID_PARAMETER;
00203   if (NULL != new_instance_data)
00204   {
00205     new_instance_data->instance_data = NULL;     /* no instance data */
00206     retval = GAT_SUCCESS;
00207   }
00208   return retval;
00209 }
00210 
00211 /** resourcebroker_adaptor_GATSelfCPI_DestroyInstance
00212  *  Destroy a CPI object instance.
00213  *  Adaptor implementation of destroy instance capability.
00214  *
00215  * @param data Adaptor-provided data object.
00216  * @param instance_data The instance data of the CPI object to destroy.
00217  */
00218 static void
00219 resourcebroker_adaptor_GATSelfCPI_DestroyInstance(void *data, 
00220   GATSelfCPI_Instance *instance_data)
00221 {
00222   assert(NULL == instance_data->instance_data);  /* no instance data */
00223 }
00224 
00225 /** resourcebroker_adaptor_GATResourceCPI_ServiceActions
00226  *  
00227  *  The function resourcebroker_adaptor_GATSelfCPI_ServiceActions is called, 
00228  *  whenever the client calls GATContext_ServiceActions. This function is 
00229  *  called for every created object.
00230  *  This function should be used to update all instance specific data, which 
00231  *  may have been changed asynchronously or to fire pending events.
00232  *
00233  *  @param data Adaptor-provided data object.
00234  *  @param instance_data The instance data of this CPI object
00235  *  @param timeout This may be a 0 timeout to indicate no timeout at all, or
00236  *        a specific time length.
00237  *
00238  *  @return An error code.
00239  */
00240 static GATResult
00241 resourcebroker_adaptor_GATSelfCPI_ServiceActions(void *data, 
00242   GATSelfCPI_Instance *instance_data, GATTimePeriod_const timeout)
00243 {
00244   return GAT_NOTIMPL;
00245 }
00246 
00247 /* CPI specific API functions */
00248 static GATResult
00249 resourcebroker_adaptor_GATSelfCPI_GetJob(
00250   void *data, GATSelfCPI_Instance *instance_data, GATContext context, 
00251   GATJob *job)
00252 {
00253   if (NULL != instance_data)
00254   {
00255     GAT_USES_STATUS(context, "resourcebroker_adaptor_GATSelfCPI_GetJob");
00256     
00257     GATJobCPIInstance_Data *instance_data = NULL;
00258     GATJobDescription jd = NULL;
00259     GATResource resource = NULL;
00260     
00261     GAT_CREATE_STATUS(resourcebroker_adaptor_GATSelfCPI_create_self_jobdescription(
00262       context, &jd));
00263     GAT_CREATE_STATUS(resourcebroker_adaptor_GATSelfCPI_create_self_resource(
00264       context, &resource));
00265 
00266     if (GAT_SUCCEEDED(GAT_CURRENT_STATUS()))
00267     {
00268       instance_data = GATJobCPIInstance_Data_Create(jd, resource, GATFalse);
00269       if (NULL != instance_data)
00270       {
00271         GATPreferences preferences = NULL;
00272         GATJobID jobid = NULL;
00273         char const *vo_name_str = "self_vo_name";
00274         GATString vo_name = GATString_Create(vo_name_str, 
00275           (GATuint32)strlen(vo_name_str)+1, "ASCII");
00276         
00277         GAT_CREATE_STATUS_IF(NULL == vo_name, GAT_MEMORYFAILURE);
00278         GAT_CREATE_STATUS(resourcebroker_adaptor_MyPreferences(context, 
00279           &preferences));
00280         GAT_CREATE_STATUS(resourcebroker_adaptor_make_sample_jobid(vo_name, 
00281           &jobid));
00282 
00283         if (GAT_SUCCEEDED(GAT_CURRENT_STATUS()))
00284         {
00285           GATJob new_job = GATJob_Create(context, preferences, jobid, 
00286             instance_data);
00287           if (NULL == new_job)
00288           {
00289             GAT_CREATE_STATUS(GAT_MEMORYFAILURE);
00290           }
00291           else
00292           {
00293             *job = new_job;
00294           }
00295         }
00296         
00297         GATString_Destroy(&vo_name);
00298         GATString_Destroy(&jobid);
00299         GATPreferences_Destroy(&preferences);
00300         GATJobCPIInstance_Data_Destroy(&instance_data);
00301       }
00302       else
00303       {
00304         GAT_CREATE_STATUS(GAT_MEMORYFAILURE);
00305       }
00306     }
00307     
00308     GATResource_Destroy(&resource);
00309     GATJobDescription_Destroy(&jd);
00310     
00311     return GAT_RETURN_STATUS();
00312   }
00313   return GAT_INVALID_PARAMETER;
00314 }
00315 
00316 /** resourcebroker_adaptor_GATSelfCPI_CreateRequestForListener
00317  *
00318  *
00319  *  @return An error code.
00320  */
00321 static GATResult 
00322 resourcebroker_adaptor_GATSelfCPI_CreateRequestForListener(GATSelfCPI cpi, 
00323   GATSelfCPI_Instance *instance_data, GATContext context, 
00324   GATRequestListener listener, void *data, GATRequestType type, 
00325   GATTable_const parameters, const char *name, GATRequest *request)
00326 {
00327   GAT_USES_STATUS(context, 
00328     "resourcebroker_adaptor_GATSelfCPI_CreateRequestForListener");
00329   GATPreferences preferences = NULL;
00330   GATRequest new_request = NULL;
00331   GATRequestCPIInstance_Data *initialisation_data = NULL;
00332 
00333   GAT_CREATE_STATUS(resourcebroker_adaptor_MyPreferences(context, 
00334     &preferences));
00335   
00336   initialisation_data = GATRequestCPIInstance_Data_Create();
00337   GAT_CREATE_STATUS_IF(NULL == initialisation_data, GAT_MEMORYFAILURE);
00338 
00339   new_request = GATRequest_Create(context, preferences, listener,
00340     data, type, parameters, name, initialisation_data);
00341   GAT_CREATE_STATUS_IF(NULL == new_request, GAT_MEMORYFAILURE);
00342   
00343   GATRequestCPIInstance_Data_Destroy(&initialisation_data);
00344   GATPreferences_Destroy(&preferences);
00345 
00346   if (GAT_SUCCEEDED(GAT_CURRENT_STATUS()))
00347   {
00348     if (NULL != request)
00349     {
00350       *request = new_request;
00351     }
00352     else
00353     {
00354       GAT_CREATE_STATUS(GAT_INVALID_PARAMETER);
00355     }
00356   }
00357       
00358   if (GAT_FAILED(GAT_CURRENT_STATUS()))
00359   {
00360     GATRequest_Destroy(&new_request);
00361   }
00362   
00363   return GAT_RETURN_STATUS();
00364 }
00365 
00366 /** GATSelfCPI_DestroyRequestForListener
00367  *
00368  *
00369  *  @return An error code.
00370  */
00371 static GATResult 
00372 resourcebroker_adaptor_GATSelfCPI_DestroyRequestForListener(GATSelfCPI cpi, 
00373   GATSelfCPI_Instance *instance_data, GATContext context, GATRequest *request)
00374 {
00375   GATRequest_Destroy(request);
00376   return GAT_SUCCESS;
00377 }
00378 
00379 
00380 /* local functions */
00381 
00382 /** resourcebroker_adaptor_GATSelfCPI_create_self_jobdescription
00383  *  
00384  */
00385 static GATResult
00386 resourcebroker_adaptor_GATSelfCPI_create_self_jobdescription(GATContext context,
00387   GATJobDescription *jobdesc)
00388 {
00389   GAT_USES_STATUS(context, 
00390     "resourcebroker_adaptor_GATSelfCPI_create_self_jobdescription");
00391 
00392   GATSoftwareDescription sd = NULL;
00393   GATResourceDescription hrd = NULL;
00394 
00395   /* create the software description of this job */
00396   sd = resourcebroker_adaptor_CreateSoftwareDescription(context);
00397   GAT_CREATE_STATUS_IF(NULL == sd, GAT_MEMORYFAILURE)
00398   
00399   if (GAT_SUCCEEDED(GAT_CURRENT_STATUS()))
00400   {
00401     /* create a hardware resource description describing this' job 
00402        environment */
00403     hrd = resourcebroker_adaptor_CreateHardwareResourceDescription();
00404     GAT_CREATE_STATUS_IF(NULL == hrd, GAT_MEMORYFAILURE)
00405   }
00406   
00407   if (GAT_SUCCEEDED(GAT_CURRENT_STATUS()))
00408   {
00409     GATJobDescription jd = 
00410       GATJobDescription_Create_Description(context, sd, hrd);
00411     if (NULL != jd)
00412     {
00413       if (NULL != jobdesc)
00414       {
00415         *jobdesc = jd;
00416       }
00417       else
00418       {
00419         GATJobDescription_Destroy(&jd);
00420         GAT_CREATE_STATUS(GAT_INVALID_PARAMETER);
00421       }
00422     }
00423   }
00424   
00425   GATSoftwareDescription_Destroy(&sd);
00426   GATResourceDescription_Destroy(&hrd);
00427   return GAT_RETURN_STATUS();
00428 }
00429 
00430 /** resourcebroker_adaptor_GATSelfCPI_create_self_resource
00431  *  
00432  */
00433 static GATResult
00434 resourcebroker_adaptor_GATSelfCPI_create_self_resource(GATContext context,
00435   GATResource *resource)
00436 {
00437   GAT_USES_STATUS(context, 
00438     "resourcebroker_adaptor_GATSelfCPI_create_self_resource");
00439 
00440   GATResourceDescription rd = 
00441     resourcebroker_adaptor_CreateHardwareResourceDescription();
00442   if (NULL == rd) 
00443   {
00444     GAT_CREATE_STATUS(GAT_MEMORYFAILURE);
00445   }
00446   else
00447   {
00448     GAT_CREATE_STATUS(resourcebroker_adaptor_CreateResource(
00449       context, rd, resource));
00450     GATResourceDescription_Destroy(&rd);
00451   }
00452   return GAT_RETURN_STATUS();
00453 }
00454 
00455 /** resourcebroker_adaptor_CreateSoftwareDescription
00456  *  
00457  */
00458 static GATSoftwareDescription
00459 resourcebroker_adaptor_CreateSoftwareDescription(GATContext context)
00460 {
00461   GAT_USES_STATUS(context, "resourcebroker_adaptor_CreateSoftwareDescription");
00462   
00463   GATSoftwareDescription sw_desc = NULL;
00464   GATTable attributes = NULL;
00465   
00466   /* create and fill the attribute table */
00467   attributes = GATTable_Create();
00468   GAT_CREATE_STATUS_IF(NULL == attributes, GAT_MEMORYFAILURE);
00469   
00470   if (GAT_SUCCEEDED(GAT_CURRENT_STATUS()))
00471   {
00472     /* fill in the command line arguments of this executable */
00473     GAT_CREATE_STATUS(resourcebroker_adaptor_GetCommandLine(context, 
00474       attributes));
00475 
00476     /* fill in the environment of this executable */
00477     GAT_CREATE_STATUS(resourcebroker_adaptor_GetEnvironment(context, 
00478       attributes));
00479       
00480     /* create the software description object */
00481     sw_desc = GATSoftwareDescription_Create (attributes);
00482     GAT_CREATE_STATUS_IF(NULL == sw_desc, GAT_MEMORYFAILURE);
00483   }
00484   
00485   /* free the allocated memory */
00486   GATTable_Destroy(&attributes);
00487 
00488   GAT_STORE_STATUS();
00489   return sw_desc;
00490 }
00491 
00492 static GATResult
00493 resourcebroker_adaptor_GetCommandLine(GATContext context, GATTable attributes)
00494 {
00495   GAT_USES_STATUS(context, "resourcebroker_adaptor_GetCommandLine");
00496   
00497   /* get command line and parse it into single arguments */
00498 
00499 #if defined(WIN32)
00500   GAT_CREATE_STATUS(resourcebroker_adaptor_FillCommandLine(context, 
00501     attributes, __argc, __argv));
00502 #else
00503   int argc = NULL;
00504   char **argv = NULL;
00505   
00506   GAT_CREATE_STATUS(resourcebroker_adaptor_GetCommandLineArgs(&argc, &argv));
00507   GAT_CREATE_STATUS(resourcebroker_adaptor_FillCommandLine(context, 
00508     attributes, argc, argv));
00509     
00510   free(argv);
00511 #endif
00512   
00513   return GAT_RETURN_STATUS();
00514 }
00515 
00516 static GATResult
00517 resourcebroker_adaptor_FillCommandLine(GATContext context, GATTable attributes,
00518   int argc, char *argv[])
00519 {
00520   GAT_USES_STATUS(context, "resourcebroker_adaptor_FillCommandLine");
00521   
00522   if (NULL != argv)
00523   {
00524     /* create "location" attribute" */
00525     int i = 0;
00526     GATList_String arguments = NULL;
00527     GATLocation location = GATLocation_Create(argv[0]);
00528     GAT_CREATE_STATUS_IF(NULL == location, GAT_MEMORYFAILURE);
00529     
00530     GAT_CREATE_STATUS(GATTable_Add_GATObject(attributes, "location", 
00531       GATLocation_ToGATObject_const(location)));
00532 
00533     /* create and fill the "arguments" attribute */
00534     arguments = GATList_String_Create();
00535     GAT_CREATE_STATUS_IF(NULL == arguments, GAT_MEMORYFAILURE);
00536 
00537     for (i = 1; i < argc; ++i)
00538     {
00539       if (GAT_SUCCEEDED(GAT_CURRENT_STATUS()))
00540       {
00541         GATList_String_Iterator it = GATList_String_Insert(arguments, 
00542           GATList_String_End(arguments), argv[i]);
00543         GAT_CREATE_STATUS_IF(NULL == it, GAT_FAIL);
00544       }
00545     }
00546     
00547     GAT_CREATE_STATUS(GATTable_Add_GATObject(attributes, "arguments", 
00548       GATList_String_ToGATObject_const(arguments)));
00549     GATList_String_Destroy(&arguments);
00550     GATLocation_Destroy(&location);
00551   }
00552 
00553   return GAT_RETURN_STATUS();
00554 }
00555 
00556 static GATResult 
00557 resourcebroker_adaptor_GetEnvironment(GATContext context, GATTable attributes)
00558 {
00559   GAT_USES_STATUS(context, "resourcebroker_adaptor_GetEnvironment");
00560 
00561   GATTable environment = GATTable_Create();
00562 
00563   GAT_CREATE_STATUS_IF(NULL == environment, GAT_MEMORYFAILURE);
00564   
00565 #if defined(WIN32) 
00566   GAT_CREATE_STATUS(resourcebroker_adaptor_FillEnvironment(context, environ, 
00567     environment));
00568 #elif defined(linux) || defined(__linux) || defined(__linux__)
00569   GAT_CREATE_STATUS(resourcebroker_adaptor_FillEnvironment(context, 
00570     __environ, environment));
00571 #endif
00572 
00573   GAT_CREATE_STATUS(GATTable_Add_GATObject(attributes, "environment", 
00574     GATTable_ToGATObject(environment)));
00575 
00576   GATTable_Destroy(&environment);
00577   
00578   return GAT_RETURN_STATUS();
00579 }
00580 
00581 static GATResult
00582 resourcebroker_adaptor_FillEnvironment(GATContext context, char **glb_environ, GATTable environment)
00583 {
00584   GAT_USES_STATUS(context, "resourcebroker_adaptor_FillEnvironment");
00585   
00586   int i = 0;
00587   for (/**/; NULL != glb_environ[i]; ++i)
00588   {
00589     char *value = strchr(glb_environ[i], '=');
00590     if (NULL != value)
00591     {
00592       GATString envstr = GATString_Create(value+1, (GATuint32)strlen(value), 
00593         "ASCII");
00594     
00595       GAT_CREATE_STATUS_IF(NULL == envstr, GAT_MEMORYFAILURE);
00596       if (NULL != envstr)
00597       {
00598         size_t len = value - glb_environ[i];
00599         if (len > 0)
00600         {
00601           char *key = (char *)malloc(len + 1);
00602           
00603           if (NULL != key)
00604           {
00605             strncpy (key, glb_environ[i], len);
00606             key[len] = '\0';
00607             
00608             if (GATType_GATObject != GATTable_Get_ElementType(environment, key))
00609             {
00610               GAT_CREATE_STATUS(GATTable_Add_GATObject(environment, key, 
00611                 GATString_ToGATObject(envstr)));
00612             }
00613             
00614             free(key);
00615           }
00616           else
00617           {
00618             GAT_CREATE_STATUS(GAT_MEMORYFAILURE);
00619             break;
00620           }
00621         }
00622 
00623         GATString_Destroy(&envstr);
00624       }
00625       else
00626       {
00627         GAT_CREATE_STATUS(GAT_MEMORYFAILURE);
00628         break;
00629       }
00630     }
00631   }
00632   return GAT_RETURN_STATUS();
00633 }
00634 
00635 #if !defined(WIN32)
00636 static GATResult
00637 resourcebroker_adaptor_GetCommandLineArgs(int *argc, char ***argv)
00638 {
00639   GATResult retval = GAT_NOTIMPL;
00640   *argc = NULL;
00641   *argv = NULL;
00642   return retval;
00643 }
00644 #endif