From 18a1fc57cae3e84de90bff87b08d3dd1dae72fe3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Voc=C5=AF?= Date: Wed, 26 Mar 2008 15:06:44 +0000 Subject: [PATCH] moveDG example code to org.glite.lb.doc --- org.glite.lb.client/examples/dg/Makefile | 81 ------------------------ org.glite.lb.client/examples/dg/client_headers.h | 4 -- org.glite.lb.client/examples/dg/example1.c | 20 ------ org.glite.lb.client/examples/dg/example1_code.c | 32 ---------- org.glite.lb.client/examples/dg/util.c | 54 ---------------- 5 files changed, 191 deletions(-) delete mode 100644 org.glite.lb.client/examples/dg/Makefile delete mode 100644 org.glite.lb.client/examples/dg/client_headers.h delete mode 100644 org.glite.lb.client/examples/dg/example1.c delete mode 100644 org.glite.lb.client/examples/dg/example1_code.c delete mode 100644 org.glite.lb.client/examples/dg/util.c diff --git a/org.glite.lb.client/examples/dg/Makefile b/org.glite.lb.client/examples/dg/Makefile deleted file mode 100644 index 62b09a8..0000000 --- a/org.glite.lb.client/examples/dg/Makefile +++ /dev/null @@ -1,81 +0,0 @@ -glite_location:=${GLITE_LOCATION} -glite_prefix:=${glite_location} - -nothrflavour=gcc32dbg -thrflavour=gcc32dbgpthr - -CC:=gcc -CXX:=g++ - -COMMON_LIB:=-lglite_lb_common_${nothrflavour} -COMMON_LIB_THR:=-lglite_lb_common_${thrflavour} -CLIENT_LIB:=-lglite_lb_client_${nothrflavour} -CLIENT_LIB_THR:=-lglite_lb_client_${thrflavour} -JOBID_LIB:=-lglite_jobid - -LIB:=${COMMON_LIB} ${CLIENT_LIB} ${JOBID_LIB} -LIB_THR:=${COMMON_LIB_THR} ${CLIENT_LIB_THR} ${JOBID_LIB} -PLUSLIB:= -PLUSLIB_THR:= - -CFLAGS:=${DEBUG} \ - -I${glite_prefix}/include \ - -D_GNU_SOURCE - -CXXFLAGS:=${CFLAGS} - -host_cpu:=${shell uname -m} -ifeq (${host_cpu},x86_64) - LDFLAGS:=-L${glite_prefix}/lib64 -else - LDFLAGS:=-L${glite_prefix}/lib -endif - -COMPILE:=libtool --mode=compile ${CC} ${CFLAGS} -CXXCOMPILE:=libtool --mode=compile ${CXX} ${CXXFLAGS} -LINK:=libtool --mode=link ${CC} ${LDFLAGS} -LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS} -INSTALL:=libtool --mode=install install - -EXAMPLES_SRC:=example1.c -EXAMPLES:=${EXAMPLES_SRC:.c=} - -EXTRA_SRC:=util.c -EXTRA_OBJ:=${EXTRA_SRC:.c=.o} - -# TODO: migrate them here from branch_RC31_3 -# EXAMPLES_PLUS_SRC:= -# EXAMPLES_PLUS:=${EXAMPLES_PLUS_SRC:.cpp=} -# EXAMPLES_PLUS_THR_SRC:= -# EXAMPLES_PLUS_THR:=${EXAMPLES_PLUS_THR_SRC:.cpp=} - -EXAMPLES_THR_SRC:= -EXAMPLES_THR:=${EXAMPLES_CL_THR_SRC:.c=} - -default all: examples - -examples: ${EXAMPLES} ${EXAMPLES_THR} ${EXAMPLES_PLUS} ${EXAMPLES_PLUS_THR} - -${EXAMPLES}: %: %.o ${EXTRA_OBJ} - ${LINK} -o $@ $< ${EXTRA_OBJ} ${LIB} - -${EXAMPLES_THR}: %: %.o - ${LINK} -o $@ $< ${LIB_THR} - -${EXAMPLES_PLUS}: %: %.o - ${LINKXX} -o $@ $< ${PLUSLIB} - -${EXAMPLES_PLUS_THR}: %: %.o - ${LINKXX} -o $@ $< ${PLUSLIB_THR} - -# catches $TOOLS and logevent compilation -%.o: %.c - ${CC} ${CFLAGS} -c $< - -%.o: %.cpp - ${CXX} ${CXXFLAGS} -c $< - -clean: - rm -rvf ${EXAMPLES} ${EXAMPLES_CL} ${EXAMPLES_CL_THR} - rm -rvf *.o .libs/ - diff --git a/org.glite.lb.client/examples/dg/client_headers.h b/org.glite.lb.client/examples/dg/client_headers.h deleted file mode 100644 index c4cd498..0000000 --- a/org.glite.lb.client/examples/dg/client_headers.h +++ /dev/null @@ -1,4 +0,0 @@ -#include "glite/lb/context.h" -#include "glite/lb/xml_conversions.h" -#include "glite/lb/consumer.h" - diff --git a/org.glite.lb.client/examples/dg/example1.c b/org.glite.lb.client/examples/dg/example1.c deleted file mode 100644 index a26c451..0000000 --- a/org.glite.lb.client/examples/dg/example1.c +++ /dev/null @@ -1,20 +0,0 @@ -#ident "$Header$" - -#include -#include -#include -#include - -#include "client_headers.h" - -#include "glite/lb/xml_conversions.h" - -extern void print_jobs(edg_wll_JobStat *); - -int main(int argc,char **argv) -{ - -#include "example1_code.c" - - return 0; -} diff --git a/org.glite.lb.client/examples/dg/example1_code.c b/org.glite.lb.client/examples/dg/example1_code.c deleted file mode 100644 index e436c2b..0000000 --- a/org.glite.lb.client/examples/dg/example1_code.c +++ /dev/null @@ -1,32 +0,0 @@ - -edg_wll_Context ctx; -edg_wll_JobStat *statesOut = NULL; -edg_wll_QueryRec jc[2]; - -edg_wll_InitContext(&ctx); - -jc[0].attr = EDG_WLL_QUERY_ATTR_JOBID; -jc[0].op = EDG_WLL_QUERY_OP_EQUAL; -if ( edg_wlc_JobIdParse( - "https://lhun.ics.muni.cz:9000/OirOgeWh_F9sfMZjnIPYhQ", - &jc[0].value.j) ) -{ - edg_wll_FreeContext(ctx); - exit(1); -} -jc[1].attr = EDG_WLL_QUERY_ATTR_UNDEF; -if (edg_wll_QueryJobs(ctx, jc, 0, NULL, &statesOut)) { - char *err_text,*err_desc; - - edg_wll_Error(ctx,&err_text,&err_desc); - fprintf(stderr,"QueryJobs: %s (%s)\n",err_text,err_desc); - free(err_text); - free(err_desc); -} -else { - print_jobs(statesOut); /* process the returned data */ - edg_wll_FreeStatus(statesOut); - free(statesOut); -} -edg_wlc_JobIdFree(jc[0].value.j); -edg_wll_FreeContext(ctx); diff --git a/org.glite.lb.client/examples/dg/util.c b/org.glite.lb.client/examples/dg/util.c deleted file mode 100644 index 73be67a..0000000 --- a/org.glite.lb.client/examples/dg/util.c +++ /dev/null @@ -1,54 +0,0 @@ - -#include -#include -#include -#include - -#include "client_headers.h" - - -int use_proxy = 0; - -void -print_jobs(edg_wll_JobStat *states) -{ - int i,j; - - for (i=0; states[i].state != EDG_WLL_JOB_UNDEF; i++) { - char *id = edg_wlc_JobIdUnparse(states[i].jobId); - char *st = edg_wll_StatToString(states[i].state); - - if (!states[i].parent_job) { - if (states[i].jobtype == EDG_WLL_STAT_SIMPLE) { - printf(" %s .... %s %s\n", id, st, (states[i].state==EDG_WLL_JOB_DONE) ? edg_wll_done_codeToString(states[i].done_code) : "" ); - } - else if ((states[i].jobtype == EDG_WLL_STAT_DAG) || - (states[i].jobtype == EDG_WLL_STAT_COLLECTION)) { - printf("%s %s .... %s %s\n", (states[i].jobtype==EDG_WLL_STAT_DAG)?"DAG ":"COLL",id, st, (states[i].state==EDG_WLL_JOB_DONE) ? edg_wll_done_codeToString(states[i].done_code) : ""); - for (j=0; states[j].state != EDG_WLL_JOB_UNDEF; j++) { - if (states[j].parent_job) { - char *par_id = edg_wlc_JobIdUnparse(states[j].parent_job); - - if (!strcmp(id,par_id)) { - char *sub_id = edg_wlc_JobIdUnparse(states[j].jobId), - *sub_st = edg_wll_StatToString(states[j].state); - - printf(" `- %s .... %s %s\n", sub_id, sub_st, (states[j].state==EDG_WLL_JOB_DONE) ? edg_wll_done_codeToString(states[j].done_code) : ""); - free(sub_id); - free(sub_st); - } - free(par_id); - } - } - } - } - - free(id); - free(st); - } - - printf("\nFound %d jobs\n",i); -} - - - -- 1.8.2.3