1
/*___INFO__MARK_BEGIN__*/
2
/*************************************************************************
4
* The Contents of this file are made available subject to the terms of
5
* the Sun Industry Standards Source License Version 1.2
7
* Sun Microsystems Inc., March, 2001
10
* Sun Industry Standards Source License Version 1.2
11
* =================================================
12
* The contents of this file are subject to the Sun Industry Standards
13
* Source License Version 1.2 (the "License"); You may not use this file
14
* except in compliance with the License. You may obtain a copy of the
15
* License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
17
* Software provided under this License is provided on an "AS IS" basis,
18
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
19
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
20
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
21
* See the License for the specific provisions governing your rights and
22
* obligations concerning the Software.
24
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
26
* Copyright: 2001 by Sun Microsystems, Inc.
28
* All Rights Reserved.
30
************************************************************************/
31
/*___INFO__MARK_END__*/
32
/* \begin{verbatim} */
35
#define __SGE_GDI_LIBRARY_HOME_OBJECT_FILE__
40
/* REMOTE MONITORING SUPPORT ? */
41
/* #define SGE_COMPILE_DEBUG */
44
/* THIS ARE ALL PUBLIC LIST LIB HEADERS, YOU'LL NEED IT */
47
/* include cull_whereP.h for WhereArg mechanism, example 7 */
48
#include "cull_whereP.h"
50
/* THIS ARE THE LIST STRUCTURE DEFINITIONS AND THE NAMESPACES */
53
#include "sge_stdio.h"
55
/* DIRECTORY CONTAINING DATA FILES */
58
/* CREATE SOME LISTS ( HOST, QUEUE, OWNER ) */
60
lList *buildHostList(void)
66
hostlist = lCreateList("hostlist", HostT);
69
Now we create elements, change their initial
70
values and append them to the list.
72
element = lCreateElem(HostT);
73
lSetHost(element, H_hostname, "balin");
74
lSetString(element, H_arch, "sun4");
75
lSetString(element, H_os, "SunOS 4.1.2");
76
lSetUlong(element, H_memsize, 16);
77
lAppendElem(hostlist, element);
79
element = lCreateElem(HostT);
80
lSetHost(element, H_hostname, "balin");
81
lSetString(element, H_arch, "sun4");
82
lSetString(element, H_os, "SunOS 4.1.2");
83
lSetUlong(element, H_memsize, 24);
84
lAppendElem(hostlist, element);
86
element = lCreateElem(HostT);
87
lSetHost(element, H_hostname, "legolas");
88
lSetString(element, H_arch, "alpha");
89
lSetString(element, H_os, "OSF/1 3.02");
90
lSetUlong(element, H_memsize, 64);
91
lAppendElem(hostlist, element);
93
element = lCreateElem(HostT);
94
lSetHost(element, H_hostname, "bilbo");
95
lSetString(element, H_arch, "sgi");
96
lSetString(element, H_os, "IRIX 4");
97
lSetUlong(element, H_memsize, 16);
98
lAppendElem(hostlist, element);
100
element = lCreateElem(HostT);
101
lSetHost(element, H_hostname, "sam");
102
lSetString(element, H_arch, "i386");
103
lSetString(element, H_os, "Linux");
104
lSetUlong(element, H_memsize, 128);
105
lAppendElem(hostlist, element);
110
lList *buildQueueList(void)
112
lList *queuelist = NULL;
115
queuelist = lCreateList("queuelist", QueueT);
118
Now we create elements, change their initial
119
values and append them to the list.
121
element = lCreateElem(QueueT);
122
lSetString(element, Q_name, "balin.q");
123
lSetHost(element, Q_hostname, "balin");
124
lSetInt(element, Q_load, 2);
126
The member Q_ownerlist is initialized with NULL,
127
no changes are needed right now.
129
lAppendElem(queuelist, element);
131
element = lCreateElem(QueueT);
132
lSetString(element, Q_name, "durin.q");
133
lSetHost(element, Q_hostname, "durin");
134
lSetInt(element, Q_load, 7);
135
lAppendElem(queuelist, element);
137
element = lCreateElem(QueueT);
138
lSetString(element, Q_name, "gloin.q");
139
lSetHost(element, Q_hostname, "gloin");
140
lSetInt(element, Q_load, 23);
141
lAppendElem(queuelist, element);
143
element = lCreateElem(QueueT);
144
lSetString(element, Q_name, "legolas.q");
145
lSetHost(element, Q_hostname, "legolas");
146
lSetInt(element, Q_load, 4);
147
lAppendElem(queuelist, element);
152
lList *buildOwnerListA(void)
154
lList *ownerlist = NULL;
157
ownerlist = lCreateList("ownerlistA", OwnerT);
159
owner = lCreateElem(OwnerT);
160
lSetString(owner, O_owner, "Anton");
161
lSetString(owner, O_group, "Tennis");
162
lAppendElem(ownerlist, owner);
164
owner = lCreateElem(OwnerT);
165
lSetString(owner, O_owner, "Berta");
166
lSetString(owner, O_group, "Basketball");
167
lAppendElem(ownerlist, owner);
172
lList *buildOwnerListB(void)
174
lList *ownerlist = NULL;
177
ownerlist = lCreateList("ownerlistB", OwnerT);
179
owner = lCreateElem(OwnerT);
180
lSetString(owner, O_owner, "Christian");
181
lSetString(owner, O_group, "Tennis");
182
lAppendElem(ownerlist, owner);
187
lList *buildOwnerListC(void)
189
lList *ownerlist = NULL;
192
ownerlist = lCreateList("ownerlistC", OwnerT);
194
owner = lCreateElem(OwnerT);
195
lSetString(owner, O_owner, "Anton");
196
lSetString(owner, O_group, "Golf");
197
lAppendElem(ownerlist, owner);
204
printf("example1 0\t Scenario: JOIN\n");
205
printf("example1 1\t Scenario: SELECT\n");
206
printf("example1 2\t Scenario: SELECTDESTROY\n");
207
printf("example1 3\t Scenario: SORT\n");
208
printf("example1 4\t Scenario: SELECTSUB\n");
209
printf("example1 5\t Scenario: JOINSUB\n");
210
printf("example1 6\t Scenario: CHANGE\n");
211
printf("example1 7\t Scenario: UNDUMP\n");
212
printf("example1 8\t Scenario: WHERE\n");
213
printf("example1 9\t Scenario: lNm2Str/lStr2Nm\n");
214
printf("example1 10\t Scenario: BITMASK\n");
215
printf("example1 11\t Scenario: SPLIT\n");
216
printf("example1 12\t Scenario: UNIQ\n");
217
printf("example1 13\t Scenario: COPYENUM\n");
218
printf("example1 14\t Scenario: REFERENCE\n");
223
/* for this monster see proto.h */
224
int main(int argc, char *argv[])
226
static char trala[] = "Doedel";
228
JOIN, SELECT, SELECTDESTROY, SORT, SELECTSUB, JOINSUB, CHANGE,
229
UNDUMP, WHEREARGS, NM2STR, BITMASK, SPLIT, UNIQ, COPYENUM, REFERENCE
234
lList *hostlist = NULL, *queuelist = NULL, *joinedlist = NULL, *joinedsublist = NULL,
235
*selectedlist = NULL, *ownerlist[3];
236
lList *unchained = NULL;
242
lCondition *where = NULL, *subwhere = NULL;
243
lCondition *where2 = NULL;
245
lEnumeration *what = NULL;
246
lEnumeration *what2 = NULL;
248
lEnumeration *allHostFields = NULL, *allQueueFields = NULL, *allOwnerFields = NULL;
250
/* monitoring macros */
251
DENTER_MAIN(TOP_LAYER, "example1");
253
/* WHICH SCENARIO SHALL I USE ? */
256
sscanf(argv[1], "%d", &scene);
258
/* INITIALIZE FIELDID TO FIELDNAME STRING CONVERSION */
259
lInit(nmv); /* nmv is the lNameSpace array address */
263
the what structures are typespecific,
264
even if we want all fields
266
allHostFields = lWhat("%T(ALL)", HostT);
267
allQueueFields = lWhat("%T(ALL)", QueueT);
268
allOwnerFields = lWhat("%T(ALL)", OwnerT);
274
JOIN TWO LISTS CONNECTED BY A COMMON JOINFIELD TO A NEW
275
LIST CONTAINING INFORMATION OF BOTH ORIGINAL LISTS
279
/* build a host- and a queuelist and write them to stdout */
280
hostlist = buildHostList();
281
printf("\n\nHOSTLIST\n\n");
282
lWriteListTo(hostlist, stdout);
284
queuelist = buildQueueList();
285
printf("\n\nQUEUELIST\n\n");
286
lWriteListTo(queuelist, stdout);
289
The lJoin() function gets normally two conditions and
290
two field enumerations to select the list elements and
291
the fields which will appear in the resulting list.
292
If we set a condition to NULL, this means that all elements
293
fulfilling the joincondition (here: H_hostname == Q_hostname)
295
With 'allHostFields' and 'allQueueFields' we get every field
296
of both lists (Normally you keep only one of the join fields
297
i.e. either Q_hostname or H_hostname)
300
joinedlist = lJoin("joinedList", H_hostname, hostlist, NULL, allHostFields, Q_hostname,
301
queuelist, NULL, allQueueFields);
303
/* print the result */
304
printf("\n\nJOINED LIST\ncommon fields are "
305
"H_hostname and Q_hostname\n\n");
306
lWriteListTo(joinedlist, stdout);
308
/* here we open a dump file to write the result to disk */
309
if (!(fp = fopen(DATA_DIR "dump.dmp", "w"))) {
310
printf("unable to open dump.dmp for write access\n");
313
if (lDumpList(fp, joinedlist, 0) == EOF) {
314
printf("unable to dump into dump.dmp\n");
323
WITH THE lSelect FUNCTION WE CAN EXTRACT THOSE
324
ELEMENTS OF A LIST THAT FULFILL A CERTAIN
325
CONDITION. THE CONDITION IS SPECIFIED IN A
326
where STRUCTURE AND HANDED OVER TO lSelect.
329
/* build a queuelist and write it to stdout */
330
queuelist = buildQueueList();
331
printf("\n\nQUEUELIST\n\n");
332
lWriteListTo(queuelist, stdout);
335
The where structure chooses certain rows and the
336
what structure certain columns, if we speak in terms of
338
The where structure is build by the lWhere function and the
339
what structure by the lWhat function.
340
With lWhat you select the fields to be kept in the
342
The syntax is explained in the manpages lWhere(3),lWhat(3).
343
In the following example the where structure states:
344
Get The elements from the queuelist that do not
345
fulfill the condition (Q_load < 12 and Q_Hostname != durin).
346
In the what structure we select the fields Q_load, Q_name,
347
Q_hostname from a list element of type QueueT.
349
where = lWhere("%T(!(%I < %d && %I != %s)) ", QueueT,
350
Q_load, 12, Q_hostname, "durin");
351
what = lWhat(" %T( %I %I %I )", QueueT, Q_load, Q_name, Q_hostname);
353
selectedlist = lSelect("selectedlist", queuelist, where, what);
359
/* Show the result */
360
printf("\n\nREDUCED SELECTED QUEUELIST\n"
361
"only the fields Q_load, Q_name"
362
"and Q_hostname are selected\n"
363
"condition for selection is NOT(Q_load < 12 && "
364
"Q_hostname != \"durin\")\n\n");
365
lWriteListTo(selectedlist, stdout);
371
WITH THE lSelect FUNCTION WE CAN EXTRACT THOSE
372
ELEMENTS OF A LIST THAT FULFILL A CERTAIN
373
CONDITION. THE CONDITION IS SPECIFIED IN A
374
where STRUCTURE AND HANDED OVER TO lSelect.
377
/* build a queuelist and write it to stdout */
378
queuelist = buildQueueList();
379
printf("\n\nQUEUELIST\n\n");
380
lWriteListTo(queuelist, stdout);
382
where = lWhere("%T(!(%I < %d && %I != %s)) ", QueueT,
383
Q_load, 12, Q_hostname, "durin");
385
if ((queuelist = lSelectDestroy(queuelist, where)))
386
printf("there is a list\n");
391
/* Show the result */
392
printf("\n\nREDUCED QUEUELIST\n"
394
"condition for selection is NOT(Q_load < 12 && "
395
"Q_hostname != \"durin\")\n\n");
396
lWriteListTo(queuelist, stdout);
402
THE lSort FUNCTION ALLOWS THE SORTING OF A LIST
405
/* create the list and write it to stdout */
406
hostlist = buildHostList();
407
printf("\n\nHOSTLIST\n\n");
408
lWriteListTo(hostlist, stdout);
411
Show the changed list ordered by H_memsize (- = descending)
412
After sorting the unsorted list no longer exists.
413
The lSortOrder formatstring specifies the keyfields as in lWhat
414
or lWhere with a minus/plus sign for ascending/descending sort
416
The leftmost sort criterion is the most important.
417
The following ones are weighted from left to right.
419
lPSortList(hostlist, "%I+%I-", H_hostname, H_memsize);
421
printf("\n\nHOSTLIST SORTED ASCENDING BY %s, DESCENDING BY %s\n\n",
422
lNm2Str(H_hostname), lNm2Str(H_memsize));
423
lWriteListTo(hostlist, stdout);
429
SELECT SPECIFYING CRITERIA FOR A SUBLIST
432
/* build and write the lists */
433
ownerlist[0] = buildOwnerListA();
434
ownerlist[1] = buildOwnerListB();
435
ownerlist[2] = buildOwnerListC();
436
/* Write the three ownerlists */
437
for (i = 0; i < 3; i++) {
438
printf("OWNERLIST %c\n", 'A' + i);
439
lWriteListTo(ownerlist[i], stdout);
442
queuelist = buildQueueList();
443
printf("\n\nORIGINAL QUEUELIST WITHOUT OWNERLISTS\n\n");
444
lWriteListTo(queuelist, stdout);
446
Change the queuelist.ownerlist field where
447
Q_hostname == "gloin" (first matching element only)
449
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "gloin");
450
element = lFindFirst(queuelist, where);
451
lSetList(element, Q_ownerlist, lCopyList("ownerlist0",
456
Change the queuelist.ownerlist field where
457
Q_hostname == "legolas" (first matching element only)
459
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "legolas");
460
element = lFindFirst(queuelist, where);
461
lSetList(element, Q_ownerlist, lCopyList("ownerlist1",
466
Change the queuelist.ownerlist field where
467
Q_hostname == "durin" (first matching element only)
469
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "durin");
470
element = lFindFirst(queuelist, where);
471
lSetList(element, Q_ownerlist, lCopyList("ownerlist2",
475
printf("\n\nQUEUELIST WITH OWNERLISTS\n\n");
476
lWriteListTo(queuelist, stdout);
478
Select the elements which contain in the owner sublist
482
where = lWhere("%T(!(%I == %s) || %I != %s && %I -> %T(%I == %s))",
483
QueueT, Q_hostname, "legolas", Q_hostname, "gloin",
484
Q_ownerlist, OwnerT, O_owner, "Anton");
486
where = lWhere("%T( %I -> %T(%I == %s))",
487
QueueT, Q_ownerlist, OwnerT, O_owner, "Anton");
488
what = lWhat("%T(ALL)", QueueT);
490
selectedlist = lSelect("selectedlist", queuelist, where, what);
492
printf("\n\nQUEUELIST ELEMENTS WHERE:\n");
493
lWriteWhereTo(where, stdout);
495
lWriteListTo(selectedlist, stdout);
501
/* dump the resulting list to file */
502
if (!(fp = fopen(DATA_DIR "dump.dmp", "w"))) {
503
printf("unable to open dump.dmp for write access\n");
506
if (lDumpList(fp, selectedlist, 0) == EOF) {
507
printf("unable to dump into dump.dmp\n");
516
JOIN A LIST WITH ONE OF ITS SUBLISTS, THIS GENERATES
517
ADDITIONAL ELEMENTS IN THE MAIN LIST BUT THE SUBLIST
518
CAN BE REMOVED. SO THE DEPTH OF A LIST STRUCTURE IS
520
CONDITIONS CAN BE SPECIFIED FOR THE MAIN AND THE
524
/* build the lists and write them */
525
ownerlist[0] = buildOwnerListA();
526
ownerlist[1] = buildOwnerListB();
527
ownerlist[2] = buildOwnerListC();
528
/* Write the three ownerlists */
529
for (i = 0; i < 3; i++) {
530
printf("OWNERLIST %c\n", 'A' + i);
531
lWriteListTo(ownerlist[i], stdout);
533
queuelist = buildQueueList();
534
printf("\n\nORIGINAL QUEUELIST WITHOUT OWNERLISTS\n\n");
535
lWriteListTo(queuelist, stdout);
537
Change the queuelist.ownerlist field where
538
Q_hostname == "gloin"
540
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "gloin");
541
element = lFindFirst(queuelist, where);
542
lSetList(element, Q_ownerlist, lCopyList("ownerlist0",
546
Change the queuelist.ownerlist field where
547
Q_hostname == "legolas"
549
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "legolas");
550
element = lFindFirst(queuelist, where);
551
lSetList(element, Q_ownerlist, lCopyList("ownerlist1",
555
Change the queuelist.ownerlist field where
556
Q_hostname == "durin"
558
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "durin");
559
element = lFindFirst(queuelist, where);
560
lSetList(element, Q_ownerlist, lCopyList("ownerlist2",
565
Select the elements which contain in the ownerlist
568
printf("\n\nQUEUELIST WITH OWNERLISTS\n\n");
569
lWriteListTo(queuelist, stdout);
571
if (!(where = lWhere("%T(%I->%T(%I == %s))", QueueT, Q_ownerlist,
572
OwnerT, O_owner, "Anton"))) {
573
printf("lWhere failure\n");
576
if (!(subwhere = lWhere("%T(%I == %s)", OwnerT, O_owner, "Anton"))) {
577
printf("lWhere failure\n");
580
/* Q_ownerlist is removed, so we have a flat list */
581
if (!(what = lWhat("%T( %I %I %I )", QueueT, Q_name, Q_hostname, Q_load))) {
582
printf("lWhat failure\n");
586
joinedsublist = lJoinSublist("joinedsublist", Q_ownerlist,
587
queuelist, where, what,
588
OwnerT, subwhere, allOwnerFields);
590
printf("\n\nQUEUELIST JOINED WITH SUBLIST OWNERLIST\n");
593
lWriteListTo(joinedsublist, stdout);
597
lFreeWhere(&subwhere);
604
CHANGE THE VALUES OF LIST ELEMENT FIELDS
607
/* build lists and show them */
608
hostlist = buildHostList();
609
printf("\n\nHOSTLIST\n\n");
610
lWriteListTo(hostlist, stdout);
612
if (!(where = lWhere("%T( %I == %s )", HostT, H_os,
614
printf("lWhere failure\n");
618
/* Change every element containing H_os = 'SunOS 4.1.2' */
619
for_each_where(element, hostlist, where)
620
lSetString(element, H_os, "SunOS 4.2.1");
625
printf("\n\nCHANGED HOSTLIST\n"
626
"H_os changed from SunOS 4.1.2 to SunOS 4.2.1\n\n");
627
lWriteListTo(hostlist, stdout);
633
GET A DUMPED LIST FROM DISK BACK INTO MEMORY
634
IT IS POSSIBLE TO SPECIFY A NEW DESCRIPTOR,
635
IF THE DIFFERENCES ARE NOT ACCEPTABLE THE
636
FUNCTION FAILS OTHERWISE WARNINGS ARE DISPLAYED
638
/* open dump file and read information */
639
fp = fopen(DATA_DIR "dump.dmp", "r");
640
joinedlist = lUndumpList(fp, NULL, NULL /*QueueT */ );
643
/* show the undumped list */
644
lWriteListTo(joinedlist, stdout);
650
/* build a queuelist and write it to stdout */
651
queuelist = buildQueueList();
652
/* build the lists and write them */
653
ownerlist[0] = buildOwnerListA();
654
ownerlist[1] = buildOwnerListB();
655
ownerlist[2] = buildOwnerListC();
657
Change the queuelist.ownerlist field where
658
Q_hostname == "gloin"
660
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "gloin");
661
element = lFindFirst(queuelist, where);
662
lSetList(element, Q_ownerlist, lCopyList("ownerlist0",
666
Change the queuelist.ownerlist field where
667
Q_hostname == "legolas"
669
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "legolas");
670
element = lFindFirst(queuelist, where);
671
lSetList(element, Q_ownerlist, lCopyList("ownerlist1",
675
Change the queuelist.ownerlist field where
676
Q_hostname == "durin"
678
where = lWhere("%T(%I == %s)", QueueT, Q_hostname, "durin");
679
element = lFindFirst(queuelist, where);
680
lSetList(element, Q_ownerlist, lCopyList("ownerlist2",
685
Select the elements which contain in the ownerlist
688
printf("\n\nQUEUELIST WITH OWNERLISTS\n\n");
689
lWriteListTo(queuelist, stdout);
690
where = lWhere("%T(%I -> %T(%I == %s)) ", QueueT, Q_ownerlist, OwnerT,
692
what = lWhat(" %T( %I %I %I %I)", QueueT, Q_load, Q_name, Q_hostname,
695
selectedlist = lSelect("selectedlist", queuelist, where, what);
701
/* Show the result */
702
printf("SELECTED LIST\n\n");
703
lWriteListTo(selectedlist, stdout);
709
cp = lNm2Str(Q_name);
710
printf("Worked ok cp = %s, Q_name %d == lStr2Nm %d\n",
711
cp, Q_name, lStr2Nm(cp));
712
i = lStr2Nm("Q_complexname");
713
printf("Nr.: %d Name: %s\n", i, lNm2Str(i));
717
queuelist = buildQueueList();
719
for_each(element, queuelist) {
722
lSetUlong(element, Q_status, 3);
724
lSetUlong(element, Q_status, 5);
726
where = lWhere("%T(!(%I m= %u))", QueueT,
728
what = lWhat(" %T( %I %I %I %I %I)", QueueT, Q_load, Q_status, Q_name, Q_hostname,
730
selectedlist = lSelect("selectedlist", queuelist, where, what);
736
/* Show the result */
737
lWriteListTo(queuelist, stdout);
738
printf("BITMASK LIST\n\n");
739
lWriteListTo(selectedlist, stdout);
744
queuelist = buildQueueList();
745
where = lWhere("%T(!(%I < %d && %I != %s)) ", QueueT, Q_load, 12, Q_hostname, "durin");
747
printf("Condition is:\n");
748
printf("Vor Split\n");
749
lWriteListTo(queuelist, stdout);
751
if (lSplit(&queuelist, &unchained, "Unchained", where) == -1) {
752
printf("lSplit failed\n");
756
printf("Nach Split\n");
757
lWriteListTo(queuelist, stdout);
758
lWriteListTo(unchained, stdout);
763
hostlist = buildHostList();
764
lWriteListTo(hostlist, stdout);
765
lUniqHost(hostlist, H_hostname);
766
lWriteListTo(hostlist, stdout);
770
queuelist = buildQueueList();
771
where = lWhere("%T(!(%I < %d && %I != %s)) ", QueueT, Q_load, 12, Q_hostname, "durin");
773
what = lWhat("%T(%I %I)", QueueT, Q_hostname, Q_load);
775
printf("Condition is:\n");
776
lWriteWhereTo(where, stdout);
777
printf("Condition copied is:\n");
778
where2 = lCopyWhere(where);
779
lWriteWhereTo(where2, stdout);
782
printf("Condition is:\n");
783
lWriteWhereTo(where, stdout);
784
printf("Condition copied is:\n");
785
where2 = lCopyWhere(where);
786
lWriteWhereTo(where2, stdout);
788
printf("Enumeration is:\n");
789
lWriteWhatTo(what, stdout);
790
printf("Enumeration copied is:\n");
791
what2 = lCopyWhat(what);
792
lWriteWhatTo(what2, stdout);
795
what = lWhat("%T(ALL)", QueueT);
796
printf("Enumeration is:\n");
797
lWriteWhatTo(what, stdout);
798
printf("Enumeration copied is:\n");
799
what2 = lCopyWhat(what);
800
lWriteWhatTo(what2, stdout);
805
queuelist = buildQueueList();
807
for_each(element, queuelist) {
808
lSetRef(element, Q_ref, &trala[i++]);
810
lWriteListTo(queuelist, stdout);
811
lFreeList(&queuelist);
816
printf("Not allowed\n");
819
/* clean the house */
821
lFreeList(&hostlist);
823
lFreeList(&queuelist);
825
lFreeList(&joinedlist);
827
lFreeList(&selectedlist);
830
lFreeWhat(&allHostFields);
832
lFreeWhat(&allQueueFields);
834
lFreeWhat(&allOwnerFields);