00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 static const char *rcsid = "$Header: /export/cvs-gridlab/GridLabWeb/WorkPackages/wp-1/Doc/C-Reference/endpoint__adaptor_8c-source.html,v 1.6 2004/05/13 09:52:23 merzky Exp $";
00018
00019
00020 #include <stdio.h>
00021 #include <stdlib.h>
00022 #include <string.h>
00023
00024
00025 #include <GATCPI.h>
00026
00027 #include "pipe.h"
00028 #include "endpoint.h"
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 GATResult
00054 endpoint_adaptor_register(GATContext error_context, GATRegistry registry,
00055 GATTable_const system_config, GATTable_const instance_config, void *token)
00056 {
00057 GAT_USES_STATUS(error_context, "endpoint_adaptor_register");
00058
00059 int load_pipe_cpi = 0;
00060 int load_endpoint_cpi = 0;
00061
00062 if (!GATVERSION_ISCOMPATIBLE())
00063 {
00064 GAT_CREATE_STATUS(GAT_UNKNOWN_VERSION);
00065 }
00066 else
00067 {
00068
00069 GATResult retval = GATTable_Get_int(instance_config, "Endpoint",
00070 &load_endpoint_cpi);
00071 if (GAT_FAILED(retval))
00072 {
00073 load_endpoint_cpi = 1;
00074 }
00075
00076
00077 retval = GATTable_Get_int(instance_config, "Pipe", &load_pipe_cpi);
00078 if (GAT_FAILED(retval))
00079 {
00080 load_pipe_cpi = 1;
00081 }
00082
00083
00084 if (load_endpoint_cpi)
00085 {
00086 GAT_CREATE_STATUS(endpoint_adaptor_register_endpoint(error_context,
00087 registry, system_config, instance_config, token));
00088 }
00089 if (load_pipe_cpi)
00090 {
00091 GAT_CREATE_STATUS(pipe_adaptor_register_pipe(error_context, registry,
00092 system_config, instance_config, token));
00093 }
00094 }
00095 return GAT_RETURN_STATUS();
00096 }