version 1.51, 2012/12/18 13:19:38
|
version 1.90, 2022/09/07 13:40:40
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.12 |
RPL/2 (R) version 4.1.34 |
Copyright (C) 1989-2012 Dr. BERTRAND Joël |
Copyright (C) 1989-2021 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 102 instruction_splash(struct_processus *s_e
|
Line 102 instruction_splash(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
encart(s_etat_processus, (unsigned long) (attente * 1E6)); |
encart(s_etat_processus, (integer8) (attente * 1E6)); |
} |
} |
else |
else |
{ |
{ |
Line 133 instruction_splash(struct_processus *s_e
|
Line 133 instruction_splash(struct_processus *s_e
|
void |
void |
instruction_send(struct_processus *s_etat_processus) |
instruction_send(struct_processus *s_etat_processus) |
{ |
{ |
pid_t pid; |
|
|
|
pthread_t tid; |
|
|
|
sig_atomic_t registre; |
sig_atomic_t registre; |
|
|
ssize_t longueur_ecriture; |
ssize_t longueur_ecriture; |
Line 145 instruction_send(struct_processus *s_eta
|
Line 141 instruction_send(struct_processus *s_eta
|
|
|
struct timespec attente; |
struct timespec attente; |
|
|
|
unsigned char caractere; |
unsigned char tampon; |
unsigned char tampon; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
Line 242 instruction_send(struct_processus *s_eta
|
Line 239 instruction_send(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
pid = -3; |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
Line 257 instruction_send(struct_processus *s_eta
|
Line 249 instruction_send(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
caractere = 1; |
(*s_etat_processus).pipe_nombre_objets_attente, |
|
&pid, sizeof(pid))) != sizeof(pid)) |
|
{ |
|
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
|
if (longueur_ecriture == -1) |
|
{ |
|
if ((*s_etat_processus).profilage == d_vrai) |
|
{ |
|
profilage(s_etat_processus, NULL); |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
scrutation_interruptions(s_etat_processus); |
|
} |
|
|
|
pid = getpid(); |
|
|
|
attente.tv_sec = 0; |
attente.tv_sec = 0; |
attente.tv_nsec = GRANULARITE_us * 1000; |
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
while((longueur_ecriture = write_atomic(s_etat_processus, |
(*s_etat_processus).pipe_nombre_objets_attente, |
(*s_etat_processus).pipe_nombre_elements_attente, |
&pid, sizeof(pid))) != sizeof(pid)) |
&caractere, sizeof(caractere))) != sizeof(caractere)) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
Line 375 instruction_send(struct_processus *s_eta
|
Line 323 instruction_send(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
tid = (pthread_t) -3; |
|
|
|
attente.tv_sec = 0; |
attente.tv_sec = 0; |
attente.tv_nsec = GRANULARITE_us * 1000; |
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
Line 390 instruction_send(struct_processus *s_eta
|
Line 336 instruction_send(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
caractere = 1; |
(*s_etat_processus).pipe_nombre_objets_attente, |
|
&tid, sizeof(tid))) != sizeof(tid)) |
|
{ |
|
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
if (longueur_ecriture == -1) |
|
{ |
|
if ((*s_etat_processus).profilage == d_vrai) |
|
{ |
|
profilage(s_etat_processus, NULL); |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
scrutation_interruptions(s_etat_processus); |
|
} |
|
|
|
tid = pthread_self(); |
|
|
|
attente.tv_sec = 0; |
attente.tv_sec = 0; |
attente.tv_nsec = GRANULARITE_us * 1000; |
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
while((longueur_ecriture = write_atomic(s_etat_processus, |
(*s_etat_processus).pipe_nombre_objets_attente, |
(*s_etat_processus).pipe_nombre_elements_attente, |
&tid, sizeof(tid))) != sizeof(tid)) |
&caractere, sizeof(caractere))) != sizeof(caractere)) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
Line 481 instruction_send(struct_processus *s_eta
|
Line 386 instruction_send(struct_processus *s_eta
|
} |
} |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
# else |
# else |
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
# endif |
# endif |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
if (errno != EINTR) |
return; |
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
} |
} |
} |
} |
|
|
Line 551 instruction_send(struct_processus *s_eta
|
Line 459 instruction_send(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
// Envoi d'un PID invalide (-1) pour ne pas bloquer le thread |
|
// de surveillance. |
|
|
|
if ((*s_etat_processus).processus_detache == d_vrai) |
|
{ |
|
pid = -1; |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
|
(*s_etat_processus).pipe_nombre_interruptions_attente, |
|
&pid, sizeof(pid))) != sizeof(pid)) |
|
{ |
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
if (longueur_ecriture == -1) |
|
{ |
|
if ((*s_etat_processus).profilage == d_vrai) |
|
{ |
|
profilage(s_etat_processus, NULL); |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
|
scrutation_interruptions(s_etat_processus); |
|
} |
|
else |
|
{ |
|
tid = (pthread_t) -1; |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
while((longueur_ecriture = write_atomic(s_etat_processus, |
|
(*s_etat_processus).pipe_nombre_interruptions_attente, |
|
&tid, sizeof(tid))) != sizeof(tid)) |
|
{ |
|
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
|
|
if (longueur_ecriture == -1) |
|
{ |
|
if ((*s_etat_processus).profilage == d_vrai) |
|
{ |
|
profilage(s_etat_processus, NULL); |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
if (sem_post(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
if (sem_post((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
scrutation_interruptions(s_etat_processus); |
|
} |
|
|
|
# ifndef SEMAPHORES_NOMMES |
|
while(sem_wait(&((*s_etat_processus).semaphore_fork)) != 0) |
|
# else |
|
while(sem_wait((*s_etat_processus).semaphore_fork) != 0) |
|
# endif |
|
{ |
|
if (errno != EINTR) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
} |
|
} |
|
|
|
// ecriture_pipe() ne peut être interrompu par un signal. |
// ecriture_pipe() ne peut être interrompu par un signal. |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
Line 785 instruction_send(struct_processus *s_eta
|
Line 544 instruction_send(struct_processus *s_eta
|
void |
void |
instruction_sqlquery(struct_processus *s_etat_processus) |
instruction_sqlquery(struct_processus *s_etat_processus) |
{ |
{ |
# define d_LONGUEUR 1024 |
|
|
|
# if defined(MYSQL_SUPPORT) || defined(POSTGRESQL_SUPPORT) |
|
logical1 connexion_permanente; |
logical1 connexion_permanente; |
# endif |
|
|
|
struct_objet *s_copie_1; |
struct_objet *s_copie_1; |
struct_objet *s_objet_1; |
struct_objet *s_objet_1; |
Line 837 instruction_sqlquery(struct_processus *s
|
Line 592 instruction_sqlquery(struct_processus *s
|
printf(" { \"postgresql:iso-8859-1\" \"server\" " |
printf(" { \"postgresql:iso-8859-1\" \"server\" " |
"\"database\" \"user\" \"password\" port }\n"); |
"\"database\" \"user\" \"password\" port }\n"); |
printf(" SQLQUERY\n"); |
printf(" SQLQUERY\n"); |
|
printf(" \"select * from table\"\n"); |
|
printf(" { \"sqlite\" \"file\" } SQLQUERY\n"); |
|
|
return; |
return; |
} |
} |
Line 872 instruction_sqlquery(struct_processus *s
|
Line 629 instruction_sqlquery(struct_processus *s
|
|
|
if ((*s_objet_1).type == LST) |
if ((*s_objet_1).type == LST) |
{ |
{ |
# if defined(MYSQL_SUPPORT) || defined(POSTGRESQL_SUPPORT) |
|
connexion_permanente = d_faux; |
connexion_permanente = d_faux; |
# endif |
|
|
|
s_copie_1 = s_objet_1; |
s_copie_1 = s_objet_1; |
|
|
Line 914 instruction_sqlquery(struct_processus *s
|
Line 669 instruction_sqlquery(struct_processus *s
|
} |
} |
} |
} |
|
|
# if defined(MYSQL_SUPPORT) || defined(POSTGRESQL_SUPPORT) |
|
connexion_permanente = d_vrai; |
connexion_permanente = d_vrai; |
# endif |
|
} |
} |
|
|
if (((*s_objet_1).type == SQL) && ((*s_objet_2).type == CHN)) |
if (((*s_objet_1).type == SQL) && ((*s_objet_2).type == CHN)) |
Line 1137 instruction_sqlquery(struct_processus *s
|
Line 890 instruction_sqlquery(struct_processus *s
|
.descripteur.mysql); |
.descripteur.mysql); |
} |
} |
|
|
if (presence_resultat == d_vrai) |
if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile), |
|
s_objet_resultat) == d_erreur) |
{ |
{ |
if (empilement(s_etat_processus, |
return; |
&((*s_etat_processus).l_base_pile), |
|
s_objet_resultat) == d_erreur) |
|
{ |
|
return; |
|
} |
|
} |
} |
|
|
# else |
# else |
Line 1171 instruction_sqlquery(struct_processus *s
|
Line 920 instruction_sqlquery(struct_processus *s
|
{ |
{ |
# ifdef POSTGRESQL_SUPPORT |
# ifdef POSTGRESQL_SUPPORT |
|
|
unsigned int i; |
int i; |
unsigned int j; |
int j; |
unsigned int nombre_colonnes; |
int nombre_colonnes; |
unsigned int nombre_lignes; |
int nombre_lignes; |
|
|
logical1 presence_resultat; |
logical1 presence_resultat; |
|
|
Line 1349 instruction_sqlquery(struct_processus *s
|
Line 1098 instruction_sqlquery(struct_processus *s
|
else |
else |
{ |
{ |
if (((*(*l_element_courant_ligne).donnee).objet |
if (((*(*l_element_courant_ligne).donnee).objet |
= malloc((PQgetlength( |
= malloc(((size_t) (PQgetlength( |
resultat_postgresql, i, j) + 1) * |
resultat_postgresql, i, j) + 1)) * |
sizeof(unsigned char))) == NULL) |
sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1427 instruction_sqlquery(struct_processus *s
|
Line 1176 instruction_sqlquery(struct_processus *s
|
fflush(stdout); |
fflush(stdout); |
# endif |
# endif |
} |
} |
|
else if (strcmp((*((struct_connecteur_sql *) (*s_objet_1).objet)).type, |
|
"SQLITE") == 0) |
|
{ |
|
const char *queue; |
|
const unsigned char *resultat; |
|
|
|
int i; |
|
int ios; |
|
int nombre_colonnes; |
|
|
|
sqlite3_stmt *ppStmt; |
|
|
|
struct_liste_chainee *l_element_courant; |
|
struct_liste_chainee *l_element_courant_ligne; |
|
|
|
struct_objet *s_objet_resultat; |
|
|
|
struct timespec attente; |
|
|
|
if (sqlite3_prepare_v2((*((struct_connecteur_sql *) |
|
(*s_objet_1).objet)).descripteur.sqlite, |
|
(unsigned char *) (*s_objet_2).objet, |
|
(int) strlen((unsigned char *) (*s_objet_2).objet), |
|
&ppStmt, &queue) != SQLITE_OK) |
|
{ |
|
if (connexion_permanente == d_faux) |
|
{ |
|
sqlite3_close((*((struct_connecteur_sql *) |
|
(*s_objet_1).objet)).descripteur.sqlite); |
|
} |
|
|
|
liberation(s_etat_processus, s_objet_1); |
|
liberation(s_etat_processus, s_objet_2); |
|
|
|
(*s_etat_processus).erreur_execution = d_ex_erreur_sql; |
|
return; |
|
} |
|
|
|
s_objet_resultat = NULL; |
|
l_element_courant = NULL; |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
|
if ((s_objet_resultat = |
|
allocation(s_etat_processus, LST)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
// Création d'une liste vide |
|
|
|
(*s_objet_resultat).objet = NULL; |
|
l_element_courant = (*s_objet_resultat).objet; |
|
|
|
do |
|
{ |
|
switch(ios = sqlite3_step(ppStmt)) |
|
{ |
|
case SQLITE_ROW: |
|
{ |
|
// Ajout d'une liste au bout de la liste |
|
// contenant les lignes |
|
|
|
if (l_element_courant == NULL) |
|
{ |
|
if (((*s_objet_resultat).objet = |
|
allocation_maillon(s_etat_processus)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
} |
|
|
|
l_element_courant = (struct_liste_chainee *) |
|
(*s_objet_resultat).objet; |
|
} |
|
else |
|
{ |
|
if (((*l_element_courant).suivant = |
|
allocation_maillon(s_etat_processus)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
l_element_courant = (*l_element_courant).suivant; |
|
} |
|
|
|
(*l_element_courant).suivant = NULL; |
|
|
|
// Création de la liste fille |
|
|
|
if (((*l_element_courant).donnee = |
|
allocation(s_etat_processus, LST)) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
(*(*l_element_courant).donnee).objet = NULL; |
|
|
|
// Lecture de la ligne |
|
|
|
nombre_colonnes = sqlite3_data_count(ppStmt); |
|
l_element_courant_ligne = NULL; |
|
|
|
for(i = 0; i < nombre_colonnes; i++) |
|
{ |
|
if (l_element_courant_ligne == NULL) |
|
{ |
|
if (((*(*l_element_courant).donnee).objet = |
|
allocation_maillon(s_etat_processus)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
l_element_courant_ligne = |
|
(struct_liste_chainee *) |
|
(*(*l_element_courant).donnee).objet; |
|
} |
|
else |
|
{ |
|
if (((*l_element_courant_ligne).suivant = |
|
allocation_maillon(s_etat_processus)) |
|
== NULL) |
|
{ |
|
l_element_courant_ligne = |
|
(*l_element_courant_ligne).suivant; |
|
} |
|
|
|
l_element_courant_ligne = |
|
(*l_element_courant_ligne).suivant; |
|
} |
|
|
|
(*l_element_courant_ligne).suivant = NULL; |
|
|
|
if (((*l_element_courant_ligne).donnee = |
|
allocation(s_etat_processus, CHN)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (sqlite3_column_type(ppStmt, i) == SQLITE_NULL) |
|
{ |
|
if (((*(*l_element_courant_ligne).donnee).objet |
|
= malloc(5 * sizeof(unsigned char))) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) |
|
(*(*l_element_courant_ligne).donnee) |
|
.objet, "NULL"); |
|
} |
|
else |
|
{ |
|
if ((resultat = sqlite3_column_text(ppStmt, i)) |
|
== NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (((*(*l_element_courant_ligne).donnee).objet |
|
= malloc((strlen(resultat) + 1 ) * |
|
sizeof(unsigned char))) == NULL) |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
strcpy((unsigned char *) |
|
(*(*l_element_courant_ligne).donnee) |
|
.objet, resultat); |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
case SQLITE_DONE: |
|
{ |
|
// Fin de la lecture des données |
|
break; |
|
} |
|
|
|
case SQLITE_BUSY: |
|
case SQLITE_LOCKED: |
|
{ |
|
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
(*s_etat_processus).erreur_systeme = |
|
d_es_erreur_fichier; |
|
return; |
|
} |
|
} |
|
} while(ios != SQLITE_DONE); |
|
|
|
if (sqlite3_finalize(ppStmt) != SQLITE_OK) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
|
return; |
|
} |
|
|
|
if (connexion_permanente == d_faux) |
|
{ |
|
sqlite3_close((*((struct_connecteur_sql *) (*s_objet_1).objet)) |
|
.descripteur.sqlite); |
|
} |
|
|
|
if (empilement(s_etat_processus, &((*s_etat_processus) |
|
.l_base_pile), s_objet_resultat) == d_erreur) |
|
{ |
|
return; |
|
} |
|
} |
else |
else |
{ |
{ |
liberation(s_etat_processus, s_objet_1); |
liberation(s_etat_processus, s_objet_1); |
Line 1517 instruction_stop(struct_processus *s_eta
|
Line 1504 instruction_stop(struct_processus *s_eta
|
.processus_detache == d_vrai) |
.processus_detache == d_vrai) |
{ |
{ |
envoi_signal_processus((*(*((struct_processus_fils *) |
envoi_signal_processus((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).pid, rpl_sigstop); |
(*s_objet).objet)).thread).pid, rpl_sigstop, d_faux); |
} |
} |
else |
else |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_lock(&((*s_etat_processus).mutex_pile_processus)) |
|
!= 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1563 instruction_stop(struct_processus *s_eta
|
Line 1551 instruction_stop(struct_processus *s_eta
|
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex)) != 0) |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) |
if (pthread_mutex_unlock(&((*s_etat_processus) |
!= 0) |
.mutex_pile_processus)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1577 instruction_stop(struct_processus *s_eta
|
Line 1565 instruction_stop(struct_processus *s_eta
|
if ((*(*((struct_processus_fils *) |
if ((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).thread_actif == d_vrai) |
(*s_objet).objet)).thread).thread_actif == d_vrai) |
{ |
{ |
envoi_signal_thread((*(*((struct_processus_fils *) |
envoi_signal_thread(s_etat_processus, |
|
(*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).tid, rpl_sigstop); |
(*s_objet).objet)).thread).tid, rpl_sigstop); |
} |
} |
|
|
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex)) != 0) |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) |
if (pthread_mutex_unlock(&((*s_etat_processus) |
!= 0) |
.mutex_pile_processus)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 1597 instruction_stop(struct_processus *s_eta
|
Line 1586 instruction_stop(struct_processus *s_eta
|
} |
} |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_unlock(&((*s_etat_processus) |
|
.mutex_pile_processus)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |