Projet mkd/find.c

De Wiki EELL.

(Différences entre les versions)
m
m (Mise à jour)
Ligne 2 : Ligne 2 :
<small>[[Projet mkd/Fichiers en développement|Retour aux fichiers en développement &rarr;]]</small>
<small>[[Projet mkd/Fichiers en développement|Retour aux fichiers en développement &rarr;]]</small>
-
: '''find.inc.h''' :
+
== find (included file) ==
-
<pre>
+
 
 +
{{boîte déroulante/début|titre=find.inc.c, find.inc.h}}
 +
* find.inc.h
 +
<pre style="color:orange">
#define ARGS_EXAM
#define ARGS_EXAM
</pre>
</pre>
-
: '''find.inc.c''' : Ce fichier est à revoir il n'est pas indépendant! ...--[[Utilisateur:JPL|jpl]] 19 décembre 2010 à 14:44 (UTC)
+
* find.inc.h
-
 
+
<pre style="color:blue">
-
<pre>
+
//P maj R3.11 04/01/91 par JPL
-
/*P maj R3.11 04/01/91 par JPL */
+
//P maj R 130509 alpha
-
                { /*S find */
+
              { /*S find */
                 L=0;
                 L=0;
 +
                // c is a register int defined in mkd.c
 +
                int d; // local variables
 +
                int e, f, g;
                 if(v) printf("Find Souce File Language, \'%s\':  ",fsrc);
                 if(v) printf("Find Souce File Language, \'%s\':  ",fsrc);
                 if(k)
                 if(k)
                     { /*S chercher */
                     { /*S chercher */
 +
                    //T char buffer[10]; //T tests only
 +
                    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 (e!='\0') f = tolower(fsrc[k+4]); else f='\0';
 +
                    // if (f!='\0') g = tolower(fsrc[k+4]); else g='\0';
 +
                    // if (g!='\0') h = tolower(fsrc[k+3]); else h='\0';
 +
                    //T buffer[0]=c; buffer[1]=d; buffer[2]=e; buffer[3]='\0'; //T Tests only
 +
                    //T printf("\nTests: **** tolower extension = %s\n",buffer); //T tests only
-
#ifndef UNIX_ONLY
+
#ifndef UNIX_ONLY // OK for PC and UNIX / LINUX. Not OK for C strict
-
                     if((tolower(fsrc[k+1]))=='a'&&
+
                     if(c=='a'&&d=='s'&&(e=='m'||e=='i'))
-
                      (tolower(fsrc[k+2]))=='s'&&
+
                      {L=1;A=1;printf("ASM\n");}
-
                      (tolower(fsrc[k+3]))=='m')               {L=1;A=1;printf("ASM\n");}
+
 
-
                     else if((tolower(fsrc[k+1]))=='b'&&
+
                     else if( (c=='b'&&d=='a'&&e=='s')  || // bas
-
                            (tolower(fsrc[k+2]))=='a'&&
+
                            (c=='v'&&d=='b'&&e=='\0') ||  // Visual bacic
-
                            (tolower(fsrc[k+3]))=='s')           {L=1;B=1;printf("BASIC\n");}
+
                            (c=='b'&&d=='a'&&e=='t')   // bat
-
                      else if(
+
                          )
-
                              ( ( (c=tolower(fsrc[k+1])) == 'c' ||
+
                      {L=1;B=1;printf("BASIC\n");}
-
                                                c=='h'||c=='i') &&
+
 
-
                                                fsrc[k+2]=='\0')
+
                    else if(
-
                                ||
+
                            ( ((c=='c'||'h')&&d=='+'&&e=='+') || // c++, h++
-
                                                  (c=='p'&&
+
                              ((c=='c'||'h')&&d=='-'&&e=='-') || // c--, h--
-
                                (tolower(fsrc[k+2]))=='r'&&
+
                              ((c=='c'||'h')&&d=='p'&&e=='p') || // cpp, hpp
-
                                (tolower(fsrc[k+3]))=='o')     ) {L=1;C=1;printf("C or PROLOG\n");}
+
                              (c=='c'&&d=='s'&&e=='s') ||  // css
-
                          else if((tolower(fsrc[k+1]))=='f'&&
+
                              (c=='c'&&d=='c'&&e=='\0') || // cc
-
                                  (tolower(fsrc[k+2]))=='o'&&
+
                              (c=='h'&&d=='h'&&e=='\0') || // hh
-
                                  (tolower(fsrc[k+3]))=='r')     {L=1;F=1;printf("FORTRAN\n");}
+
                              (c=='c'&&d=='p'&&e=='\0') || // cp=c#
-
                            else if((tolower(fsrc[k+1]))=='p'&&
+
                              (c=='c'&&d=='s'&&e=='\0') || // cs=c#
-
                                    (tolower(fsrc[k+2]))=='a'&&
+
                              (c=='c'&&d=='#'&&e=='\0') || // c#
-
                                    (tolower(fsrc[k+3]))=='s') {L=1;P=1;printf("PASCAL\n");}
+
                              (c=='c'&&d=='\0') || // C
 +
                              (c=='h'&&d=='\0') || // h
 +
                              (c=='d'&&d=='\0') || // D
 +
                              (c=='p'&&d=='r')&&e=='o') || // pro prolog
 +
//w see forward                  (c=='p'&&d=='l')&&d=='\0') || // pl perl, prolog
 +
                              (c=='p'&&d=='h'&&e=='p') || // PHP
 +
                              (c=='j'&&d=='a'&&e=='v') || // jav java
 +
                              (c=='j'&&d=='s'&&e=='e') || // jse javascript
 +
                              (c=='j'&&d=='s'&&e=='\0')   // js javascript
 +
                            )
 +
                              {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");}
#endif
#endif
-
#ifndef PC_ONLY
+
#ifndef PC_ONLY // OK for UNIX / LINUX
-
                     if((c=tolower(fsrc[k+1]))=='s'&&
+
                     if(c=='s'&&d=='\0')
-
                                  fsrc[k+2]=='\0')               {L=1;A=1;printf("Assembler\n");}
+
                      {L=1;A=1;printf("Assembler\n");}
-
                      else if(c=='f'&&fsrc[k+2]=='\0')         {L=1;F=1;printf("Fortran\n");}
+
 
-
                          else if(c=='p'&&fsrc[k+2]=='\0')       {L=1;P=1;printf("Pascal\n");}
+
                    else if(c=='f'&&d=='\0')
-
                            else if(                   c=='c'&&
+
                      {L=1;F=1;printf("Fortran\n");}
-
                                    (tolower(fsrc[k+2]))=='s'&&
+
 
-
                                    (tolower(fsrc[k+3]))=='h')     {L=1;S=1;printf("Cshell\n");}
+
                    else if(c=='p'&&d=='\0')
-
                                else if(                   c=='s'&&
+
                      {L=1;P=1;printf("Pascal\n");}
-
                                        (tolower(fsrc[k+2]))=='h'&&
+
 
-
                                        (tolower(fsrc[k+3]))=='\0') {L=1;S=1;printf("Shell\n");}
+
/*w Attention, il n'est pas coutumier de donner des extensions aux fichiers
-
                                  else if(c=='r'&&fsrc[k+2]=='\0') {L=1;S=1;printf("Ratfor\n");}
+
    shell. Il serait utile de vérifier la première ligne si c est NULL. Pour
 +
    cela il faudrait ouvrir et refermer le fichier source. */
 +
                    else if( (c=='s'&&d=='h'&&e=='\0') || // sh
 +
                            (c=='c'&&d=='s'&&e=='h') || // csh
 +
                            (c=='p'&&d=='l'&&e=='\0') || // pl perl
 +
                            (c=='r'&&d=='b'&&e=='\0') || // rb ruby
 +
                            (c=='p'&&d=='y'&&e=='\0') || // py python
 +
                            (c=='p'&&d=='y'&&e=='w') || // pyw python
 +
                            (c=='r'&&d=='\0') // ratfor
 +
                          )
 +
                      {L=1;S=1;printf("Shell\n");}
 +
 
#endif
#endif
-
#ifdef UNIX_ONLY
+
#ifdef UNIX_ONLY // C strict not in use with mkd see version.h
-
                                  else if((c=='c'||
+
                    else if((c=='c'||c=='i'|| c=='h')&&d=='\0')
-
                                            c=='i'|| c=='h')&&
+
                      {L=1;C=1;printf("C strict\n");}
-
                                            fsrc[k+2]=='\0')         {L=1;C=1;printf("C or C after cpp\n");}
+
#endif
#endif
#ifndef ARGS_EXAM
#ifndef ARGS_EXAM
-
                                      else if((tolower(fsrc[k+1]))=='p'&&
+
                    else if( (c=='p'&&d=='r'&&e=='j') || // prj mkd
-
                                              (tolower(fsrc[k+2]))=='r'&&
+
                            (c=='p'&&d=='j'&&e=='\0')   // pj mkd
-
                                              (tolower(fsrc[k+3]))=='j') {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 trouve: */
+
/*O                si le langage n'est pas trouvé: */
                     if(!L)
                     if(!L)
/*O                alors: */
/*O                alors: */
Ligne 82 : Ligne 124 :
                       if(j)printf("\b\bor space_bar for Ignore ?: ");
                       if(j)printf("\b\bor space_bar for Ignore ?: ");
                       if((c=getch())==0x1B){ /*S*/ printf("\n.Exit 1\n");exit(1);} /*S*/
                       if((c=getch())==0x1B){ /*S*/ printf("\n.Exit 1\n");exit(1);} /*S*/
-
                       else if(c=='A')A=1;
+
                       else if(c=='A'||c=='a')A=1;
-
                          else if(c=='B')B=1;
+
                      else if(c=='B'||c=='b')B=1;
-
                            else if(c=='C')C=1;
+
                      else if(c=='C'||c=='c')C=1;
-
                                else if(c=='F')F=1;
+
                      else if(c=='F'||c=='f')F=1;
-
                                  else if(c=='P')P=1;
+
                      else if(c=='P'||c=='p')P=1;
-
                                      else if(c=='S')S=1;
+
                      else if(c=='S'||c=='s')S=1;
-
                                        else if (c=='l')l=1;
+
                      else if (c=='l')l=1;
-
                                            else if(c=='p')p=1;
+
                      else if(c=='p')p=1;
-
                                              else { /*S*/printf("\n.Exit 2\n"); exit(2);} /*S*/
+
                      else  
-
                      printf("\n");
+
                      { /*S*/printf("\n.Exit 2\n"); exit(2);} /*S*/
-
                      L=A+B+C+F+P+S;
+
                          printf("\n");
-
/*O                   si aucun drapeau langage n'est positionne envoyer BEL */
+
                          L=A+B+C+F+P+S;
-
                      if(!(L==1||p||l))putch(0x7);
+
/*O                     si aucun drapeau langage n'est positionne envoyer BEL */
-
                      putch('\n');
+
                          if(!(L==1||p||l))putch(0x7);
-
                    } /*S*/
+
                          putch('\n');
-
                } /*S find */
+
                      } /*S*/
 +
              } /*S find */
</pre>
</pre>
 +
{{Boîte déroulante/fin}}
 +
 +
== Fichier de commande des tests ==
 +
 +
== Analyse des test konsole ==
 +
 +
== Fichiers sources des tests ==
[[Catégorie:Générateurs de documentation]]
[[Catégorie:Générateurs de documentation]]

Version du 9 mai 2013 à 17:53

Cette page n'est pas finie. Veuillez considérer le plan et le contenu comme incomplets et en préparation, temporaires et sujets à caution. Si vous souhaitez participer, il vous est recommandé de consulter sa page de discussion au préalable.

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