diff --git a/Code-C/main b/Code-C/main index 3b69e1e..17258e9 100755 Binary files a/Code-C/main and b/Code-C/main differ diff --git a/Code-C/main.c b/Code-C/main.c index cc23244..d02a0a3 100644 --- a/Code-C/main.c +++ b/Code-C/main.c @@ -19,10 +19,9 @@ int main(int argc , char** argv){ double period = 1 / freqEch; double invTimeBandWidth = 1 /(nRow * period); - Pqueue new = createE -/* + pthread_t rawData; pthread_create(&rawData , NULL, simulateFlux, (void *)&rawData); pthread_exit(NULL); -*/ + } \ No newline at end of file diff --git a/Code-C/queue.c b/Code-C/queue.c index bf570d1..d14a0bc 100644 --- a/Code-C/queue.c +++ b/Code-C/queue.c @@ -24,7 +24,7 @@ typedef struct queue *Pqueue; * @param lenChar size of char array that will be created * @return Pqueue new element created */ -Pqueue createE(int lenChar , char* _tabChar){ +Pqueue createE(int lenChar){ Pqueue new = (Pqueue) malloc(sizeof(struct queue)); assert(new); /* ???? tab char create or give pointer ???*/ @@ -55,18 +55,24 @@ char * gettabChar(Pqueue elem){ return elem->tabChar; } -Pqueue setCharLen(Pqueue elem , int _charLen){ +void setCharLen(Pqueue elem , int _charLen){ assert(elem); elem->charLen = _charLen; } -Pqueue setTabChar(Pqueue elem , int _charLen , char *_tabChar){ +void setTabChar(Pqueue elem , int _charLen , char *_tabChar){ assert(elem); elem->charLen = _charLen; elem->tabChar = (char *) malloc(_charLen * sizeof(char)); elem->tabChar = _tabChar; } +void setNextE(Pqueue elem , Pqueue next){ + assert(elem); + assert(next); + elem -> pNextE = next; +} + /** * @brief remove and free the last element of queue * @@ -129,10 +135,11 @@ Pqueue addLastQ(Pqueue elem, const char* str, int len){ previous = tmp; tmp = getNextE(tmp); } - tmp = createE(len); - tmp->tabChar = str; - tmp->charLen = len; - return tmp; + tmp -> pNextE = createE(len); + Pqueue next = getNextE(tmp); + next->tabChar = str; + next->charLen = len; + return next; } void printE(Pqueue elem){ diff --git a/Code-C/queue.h b/Code-C/queue.h index dbaed95..d23fab8 100644 --- a/Code-C/queue.h +++ b/Code-C/queue.h @@ -11,8 +11,10 @@ Pqueue getNextE(Pqueue elem); char * gettabChar(Pqueue elem); //Setters -Pqueue setCharLen(Pqueue elem , int _charLen); -Pqueue setTabChar(Pqueue elem , int _charLen , char *_tabChar); +void setCharLen(Pqueue elem , int _charLen); +void setTabChar(Pqueue elem , int _charLen , char *_tabChar); +void setNextE(Pqueue elem , Pqueue next); + Pqueue addLastQ(Pqueue elem, const char* str, int len); //Removers diff --git a/Code-C/simulateFlux.c b/Code-C/simulateFlux.c index e5538eb..7286853 100644 --- a/Code-C/simulateFlux.c +++ b/Code-C/simulateFlux.c @@ -107,7 +107,7 @@ bool writeOneRawData(FILE *rawDataFile){ } } cptData++; - sleep(0.004); //simul la freq ech + //sleep(0.004); //simul la freq ech return true; } else {