Logo Search packages:      
Sourcecode: cafix version File versions  Download package

process.c

#include "custom.h"
int Pos, file, remainingfiles, fdev;
extern int numberfiles, argc, fileliststart;
extern char *buffer, *filename, *nom;
extern long taille;
cafixdata *data;

void processSend(char *argv[]) {
        remainingfiles=numberfiles;
        data = calloc(1, sizeof (cafixdata));
        openio();
        printf("Handshaking...");
        sendHandshake();
    if (numberfiles==0) { sendEnd(); }
    for (Pos=0;Pos<numberfiles;Pos++) {
         printf("file %d is %s : ", Pos, argv[fileliststart+Pos]);

         if ((file = open(argv[fileliststart+Pos], O_RDONLY)) < 0) {
                printf("file doesn't exist: skipping...\n"); }

        else {
                printf("file exists\n");
                nom=argv[fileliststart+Pos];
                printf("nom: %s\n", nom);
                 remainingfiles=remainingfiles-1;
                sendPG(); }}
}

void processReceive(char *argv[]) {
/*     remainingfiles=numberfiles; */
/*     for (Pos=0;Pos<numberfiles;Pos++) { */
/*     printf("file %d is %s : ", Pos, argv[fileliststart+Pos]); */
/*     if ((file = open(argv[fileliststart+Pos], O_RDONLY)) < 0) { printf("file doesn't exist: skipping...\n"); } */
/*     else { printf("file exists\n"); nom=argv[fileliststart+Pos]; buffer="coucou"; taille=7; send(); */
/*     printf("nom: %s\n", nom); buffer="coucou"; taille=7; printf("result: %d\n", Pos); */
    receivePG(argv);  //remainingfiles =-1; }}
}

Generated by  Doxygen 1.6.0   Back to index