Projet mkd/find.c

De Wiki EELL.

(Différences entre les versions)
m (Fichier de commande des tests : Mise à jour)
m (find (included file) : Mise à jour)
Ligne 13 : Ligne 13 :
//P maj R 130509 alpha
//P maj R 130509 alpha
               { /*S find */
               { /*S find */
 +
/*O            mettre les drapeaux (options ABC... ) a 0 */
 +
                A=B=C=F=P=S=0;
                 L=0;
                 L=0;
                 // c is a register int defined in mkd.c
                 // c is a register int defined in mkd.c
Ligne 95 : Ligne 97 :
#ifdef UNIX_ONLY // C strict not in use with mkd see version.h
#ifdef UNIX_ONLY // C strict not in use with mkd see version.h
-
                     else if((c=='c'||c=='i'|| c=='h')&&d=='\0')
+
                     else if((c=='c'||c=='h')&&d=='\0')
                       {L=1;C=1;printf("C strict\n");}
                       {L=1;C=1;printf("C strict\n");}
#endif
#endif
Ligne 105 : Ligne 107 :
                       {L=1;j=1;printf("Project file\n");}
                       {L=1;j=1;printf("Project file\n");}
#endif
#endif
-
 
-
 
                     } /*S chercher */
                     } /*S chercher */
 +
                   
/*O                si le langage n'est pas trouvé: */
/*O                si le langage n'est pas trouvé: */
                     if(!L)
                     if(!L)
Ligne 131 : Ligne 132 :
                       else if(c=='p')p=1;
                       else if(c=='p')p=1;
                       else  
                       else  
-
                       { /*S*/printf("\n.Exit 2\n"); exit(2);} /*S*/
+
                       { /*S*/
-
                          printf("\n");
+
                          printf("\n.Exit 2\n"); exit(2);
-
                          L=A+B+C+F+P+S;
+
-
/*O                      si aucun drapeau langage n'est positionne envoyer BEL */
+
-
                          if(!(L==1||p||l))putch(0x7);
+
-
                          putch('\n');
+
                       } /*S*/
                       } /*S*/
 +
                      printf("\n");
 +
                      L=A+B+C+F+P+S;
 +
/*O                  si aucun drapeau langage n'est positionne envoyer BEL */
 +
                      if(!(L==1||p||l))putch(0x7);
 +
                      putch('\n'); 
 +
                    } /*S*/
               } /*S find */
               } /*S find */
 +
</pre>
 +
 +
* find.inc.i preprocessed file
 +
<pre>
 +
# 1 "find.inc.c"
 +
# 1 "<interne>"
 +
# 1 "<command-line>"
 +
