From 70693a85cb085019ab6d7d7029f4ad26425a5c69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Voc=C5=AF?= Date: Tue, 25 Mar 2008 16:57:59 +0000 Subject: [PATCH] include staged example code --- org.glite.lb.doc/Makefile | 4 +- org.glite.lb.doc/src/LBDG-Common.tex | 26 +++++++++++ org.glite.lb.doc/src/consumer_api.tex | 87 +++++++++++++++++++++-------------- 3 files changed, 81 insertions(+), 36 deletions(-) diff --git a/org.glite.lb.doc/Makefile b/org.glite.lb.doc/Makefile index 22c9ed6..6efdd62 100644 --- a/org.glite.lb.doc/Makefile +++ b/org.glite.lb.doc/Makefile @@ -10,7 +10,9 @@ PREFIX=/opt/glite -include Makefile.inc VPATH = ${top_srcdir}/src -KPATH = TEXINPUTS=".:$(VPATH)//:" +# example source code is part of the org.glite.lb.client +EXAMPLE_SOURCE_DIR=${stagedir}/share/doc/glite-lb-client-3.1.2/examples +KPATH = TEXINPUTS=".:$(EXAMPLE_SOURCE_DIR):$(VPATH)//:" KPATHBIB = BIBINPUTS=".:$(VPATH)//:" LATEX = $(KPATH) latex diff --git a/org.glite.lb.doc/src/LBDG-Common.tex b/org.glite.lb.doc/src/LBDG-Common.tex index 557103a..35272a9 100644 --- a/org.glite.lb.doc/src/LBDG-Common.tex +++ b/org.glite.lb.doc/src/LBDG-Common.tex @@ -1,4 +1,30 @@ \section{\LB\ Common} \TODO{Add the information about LB common - list of header files, important functions and data types and their description, etc.} +\subsection{Header files} +CountRef.h +Event.h.T +LoggingExceptions.h +authz.h +connpool.h +context-int.h +context.h +events.h.T +events\_parse.h +il\_msg.h +il\_string.h +jobstat.h.T +lb\_maildir.h +lb\_perftest.h +lb\_plain\_io.h +log\_proto.h +mini\_http.h +notif\_rec.h +notifid.h +padstruct.h +query\_rec.h +timeouts.h +ulm\_parse.h +xml\_conversions.h +xml\_parse.h diff --git a/org.glite.lb.doc/src/consumer_api.tex b/org.glite.lb.doc/src/consumer_api.tex index 9e1ea91..b00a663 100644 --- a/org.glite.lb.doc/src/consumer_api.tex +++ b/org.glite.lb.doc/src/consumer_api.tex @@ -17,6 +17,21 @@ capabilities. In the presented examples only the C \LB\ API (Sect.~\ref{query-C}) is considered. The C++ API (Sect.~\ref{query-CPP}) covers the same functionality. +\subsection{Header files} + +Job.h +JobStatus.h.T +Notification.h +ServerConnection.h +connection.h +consumer.h +notification.h +prod\_proto.h +producer.h.T +statistics.h + +\verbatiminput{client_headers.h} + \subsection{Returned results} \LB\ server returns errors which are classified as hard and soft errors. @@ -77,41 +92,43 @@ all the relevant structures and API calls to retrieve status information about a job with the ID\\ \texttt{https://lhun.ics.muni.cz:9000/OirOgeWh\_F9sfMZjnIPYhQ}. -\begin{verbatim} - #include - ... - 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 { - ... /* process the returned data */ - edg_wll_FreeStatus(statesOut); - free(statesOut); - } - edg_wlc_JobIdFree(jc[0].value.j); - edg_wll_FreeContext(ctx); -\end{verbatim} +\verbatiminput{example1_code.c} + +%\begin{verbatim} +% #include +% ... +% 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 { +% ... /* process the returned data */ +% edg_wll_FreeStatus(statesOut); +% free(statesOut); +% } +% edg_wlc_JobIdFree(jc[0].value.j); +% edg_wll_FreeContext(ctx); +%\end{verbatim} The first function call in this example initializes the \LB\ context\,---\,variable \texttt{ctx}\,---\,which is necessary for later use. The most important part -- 1.8.2.3