-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource.c
More file actions
2557 lines (2223 loc) · 98.8 KB
/
source.c
File metadata and controls
2557 lines (2223 loc) · 98.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Result Sets Interface */
#ifndef SQL_CRSR
# define SQL_CRSR
struct sql_cursor
{
unsigned int curocn;
void *ptr1;
void *ptr2;
unsigned long magic;
};
typedef struct sql_cursor sql_cursor;
typedef struct sql_cursor SQL_CURSOR;
#endif /* SQL_CRSR */
/* Thread Safety */
typedef void * sql_context;
typedef void * SQL_CONTEXT;
/* Object support */
struct sqltvn
{
unsigned char *tvnvsn;
unsigned short tvnvsnl;
unsigned char *tvnnm;
unsigned short tvnnml;
unsigned char *tvnsnm;
unsigned short tvnsnml;
};
typedef struct sqltvn sqltvn;
struct sqladts
{
unsigned int adtvsn;
unsigned short adtmode;
unsigned short adtnum;
sqltvn adttvn[1];
};
typedef struct sqladts sqladts;
static struct sqladts sqladt = {
1,1,0,
};
/* Binding to PL/SQL Records */
struct sqltdss
{
unsigned int tdsvsn;
unsigned short tdsnum;
unsigned char *tdsval[1];
};
typedef struct sqltdss sqltdss;
static struct sqltdss sqltds =
{
1,
0,
};
/* File name & Package Name */
struct sqlcxp
{
unsigned short fillen;
char filnam[43];
};
static const struct sqlcxp sqlfpn =
{
42,
"J:\\V34\\AsterSrv\\projets\\exploit\\exploit.pc"
};
static unsigned long sqlctx = 552030293;
static struct sqlexd {
unsigned int sqlvsn;
unsigned int arrsiz;
unsigned int iters;
unsigned int offset;
unsigned short selerr;
unsigned short sqlety;
unsigned int occurs;
const short *cud;
unsigned char *sqlest;
const char *stmt;
sqladts *sqladtp;
sqltdss *sqltdsp;
void **sqphsv;
unsigned int *sqphsl;
int *sqphss;
void **sqpind;
int *sqpins;
unsigned int *sqparm;
unsigned int **sqparc;
unsigned short *sqpadto;
unsigned short *sqptdso;
void *sqhstv[18];
unsigned int sqhstl[18];
int sqhsts[18];
void *sqindv[18];
int sqinds[18];
unsigned int sqharm[18];
unsigned int *sqharc[18];
unsigned short sqadto[18];
unsigned short sqtdso[18];
} sqlstm = {10,18};
/* SQLLIB Prototypes */
extern void sqlcxt (void **, unsigned long *,
struct sqlexd *, const struct sqlcxp *);
extern void sqlcx2t(void **, unsigned long *,
struct sqlexd *, const struct sqlcxp *);
extern void sqlbuft(void **, char *);
extern void sqlgs2t(void **, char *);
extern void sqlorat(void **, unsigned long *, void *);
/* Forms Interface */
static const int IAPSUCC = 0;
static const int IAPFAIL = 1403;
static const int IAPFTL = 535;
extern void sqliem(char *, int *);
static const char *sq0001 =
"select numtrt ,nomprog ,(('\\\"'||replace(libprog,'''','\\\\\\'''))||'\\\"')\
,libprog ,type ,media_edt ,nvl(dir_prog,' ') ,nvl(dir_edt,' ') ,nvl(dir_dem,'\
') ,nvl(replace(destinataire,' ','-'),' ') ,nvl(imprimante,' ') ,nvl(orientat\
ion,' ') ,nvl(copies,1) ,nvl(cod_format,'XX') ,nvl(recto_verso,'X') ,nvl(sens_\
rv,'X') ,nvl(bac,'X') ,uti_cre from b_traitement where (code_fin='P' and natu\
re='E') order by numtrt ";
static const char *sq0004 =
"select b_paramtrt.nomparam ,NVL(b_paramtrt.param,DECODE(:b0,'B','\"\"',' '))\
from b_paramtrt where b_paramtrt.numtrt=:b1 order by b_paramtrt.indpar \
";
static const char *sq0005 =
"select b_batch.nomprog ,b_batch.libprog ,b_batch.type ,nvl(b_batch.dir_prog,\
' ') ,rc_declenche.num_ordre ,b_batch.media_edt ,nvl(b_batch.dir_edt,' ') ,nvl\
(b_batch.dir_dem,' ') ,nvl(b_batch.imprimante,' ') ,nvl(b_batch.orientation,' \
') ,nvl(b_batch.cod_format,'XX') ,nvl(b_batch.recto_verso,'X') ,nvl(b_batch.se\
ns_rv,'X') ,nvl(b_batch.bac,'X') from b_batch ,rc_declenche ,sh_fonction wher\
e (((sh_fonction.cod_role=b_batch.nomprog and rc_declenche.ide_fct=sh_fonction\
.ide_fct) and rc_declenche.num_ordre>:b0) and rc_declenche.ide_chaine=:b1) ord\
er by rc_declenche.num_ordre ";
static const char *sq0007 =
"select b_parambat.nomparam ,NVL(b_paramtrt.param,DECODE(:b0,'B','\"\"',' '))\
from b_paramtrt ,b_parambat where ((b_paramtrt.nomparam(+)=b_parambat.nompar\
am and b_parambat.nomprog=:b1) and b_paramtrt.numtrt(+)=:b2) order by b_paramb\
at.indparlib ";
typedef struct { unsigned short len; unsigned char arr[1]; } VARCHAR;
typedef struct { unsigned short len; unsigned char arr[1]; } varchar;
/* cud (compilation unit data) array */
static const short sqlcud0[] =
{10,4130,0,0,0,
5,0,0,1,416,0,9,521,0,0,0,0,0,1,0,
20,0,0,1,0,0,13,537,0,0,18,0,0,1,0,2,3,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,
0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,
9,0,0,2,9,0,0,2,9,0,0,
107,0,0,1,0,0,15,640,0,0,0,0,0,1,0,
122,0,0,2,70,0,4,696,0,0,2,1,0,1,0,2,3,0,0,1,3,0,0,
145,0,0,3,71,0,4,710,0,0,2,1,0,1,0,2,3,0,0,1,9,0,0,
168,0,0,4,158,0,9,807,0,0,2,2,0,1,0,1,9,0,0,1,3,0,0,
191,0,0,4,0,0,13,820,0,0,2,0,0,1,0,2,9,0,0,2,9,0,0,
214,0,0,4,0,0,15,842,0,0,0,0,0,1,0,
229,0,0,5,584,0,9,954,0,0,2,2,0,1,0,1,3,0,0,1,9,0,0,
252,0,0,5,0,0,13,969,0,0,14,0,0,1,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,3,0,0,2,
9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,2,9,0,0,
323,0,0,5,0,0,15,1045,0,0,0,0,0,1,0,
338,0,0,5,584,0,9,1059,0,0,2,2,0,1,0,1,3,0,0,1,9,0,0,
361,0,0,6,71,0,4,1074,0,0,2,1,0,1,0,2,3,0,0,1,9,0,0,
384,0,0,5,0,0,15,1097,0,0,0,0,0,1,0,
399,0,0,7,254,0,9,1294,0,0,3,3,0,1,0,1,9,0,0,1,9,0,0,1,68,0,0,
426,0,0,7,0,0,13,1308,0,0,2,0,0,1,0,2,9,0,0,2,9,0,0,
449,0,0,7,0,0,15,1325,0,0,0,0,0,1,0,
};
/*
---------------------------------------------------------------------------
Fichier : exploit.pc
Auteur : B. BERKOVITCH (Sema)
Date creation : 29/12/99
---------------------------------------------------------------------------
Version : @(#) exploit version 2.1-1.4
---------------------------------------------------------------------------
Auteur : BBE
Version : @(#) exploit version 1.0-1.0 : BBE : 29/12/1999
Date version : 29/12/99
Description : Lancement des traitements postes (de type chaine de
traitements ou de type traitement simple)
---------------------------------------------------------------------------
Auteur : SNE
Version : @(#) exploit version 1.0-1.1 : SNE : 08/08/2000
Date modif : 03/07/2000
Description : CHG_BASE01 : Mise a niveau (evol. modele physique
Date modif : 08/08/2000
Description : CHG_RECUR : Ajout de la possibilite de lancer un traitemen
de type 'chaine' dans une chaine de traitement (recursion)
---------------------------------------------------------------------------
Auteur : SNE
Version : @(#) exploit version 2.0-1.2 : SNE : 13/12/2000
Date modif : 13/12/2000
Description : CHG_BASE01 : Bug : utilisation des caracteristiques de chaque traitement d'une chaine
---------------------------------------------------------------------------
Parametres d'entree:
- fichier log : path absolu du fichier log general
- instance : nom de l'instance
- user : compte oracle pour acces a la base
- fichier password : fichier contenant le password du compte oracle
- repertoire log : repertoire des fichiers log de chaine
- indicateur de lancement des scripts de debut et fin:
= D lancement du script de Debut uniquemen
= F lancement du script de FIn uniquemen
= A lancement d'Aucun scrip
= T lancement de Tous les scripts
- repertoire local : repertoire de l'executable et des shell de lancemen
Historique :
--------------------------------------------------------------------
Fonction |version |Date |Initiales |Commentaires
--------------------------------------------------------------------
@(#) exploit_batch |1.0-1.0 |29/12/1999 | BBE | Creation
@(#) exploit_batch |2.0-1.1 |03/07/2000 | SNE | Mise a niveau (evol. base)
@(#) exploit_batch |2.0-1.2 |08/08/2000 | SNE | evol.- lancemt chaines (CHG_RECUR)
@(#) exploit_batch |2.0-1.2 |08/08/2000 | SNE | evol.- lancemt chaines (CHG_RECUR)
@(#) exploit_batch |2.0-1.3 |13/12/2000 | SNE | utilisation des caracteristiques de chaque traitement d'une chaine
@(#) exploit_batch |2.1-1.4 |18/10/2001 | SNE | Maj msg d'information sur la syntaxe
@(#) exploit_batch |3.0-1.0 |08/04/2002 | NDY | Ajout creation-suppression de variables globales de traitement (date systeme, niveau de trace)
---------------------------------------------------------------------------
*/
/* Les fichiers inclus */
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include "../commun/commun.h"
#include "../commun/combase.h"
#define EXPLOIT_NOM_PROGRAMME "EXPLOIT"
#define EXPLOIT_LIB_PROGRAMME EXPLOIT_NOM_PROGRAMME " - lanceur des traitement de nuit"
#define EXPLOIT_VERSION_FICHIER "1.4"
#define EXPLOIT_NOM_CODIQUE_PROG "exploit"
#define EXPLOIT_CAR_DLIMITR_CHAINE '\''
#define EXPLOIT_STR_DLIMITR_CHAINE "\'\0"
/*
====================================================================
SNE, Definition des variables de fonciguration utilisees par exploit
====================================================================
*/
#define EXPLOIT_VAR_FIC_UTIL COMMUN_VAR_FIC_UTIL
#define EXPLOIT_VAR_REP_LOCAL COMMUN_VAR_BATCH
#define EXPLOIT_VAR_REP_LOG COMMUN_VAR_BATCH_LOG
#define EXPLOIT_VAR_FIC_LOG "EXPLOIT_LOG"
#define EXPLOIT_VAR_IDLANC_DFLT "EXPLOIT_LANCER"
#define EXPLOIT_VAR_EXPLOIT_DEB "EXPLOIT_DEB"
#define EXPLOIT_VAR_EXPLOIT_FIN "EXPLOIT_FIN"
#define EXPLOIT_COD_CODIF_ORIENT "ORIENTATION"
/*
====================================================================
SNE, 08/08/2000 : Adaptations : constantes et variables utilitaires
====================================================================
*/
#define EXPLOIT_OK OK
#define EXPLOIT_AVERTISSEMENT 1
#define EXPLOIT_ERREUR_APPLICATIVE 2
#define EXPLOIT_ERREUR_GRAVE KO
#define EXPLOIT_LG_NOMPROG 21
#define EXPLOIT_LG_LIBPROG 51
#define EXPLOIT_LG_TYPE 2
#define EXPLOIT_LG_DIR_PROG 61
#define EXPLOIT_LG_NOM_FICHIER 256
#define EXPLOIT_PAR_GEN_PREFIXE 0
#define EXPLOIT_PAR_GEN_SUFFIXE 1
#define EXPLOIT_BATC_CHAINE_TRT "C"
#define EXPLOIT_IND_LANCE_SCRIPT_DEB "D"
#define EXPLOIT_IND_LANCE_SCRIPT_FIN "F"
#define EXPLOIT_IND_LANCE_AUCUN_SCRP "A"
#define EXPLOIT_IND_LANCE_TOUS_SCRP "T"
#define EXPLOIT_PARAM_FIC_CFG 1
#define EXPLOIT_PARAM_INSTANCE 2
#define EXPLOIT_PARAM_COD_UTIL 3
#define EXPLOIT_PARAM_IND_LANCE 4
#define EXPLOIT_PARAM_FIC_LOG 5
#define EXPLOIT_PARAM_FIC_UTIL 6
#define EXPLOIT_PARAM_REP_LOG 7
#define EXPLOIT_PARAM_REP_LOCAL 8
#define EXPLOIT_PARAM_FIC_ERR 9
#define EXPLOIT_PARAM_NIV_DEBUG 10
#define EXPLOIT_NBRE_PARAM_MIN EXPLOIT_PARAM_IND_LANCE
#define EXPLOIT_NBRE_PARAM_MAX EXPLOIT_PARAM_NIV_DEBUG
#define EXPLOIT_MSG_ERR_SYNTAXE " %s <fichier cfg> <instance> <utilisateur> <indic. traitement> [<nom fic. log>] [<fichier utilisateurs>] [<rep. log>] [<rep. executables batch>] [<fichier erreur>] [<niveau trace>]==> niveau de gravite 5\n"
#define EXPLOIT_MSG_ERR_VAR_ENV COMMUN_MSG_ERR_VAR_ENV
#define EXPLOIT_INF_DEMARRAGE 736
#define EXPLOIT_INF_LANCE 736
#define EXPLOIT_VAR_DATE_SYSTEME "DATE_SYSTEME_VAR"
#define EXPLOIT_VAR_P_DAT_SYS "P_DAT_SYS"
#define EXPLOIT_VAR_DATE_SYS_VAL CBASE_VAR_DATE_SYS_VAL
#define EXPLOIT_VAR_NIVEAU_TRACE "NIVEAU_TRACE_VAR"
#define EXPLOIT_VAR_P_NIV_TRACE "P_NIV_TRACE"
/* EXEC SQL INCLUDE sqlca;
*/
/*
* $Header: \Referentiel/aster v430x/distrib_poste/distribution/AsterSrv/projets/exploit/exploit.c,v 1.1 2010/02/02 08:52:58 ilaronde-cp Exp $ sqlca.h
*/
/* Copyright (c) 1985,1986, 1998 by Oracle Corporation. */
/*
NAME
SQLCA : SQL Communications Area.
FUNCTION
Contains no code. Oracle fills in the SQLCA with status info
during the execution of a SQL stmt.
NOTES
**************************************************************
*** ***
*** This file is SOSD. Porters must change the data types ***
*** appropriately on their platform. See notes/pcport.doc ***
*** for more information. ***
*** ***
**************************************************************
If the symbol SQLCA_STORAGE_CLASS is defined, then the SQLCA
will be defined to have this storage class. For example:
#define SQLCA_STORAGE_CLASS extern
will define the SQLCA as an extern.
If the symbol SQLCA_INIT is defined, then the SQLCA will be
statically initialized. Although this is not necessary in order
to use the SQLCA, it is a good pgming practice not to have
unitialized variables. However, some C compilers/OS's don't
allow automatic variables to be init'd in this manner. Therefore,
if you are INCLUDE'ing the SQLCA in a place where it would be
an automatic AND your C compiler/OS doesn't allow this style
of initialization, then SQLCA_INIT should be left undefined --
all others can define SQLCA_INIT if they wish.
If the symbol SQLCA_NONE is defined, then the SQLCA variable will
not be defined at all. The symbol SQLCA_NONE should not be defined
in source modules that have embedded SQL. However, source modules
that have no embedded SQL, but need to manipulate a sqlca struct
passed in as a parameter, can set the SQLCA_NONE symbol to avoid
creation of an extraneous sqlca variable.
MODIFIED
lvbcheng 07/31/98 - long to int
jbasu 12/12/94 - Bug 217878: note this is an SOSD file
losborne 08/11/92 - No sqlca var if SQLCA_NONE macro set
Clare 12/06/84 - Ch SQLCA to not be an extern.
Clare 10/21/85 - Add initialization.
Bradbury 01/05/86 - Only initialize when SQLCA_INIT set
Clare 06/12/86 - Add SQLCA_STORAGE_CLASS option.
*/
#ifndef SQLCA
#define SQLCA 1
struct sqlca
{
/* ub1 */ char sqlcaid[8];
/* b4 */ int sqlabc;
/* b4 */ int sqlcode;
struct
{
/* ub2 */ unsigned short sqlerrml;
/* ub1 */ char sqlerrmc[70];
} sqlerrm;
/* ub1 */ char sqlerrp[8];
/* b4 */ int sqlerrd[6];
/* ub1 */ char sqlwarn[8];
/* ub1 */ char sqlext[8];
};
#ifndef SQLCA_NONE
#ifdef SQLCA_STORAGE_CLASS
SQLCA_STORAGE_CLASS struct sqlca sqlca
#else
struct sqlca sqlca
#endif
#ifdef SQLCA_INIT
= {
{'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '},
sizeof(struct sqlca),
0,
{ 0, {0}},
{'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '},
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0}
}
#endif
;
#endif
#endif
/* end SQLCA */
typedef struct enr_b_traitement{
int numtrt;
char *nomprog;
char *libprog1;
char *libprog2;
char *type;
char *media_edt;
char *dir_prog;
char *dir_edt;
char *dir_dem;
char *destinataire;
char *imprimante;
char *orientation;
char *copies;
char *cod_format;
char *recto_verso;
char *sens_rv;
char *bac;
char *uti_maj;
} t_EXPLOIT_enr_b_traitement;
static char exploit_version_fichier[]="@(#) " EXPLOIT_LIB_PROGRAMME " version "COMMUN_VERSION_ASTER"-"EXPLOIT_VERSION_FICHIER" - "__DATE__ " "__TIME__;
/*
====================================================================
SNE, Declaration des variables globales (hors variables hotes SQL)
====================================================================
*/
char exploit_log[EXPLOIT_LG_NOM_FICHIER];
char exploit_fic_log[EXPLOIT_LG_NOM_FICHIER];
char exploit_fichier_utilisateur[EXPLOIT_LG_NOM_FICHIER];
char exploit_fic_exec[EXPLOIT_LG_NOM_FICHIER];
char exploit_script_deb[EXPLOIT_LG_NOM_FICHIER];
char exploit_script_fin[EXPLOIT_LG_NOM_FICHIER];
char exploit_rep_log[EXPLOIT_LG_NOM_FICHIER]
, exploit_rep_tmp[EXPLOIT_LG_NOM_FICHIER]
, exploit_separateur_chemin[5]
, exploit_rep_log[EXPLOIT_LG_NOM_FICHIER]
, exploit_tmp[1000];
;
char exploit_rep_local[EXPLOIT_LG_NOM_FICHIER];
char exploit_instance[COMMUN_LG_NOM_INSTANCE];
char exploit_user[41];
char exploit_dat_systeme[21] = "DD/MM/YYYY HH:MI:SS\0";
char exploit_dernier_message[COMMUN_LG_LIBL_ERR];
int exploit_retour;
COMMUN_t_contexte_exec exploit_ctx_exec;
/* fonction */
/* SNE, 08/08/2000 : Adaptations : Fonctions */
int EXPLOIT_intRechParam(t_EXPLOIT_enr_b_traitement *p_enreg, char *p_param);
int EXPLOIT_intTraiterChaine(t_EXPLOIT_enr_b_traitement *p_enreg, char *p_fic_log);
int EXPLOIT_intRechParamfct(char *p_ligne_cmd, t_EXPLOIT_enr_b_traitement *p_enreg);
int EXPLOIT_traiter_taches(void);
int EXPLOIT_traiter_une_tache(t_EXPLOIT_enr_b_traitement *p_enreg, char *p_fic_log);
int EXPLOIT_parametres_generaux(t_EXPLOIT_enr_b_traitement *p_enreg, char *p_ligne_cmd, char *p_fic_log, int p_nbparam, int p_partie);
void EXPLOIT_formatte_param_trt(char *p_ligne_cmd, char *p_nom_param, char *p_val_param, t_EXPLOIT_enr_b_traitement *p_enreg);
/*
====================================================================================
Nom : EXPLOIT_fin_prg
Description : Cloture du traitement d'exploit
Auteur : Sofiane NEKERE
Date creation: 15/02/2001
retour :
Aucun
Historique :
---------------------------------------------------------------------------
Fonction |Date |Initiales |Commentaires
---------------------------------------------------------------------------
@(#) EXPLOIT_fin_prg |29/02/2001 | SNE | Creation (@fonction)
====================================================================================
*/
void EXPLOIT_fin_prg(int status)
{
COMMUN_Date_du_jour(COMMUN_FRMT_EXT_F_LOG, exploit_dat_systeme);
sprintf(exploit_log, "%s_%s.log", exploit_fic_log, exploit_dat_systeme);
COMMUN_close_log(exploit_fic_log);
/*--------------------------*/
/* renommage du fichier log */
/*--------------------------*/
if (COMMUN_existe_fichier(exploit_fic_log) == COMMUN_CODE_FICHIER_EXISTANT) rename(exploit_fic_log, exploit_log);
if (CBASE_deconnexion_base(OK) != OK)
{
exit(KO);
}
exit(status);
}
/*
====================================================================================
Nom : main
Description : Programme principal
Auteur : Sofiane NEKERE
Date creation: 15/02/2001
retour :
Aucun
Historique :
---------------------------------------------------------------------------
Fonction |Date |Initiales |Commentaires
---------------------------------------------------------------------------
@(#) EXPLOIT_fin_prg |29/02/2001 | SNE | Creation (@fonction)
====================================================================================
*/
main(argc,argv)
int argc;
char *argv[];
{
char v_indlanc[2];
char exploit_rep_local[EXPLOIT_LG_NOM_FICHIER];
char v_nivdebug[2]="\0";
/*------------------------*/
/* Analyse des parametres */
/*------------------------*/
memset(&exploit_ctx_exec, 0, sizeof(COMMUN_t_contexte_exec));
memset(exploit_dernier_message, 0, COMMUN_LG_LIBL_ERR);
strcpy(exploit_ctx_exec.nom_programme, argv[0]);
if ( argc < EXPLOIT_NBRE_PARAM_MIN || argc > EXPLOIT_NBRE_PARAM_MAX+1 ) {
COMMUN_ecrit_log_var(COMMUN_BALISE_INFORMATIVE, "\n%s\n" , exploit_version_fichier+4);
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_SYNTAXE, *argv);
EXPLOIT_fin_prg(KO);
}
strcpy(exploit_ctx_exec.fichier_config, argv[EXPLOIT_PARAM_FIC_CFG]);
strcpy(exploit_instance, argv[EXPLOIT_PARAM_INSTANCE]);
strcpy(exploit_user, argv[EXPLOIT_PARAM_COD_UTIL]);
if (argc > EXPLOIT_PARAM_IND_LANCE)
strcpy(v_indlanc,argv[EXPLOIT_PARAM_IND_LANCE]);
if (strlen(v_indlanc) == 0)
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, EXPLOIT_VAR_IDLANC_DFLT, v_indlanc) != OK){
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_VAR_ENV, EXPLOIT_VAR_IDLANC_DFLT, exploit_ctx_exec.fichier_config);
EXPLOIT_fin_prg(KO);
}
if (argc > EXPLOIT_PARAM_REP_LOCAL)
strcpy(exploit_rep_local, argv[EXPLOIT_PARAM_REP_LOCAL]);
if (strlen(exploit_rep_local) == 0)
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, EXPLOIT_VAR_REP_LOCAL, exploit_rep_local) != OK){
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_VAR_ENV, EXPLOIT_VAR_REP_LOCAL, exploit_ctx_exec.fichier_config);
EXPLOIT_fin_prg(KO);
}
if (argc > EXPLOIT_PARAM_REP_LOG)
strcpy(exploit_rep_log,argv[EXPLOIT_PARAM_REP_LOG]);
if (strlen(exploit_rep_log) == 0)
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, EXPLOIT_VAR_REP_LOG, exploit_rep_log) != OK){
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_VAR_ENV, EXPLOIT_VAR_REP_LOG, exploit_ctx_exec.fichier_config);
EXPLOIT_fin_prg(KO);
}
if (argc > EXPLOIT_PARAM_FIC_LOG)
strcpy(exploit_fic_log, argv[EXPLOIT_PARAM_FIC_LOG]);
if (strlen(exploit_fic_log) == 0)
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, EXPLOIT_VAR_FIC_LOG, exploit_fic_log) != OK){
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_VAR_ENV, EXPLOIT_VAR_FIC_LOG, exploit_ctx_exec.fichier_config);
EXPLOIT_fin_prg(KO);
}
if (argc > EXPLOIT_PARAM_FIC_UTIL)
strcpy(exploit_fichier_utilisateur, argv[EXPLOIT_PARAM_FIC_UTIL]);
if (strlen(exploit_fichier_utilisateur) == 0) {
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, COMMUN_VAR_FIC_UTIL, exploit_fichier_utilisateur) != OK){
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_VAR_ENV, COMMUN_VAR_FIC_UTIL, exploit_ctx_exec.fichier_config);
EXPLOIT_fin_prg(KO);
}
}
if (argc > EXPLOIT_PARAM_FIC_ERR)
strcpy(exploit_ctx_exec.fichier_erreur, argv[EXPLOIT_PARAM_FIC_ERR]);
if (strlen(exploit_ctx_exec.fichier_erreur) == 0){
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, COMMUN_VAR_FIC_ERR, exploit_ctx_exec.fichier_erreur) != OK){
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_VAR_ENV, COMMUN_VAR_FIC_ERR, exploit_ctx_exec.fichier_config);
EXPLOIT_fin_prg(KO);
}
}
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, COMMUN_VAR_BATCH_TMP, exploit_rep_tmp) != OK){
COMMUN_ecrit_log_var(COMMUN_BALISE_ERREUR, EXPLOIT_MSG_ERR_VAR_ENV, COMMUN_VAR_BATCH_TMP, exploit_ctx_exec.fichier_config);
EXPLOIT_fin_prg(KO);
}
COMMUN_check_env(NULL, exploit_separateur_chemin, NULL, exploit_tmp);
/* ajout V3.0 NDY 08/04/2002 */
exploit_ctx_exec.niveau_debug = COMMUN_DEBUG_SANS_DEBUG;
if (argc > EXPLOIT_PARAM_NIV_DEBUG) strcpy(v_nivdebug,argv[EXPLOIT_PARAM_NIV_DEBUG]);
if (strlen(v_nivdebug) == 0) sprintf(v_nivdebug,"%d",exploit_ctx_exec.niveau_debug);
exploit_ctx_exec.mode_trace = COMMUN_TRACE_DANS_FIC;
COMMUN_init_param_execution(exploit_ctx_exec);
if (COMMUN_open_log(exploit_fic_log, exploit_ctx_exec.nom_programme) != OK)
COMMUN_open_log(NULL, exploit_ctx_exec.nom_programme);
/* connection ORACLE */
/* EXEC SQL WHENEVER SQLERROR CONTINUE; */
if ( CBASE_connexion_base(exploit_ctx_exec.fichier_config, exploit_instance, exploit_fichier_utilisateur, exploit_user) != TRT_OK){
CBASE_affiche_message(COMMUN_ERR_00002, COMMUN_BALISE_ERREUR, sqlca.sqlerrm.sqlerrmc, NULL, NULL);
EXPLOIT_fin_prg(KO);
}
/*
SNE, Recherche des noms des scripts de debut et de fin
*/
if ( (strcmp(v_indlanc, EXPLOIT_IND_LANCE_SCRIPT_DEB) == 0) || ( strcmp(v_indlanc, EXPLOIT_IND_LANCE_TOUS_SCRP) == 0) )
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, EXPLOIT_VAR_EXPLOIT_DEB, exploit_script_deb) != OK)
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, COMMUN_VAR_CFG_PLTFM, EXPLOIT_VAR_EXPLOIT_DEB, exploit_script_deb) != OK){
CBASE_affiche_message(COMMUN_ERR_VAL_VAR, COMMUN_BALISE_ERREUR, EXPLOIT_VAR_EXPLOIT_DEB, NULL, NULL);
EXPLOIT_fin_prg(KO);
}
if ( (strcmp(v_indlanc, EXPLOIT_IND_LANCE_SCRIPT_FIN) == 0) || ( strcmp(v_indlanc, EXPLOIT_IND_LANCE_TOUS_SCRP) == 0) )
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, exploit_instance, EXPLOIT_VAR_EXPLOIT_FIN, exploit_script_fin) != OK)
if (COMMUN_lire_info(exploit_ctx_exec.fichier_config, COMMUN_VAR_CFG_PLTFM, EXPLOIT_VAR_EXPLOIT_FIN, exploit_script_fin) != OK){
CBASE_affiche_message(COMMUN_ERR_VAL_VAR, COMMUN_BALISE_ERREUR, EXPLOIT_VAR_EXPLOIT_FIN, NULL, NULL);
EXPLOIT_fin_prg(KO);
}
sprintf(exploit_tmp,"%s %s %s", exploit_log, exploit_user, v_indlanc);
CBASE_affiche_message(EXPLOIT_INF_DEMARRAGE, COMMUN_BALISE_INFORMATIVE, exploit_tmp, NULL, NULL);
/* NDY 08/04/2002 V3.0 : creation des variables globales de traitement (date systeme et niveau de trace) */
if ( CBASE_cree_var_trt(EXPLOIT_VAR_DATE_SYSTEME,EXPLOIT_VAR_P_DAT_SYS,EXPLOIT_VAR_DATE_SYS_VAL) != OK)
EXPLOIT_fin_prg(KO);
if ( CBASE_cree_var_trt(EXPLOIT_VAR_NIVEAU_TRACE,EXPLOIT_VAR_P_NIV_TRACE,v_nivdebug) != OK)
EXPLOIT_fin_prg(KO);
/*---------------------------------------------*/
/* Execution du script de debut d'exploitation */
/* si execution demandee au lancement */
/*---------------------------------------------*/
if ( (strcmp(v_indlanc, EXPLOIT_IND_LANCE_SCRIPT_DEB) == 0) || ( strcmp(v_indlanc, EXPLOIT_IND_LANCE_TOUS_SCRP) == 0) )
{
if ( (exploit_retour = COMMUN_lancer_commande(exploit_script_deb, NULL, NULL)) != 0)
{
CBASE_affiche_message(COMMUN_ERR_TRT_BAT, COMMUN_BALISE_ERREUR, exploit_script_deb, NULL, NULL);
EXPLOIT_fin_prg(KO);
}
}
/**************************************************************/
/* Traitement des taches */
/**************************************************************/
if ( (exploit_retour = EXPLOIT_traiter_taches()) != OK)
EXPLOIT_fin_prg(KO);
/*-------------------------------------------*/
/* Execution du script de fin d'exploitation */
/* si execution demandee au lancement */
/*-------------------------------------------*/
if ( (strcmp(v_indlanc, EXPLOIT_IND_LANCE_SCRIPT_FIN) == 0) || ( strcmp(v_indlanc, EXPLOIT_IND_LANCE_TOUS_SCRP) == 0) )
{
if ( (exploit_retour = COMMUN_lancer_commande(exploit_script_fin, NULL, NULL)) != 0)
{
CBASE_affiche_message(COMMUN_ERR_TRT_BAT, COMMUN_BALISE_ERREUR, exploit_script_fin, NULL, NULL);
EXPLOIT_fin_prg(KO);
}
}
/* NDY 08/04/2002 V3.0 : suppresion des variables globales de traitement */
if ( CBASE_supp_var_trt(EXPLOIT_VAR_DATE_SYSTEME) != OK)
EXPLOIT_fin_prg(KO);
if ( CBASE_supp_var_trt(EXPLOIT_VAR_NIVEAU_TRACE) != OK)
EXPLOIT_fin_prg(KO);
EXPLOIT_fin_prg(OK);
} /* FIN DU PROGRAMME PRINCIPAL */
/*
====================================================================================
Nom : EXPLOIT_traiter_taches
Description : Fonction centrales de parcours et de traitement des taches en attente
Auteur : Sofiane NEKERE
Date creation: 15/02/2001
retour :
Aucun
Historique :
---------------------------------------------------------------------------
Fonction |Date |Initiales |Commentaires
---------------------------------------------------------------------------
@(#) EXPLOIT_traiter_une_tache |15/02/2001 | SNE | Creation (@fonction)
@(#) EXPLOIT_traiter_une_tache |05/03/2001 | SNE | Remplacement de uti_maj par uti_cre pour contourner
@(#) EXPLOIT_traiter_une_tache | | | les MAJ effectuees par le scrutateur
====================================================================================
*/
int EXPLOIT_traiter_taches(void)
{
/* EXEC SQL BEGIN DECLARE SECTION; */
/* table b_traitement */
int trt_numtrt;
/* VARCHAR trt_nomprog[21]; */
struct { unsigned short len; unsigned char arr[21]; } trt_nomprog;
/* VARCHAR trt_libprog[51]; */
struct { unsigned short len; unsigned char arr[51]; } trt_libprog;
/* VARCHAR trt_libprog2[51]; */
struct { unsigned short len; unsigned char arr[51]; } trt_libprog2;
/* VARCHAR trt_type[2]; */
struct { unsigned short len; unsigned char arr[2]; } trt_type;
/* VARCHAR trt_media_edt[2]; */
struct { unsigned short len; unsigned char arr[2]; } trt_media_edt;
/* VARCHAR trt_dir_prog[61]; */
struct { unsigned short len; unsigned char arr[61]; } trt_dir_prog;
/* VARCHAR trt_dir_edt[61]; */
struct { unsigned short len; unsigned char arr[61]; } trt_dir_edt;
/* VARCHAR trt_dir_dem[61]; */
struct { unsigned short len; unsigned char arr[61]; } trt_dir_dem;
/* VARCHAR trt_destinataire[31]; */
struct { unsigned short len; unsigned char arr[31]; } trt_destinataire;
/* VARCHAR trt_imprimante[17]; */
struct { unsigned short len; unsigned char arr[17]; } trt_imprimante;
/* VARCHAR trt_orientation[10]; */
struct { unsigned short len; unsigned char arr[10]; } trt_orientation;
/* VARCHAR trt_copies[2]; */
struct { unsigned short len; unsigned char arr[2]; } trt_copies;
/* VARCHAR trt_format[3]; */
struct { unsigned short len; unsigned char arr[3]; } trt_format;
/* VARCHAR trt_recto_verso[2]; */
struct { unsigned short len; unsigned char arr[2]; } trt_recto_verso;
/* VARCHAR trt_sens_rv[2]; */
struct { unsigned short len; unsigned char arr[2]; } trt_sens_rv;
/* VARCHAR trt_bac[21]; */
struct { unsigned short len; unsigned char arr[21]; } trt_bac;
/* VARCHAR trt_utimaj[13]; */
struct { unsigned short len; unsigned char arr[13]; } trt_utimaj;
/* EXEC SQL END DECLARE SECTION; */
t_EXPLOIT_enr_b_traitement v_enr_b_traitement;
int retfct;
int v_retour;
char v_fic_log[256];
/*---------------------------------*/
/* Declaration des Curseurs ORACLE */
/*---------------------------------*/
/* Curseur de recherche des traitements postes de nature exploitation */
/* EXEC SQL DECLARE c_b_traitement CURSOR FOR
SELECT numtrt,
nomprog,
'\"'||replace(libprog,'''','\\\''')||'\"',
libprog,
type,
media_edt,
nvl(dir_prog,' '),
nvl(dir_edt,' '),
nvl(dir_dem,' '),
nvl(replace(destinataire, ' ', '-'), ' '),
nvl(imprimante,' '),
nvl(orientation,' '),
nvl(copies,1),
nvl(cod_format,'XX'), /o SNE, 03/07/2000 : FORMT -COD_FORMATo/
nvl(recto_verso,'X'),
nvl(sens_rv,'X'),
nvl(bac,'X'),
uti_cre /o SNE, 03/07/2000 : UTIMAJ - UTI_MAJ o/
FROM b_traitement
WHERE code_fin= 'P' AND
nature = 'E'
ORDER BY numtrt; */
/*-------------------------------------------------------*/
/* Ouverture curseur C_B_TRAITEMENT (Traitements postes) */
/*-------------------------------------------------------*/
/* EXEC SQL OPEN c_b_traitement; */
{
struct sqlexd sqlstm;
sqlstm.sqlvsn = 10;
sqlstm.arrsiz = 0;
sqlstm.sqladtp = &sqladt;
sqlstm.sqltdsp = &sqltds;
sqlstm.stmt = sq0001;
sqlstm.iters = (unsigned int )1;
sqlstm.offset = (unsigned int )5;
sqlstm.selerr = (unsigned short)1;
sqlstm.cud = sqlcud0;
sqlstm.sqlest = (unsigned char *)&sqlca;
sqlstm.sqlety = (unsigned short)256;
sqlstm.occurs = (unsigned int )0;
sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);
}
if ( sqlca.sqlcode != 0 )
{
CBASE_affiche_message(COMMUN_ERR_00002, COMMUN_BALISE_ERREUR, sqlca.sqlerrm.sqlerrmc, NULL, NULL);
return(KO);
}
/*-------------------------------------------*/
/* boucle de parcours des traitements postes */
/* tant qu'il n'y a pas d'erreur systeme */
/*-------------------------------------------*/
retfct = 0;
/* EXEC SQL WHENEVER NOT FOUND DO break; */
while (retfct != 1)
{
retfct = 0;
/* EXEC SQL FETCH c_b_traitement INTO
:trt_numtrt, :trt_nomprog, :trt_libprog, :trt_libprog2, :trt_type,
:trt_media_edt, :trt_dir_prog, :trt_dir_edt, :trt_dir_dem,
:trt_destinataire, :trt_imprimante, :trt_orientation, :trt_copies,
:trt_format, :trt_recto_verso, :trt_sens_rv, :trt_bac, :trt_utimaj; */
{
struct sqlexd sqlstm;
sqlstm.sqlvsn = 10;
sqlstm.arrsiz = 18;
sqlstm.sqladtp = &sqladt;
sqlstm.sqltdsp = &sqltds;
sqlstm.iters = (unsigned int )1;
sqlstm.offset = (unsigned int )20;
sqlstm.cud = sqlcud0;
sqlstm.sqlest = (unsigned char *)&sqlca;
sqlstm.sqlety = (unsigned short)256;
sqlstm.occurs = (unsigned int )0;
sqlstm.sqhstv[0] = ( void *)&trt_numtrt;
sqlstm.sqhstl[0] = (unsigned int )4;
sqlstm.sqhsts[0] = ( int )0;
sqlstm.sqindv[0] = ( void *)0;
sqlstm.sqinds[0] = ( int )0;
sqlstm.sqharm[0] = (unsigned int )0;
sqlstm.sqadto[0] = (unsigned short )0;
sqlstm.sqtdso[0] = (unsigned short )0;
sqlstm.sqhstv[1] = ( void *)&trt_nomprog;
sqlstm.sqhstl[1] = (unsigned int )23;
sqlstm.sqhsts[1] = ( int )0;
sqlstm.sqindv[1] = ( void *)0;
sqlstm.sqinds[1] = ( int )0;
sqlstm.sqharm[1] = (unsigned int )0;
sqlstm.sqadto[1] = (unsigned short )0;
sqlstm.sqtdso[1] = (unsigned short )0;
sqlstm.sqhstv[2] = ( void *)&trt_libprog;
sqlstm.sqhstl[2] = (unsigned int )53;
sqlstm.sqhsts[2] = ( int )0;
sqlstm.sqindv[2] = ( void *)0;
sqlstm.sqinds[2] = ( int )0;
sqlstm.sqharm[2] = (unsigned int )0;
sqlstm.sqadto[2] = (unsigned short )0;
sqlstm.sqtdso[2] = (unsigned short )0;
sqlstm.sqhstv[3] = ( void *)&trt_libprog2;
sqlstm.sqhstl[3] = (unsigned int )53;
sqlstm.sqhsts[3] = ( int )0;
sqlstm.sqindv[3] = ( void *)0;
sqlstm.sqinds[3] = ( int )0;
sqlstm.sqharm[3] = (unsigned int )0;
sqlstm.sqadto[3] = (unsigned short )0;
sqlstm.sqtdso[3] = (unsigned short )0;
sqlstm.sqhstv[4] = ( void *)&trt_type;
sqlstm.sqhstl[4] = (unsigned int )4;
sqlstm.sqhsts[4] = ( int )0;
sqlstm.sqindv[4] = ( void *)0;
sqlstm.sqinds[4] = ( int )0;
sqlstm.sqharm[4] = (unsigned int )0;
sqlstm.sqadto[4] = (unsigned short )0;
sqlstm.sqtdso[4] = (unsigned short )0;
sqlstm.sqhstv[5] = ( void *)&trt_media_edt;
sqlstm.sqhstl[5] = (unsigned int )4;
sqlstm.sqhsts[5] = ( int )0;
sqlstm.sqindv[5] = ( void *)0;
sqlstm.sqinds[5] = ( int )0;
sqlstm.sqharm[5] = (unsigned int )0;
sqlstm.sqadto[5] = (unsigned short )0;
sqlstm.sqtdso[5] = (unsigned short )0;
sqlstm.sqhstv[6] = ( void *)&trt_dir_prog;
sqlstm.sqhstl[6] = (unsigned int )63;
sqlstm.sqhsts[6] = ( int )0;
sqlstm.sqindv[6] = ( void *)0;
sqlstm.sqinds[6] = ( int )0;
sqlstm.sqharm[6] = (unsigned int )0;
sqlstm.sqadto[6] = (unsigned short )0;
sqlstm.sqtdso[6] = (unsigned short )0;
sqlstm.sqhstv[7] = ( void *)&trt_dir_edt;
sqlstm.sqhstl[7] = (unsigned int )63;
sqlstm.sqhsts[7] = ( int )0;
sqlstm.sqindv[7] = ( void *)0;
sqlstm.sqinds[7] = ( int )0;
sqlstm.sqharm[7] = (unsigned int )0;
sqlstm.sqadto[7] = (unsigned short )0;
sqlstm.sqtdso[7] = (unsigned short )0;
sqlstm.sqhstv[8] = ( void *)&trt_dir_dem;
sqlstm.sqhstl[8] = (unsigned int )63;
sqlstm.sqhsts[8] = ( int )0;
sqlstm.sqindv[8] = ( void *)0;
sqlstm.sqinds[8] = ( int )0;
sqlstm.sqharm[8] = (unsigned int )0;
sqlstm.sqadto[8] = (unsigned short )0;
sqlstm.sqtdso[8] = (unsigned short )0;
sqlstm.sqhstv[9] = ( void *)&trt_destinataire;
sqlstm.sqhstl[9] = (unsigned int )33;
sqlstm.sqhsts[9] = ( int )0;
sqlstm.sqindv[9] = ( void *)0;
sqlstm.sqinds[9] = ( int )0;
sqlstm.sqharm[9] = (unsigned int )0;
sqlstm.sqadto[9] = (unsigned short )0;
sqlstm.sqtdso[9] = (unsigned short )0;
sqlstm.sqhstv[10] = ( void *)&trt_imprimante;
sqlstm.sqhstl[10] = (unsigned int )19;
sqlstm.sqhsts[10] = ( int )0;
sqlstm.sqindv[10] = ( void *)0;
sqlstm.sqinds[10] = ( int )0;
sqlstm.sqharm[10] = (unsigned int )0;
sqlstm.sqadto[10] = (unsigned short )0;
sqlstm.sqtdso[10] = (unsigned short )0;
sqlstm.sqhstv[11] = ( void *)&trt_orientation;
sqlstm.sqhstl[11] = (unsigned int )12;
sqlstm.sqhsts[11] = ( int )0;
sqlstm.sqindv[11] = ( void *)0;
sqlstm.sqinds[11] = ( int )0;
sqlstm.sqharm[11] = (unsigned int )0;
sqlstm.sqadto[11] = (unsigned short )0;
sqlstm.sqtdso[11] = (unsigned short )0;
sqlstm.sqhstv[12] = ( void *)&trt_copies;
sqlstm.sqhstl[12] = (unsigned int )4;
sqlstm.sqhsts[12] = ( int )0;
sqlstm.sqindv[12] = ( void *)0;
sqlstm.sqinds[12] = ( int )0;
sqlstm.sqharm[12] = (unsigned int )0;
sqlstm.sqadto[12] = (unsigned short )0;
sqlstm.sqtdso[12] = (unsigned short )0;
sqlstm.sqhstv[13] = ( void *)&trt_format;
sqlstm.sqhstl[13] = (unsigned int )5;
sqlstm.sqhsts[13] = ( int )0;