# 1 "find.inc.c"
 +
 +
 +
              {
 +
 +
                A=B=C=F=P=S=0;
 +
                L=0;
 +
 +
                int d;
 +
                int e, f, g;
 +
                if(v) printf("Find Souce File Language, \'%s\':  ",fsrc);
 +
                if(k)
 +
                    {
 +
 +
                    c = tolower(fsrc[k+1]);
 +
                    if (c!='\0') d = tolower(fsrc[k+2]); else d='\0';
 +
                    if (d!='\0') e = tolower(fsrc[k+3]); else e='\0';
 +
 +
 +
 +
 +
 +
 +
 +
                    if(c=='a'&&d=='s'&&(e=='m'||e=='i'))
 +
                      {L=1;A=1;printf("ASM\n");}
 +
 +
                    else if( (c=='b'&&d=='a'&&e=='s') ||
 +
                            (c=='v'&&d=='b'&&e=='\0') ||
 +
                            (c=='b'&&d=='a'&&e=='t')
 +
                          )
 +
                      {L=1;B=1;printf("BASIC\n");}
 +
 +
                    else if(
 +
                            ( ((c=='c'||'h')&&d=='+'&&e=='+') ||
 +
                              ((c=='c'||'h')&&d=='-'&&e=='-') ||
 +
                              ((c=='c'||'h')&&d=='p'&&e=='p') ||
 +
                              (c=='c'&&d=='s'&&e=='s') ||
 +
                              (c=='c'&&d=='c'&&e=='\0') ||
 +
                              (c=='h'&&d=='h'&&e=='\0') ||
 +
                              (c=='c'&&d=='p'&&e=='\0') ||
 +
                              (c=='c'&&d=='s'&&e=='\0') ||
 +
                              (c=='c'&&d=='#'&&e=='\0') ||
 +
                              (c=='c'&&d=='\0') ||
 +
                              (c=='h'&&d=='\0') ||
 +
                              (c=='d'&&d=='\0') ||
 +
                              (c=='p'&&d=='r')&&e=='o') ||
 +
 +
                              (c=='p'&&d=='h'&&e=='p') ||
 +
                              (c=='j'&&d=='a'&&e=='v') ||
 +
                              (c=='j'&&d=='s'&&e=='e') ||
 +
                              (c=='j'&&d=='s'&&e=='\0')
 +
                            )
 +
                              {L=1;C=1;printf("C or PROLOG\n");}
 +
 +
                    else if(c=='f'&&d=='o'&&e=='r')
 +
                            {L=1;F=1;printf("FORTRAN\n");}
 +
 +
                    else if(c=='p'&&d=='a'&&e=='s')
 +
                        {L=1;P=1;printf("PASCAL\n");}
 +
 +
 +
 +
                    if(c=='s'&&d=='\0')
 +
                      {L=1;A=1;printf("Assembler\n");}
 +
 +
                    else if(c=='f'&&d=='\0')
 +
                      {L=1;F=1;printf("Fortran\n");}
 +
 +
                    else if(c=='p'&&d=='\0')
 +
                      {L=1;P=1;printf("Pascal\n");}
 +
 +
 +
 +
 +
                    else if( (c=='s'&&d=='h'&&e=='\0') ||
 +
                            (c=='c'&&d=='s'&&e=='h') ||
 +
                            (c=='p'&&d=='l'&&e=='\0') ||
 +
                            (c=='r'&&d=='b'&&e=='\0') ||
 +
                            (c=='p'&&d=='y'&&e=='\0') ||
 +
                            (c=='p'&&d=='y'&&e=='w') ||
 +
                            (c=='r'&&d=='\0')
 +
                          )
 +
                      {L=1;S=1;printf("Shell\n");}
 +
# 93 "find.inc.c"
 +
                    else if( (c=='p'&&d=='r'&&e=='j') ||
 +
                            (c=='p'&&d=='j'&&e=='\0')
 +
                          )
 +
                      {L=1;j=1;printf("Project file\n");}
 +
 +
                    }
 +
 +
 +
                    if(!L)
 +
 +
                    {
 +
 +
                      A=B=C=F=P=S=0;
 +
 +
                      printf("\n*** Source file: language not found. (Enter A,B,C,F,P,S,l or p)\n");
 +
 +
                      if(!j)printf("*** For project file: exit and use option -j.\n");
 +
 +
                      printf("Enter ESCAPE for exit ?:");
 +
                      if(j)printf("\b\bor space_bar for Ignore ?: ");
 +
                      if((c=getch())==0x1B){ printf("\n.Exit 1\n");exit(1);}
 +
                      else if(c=='A'||c=='a')A=1;
 +
                      else if(c=='B'||c=='b')B=1;
 +
                      else if(c=='C'||c=='c')C=1;
 +
                      else if(c=='F'||c=='f')F=1;
 +
                      else if(c=='P'||c=='p')P=1;
 +
                      else if(c=='S'||c=='s')S=1;
 +
                      else if (c=='l')l=1;
 +
                      else if(c=='p')p=1;
 +
                      else
 +
                      {
 +
                          printf("\n.Exit 2\n"); exit(2);
 +
                      }
 +
                      printf("\n");
 +
                      L=A+B+C+F+P+S;
 +
 +
                      if(!(L==1||p||l))putch(0x7);
 +
                      putch('\n');
 +
                    }
 +
              }
</pre>
</pre>
{{Boîte déroulante/fin}}
{{Boîte déroulante/fin}}

Version du 10 mai 2013 à 10:14

Retour aux fichiers en développement →

Sommaire

find (included file)

Fichier de commande des tests

Analyse des test konsole

Fichiers sources des tests

Outils personnels