aboutsummaryrefslogtreecommitdiff
path: root/french/dico/files/patch-sources-dico.c
blob: 31ce0103adbf60656d5a3cfe9afb2a44b16d0819 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
--- old/sources/dico.c	Thu Mar 27 14:57:57 1997
+++ new/sources/dico.c	Wed Oct 11 04:04:49 2000
@@ -19,8 +19,8 @@
     |                                                                       |
     +-----------------------------------------------------------------------+
 */
-#define LINUX
 
+#ifndef __FreeBSD__
 #ifndef LINUX
 #ifndef sony
 #ifndef MSDOS
@@ -28,6 +28,7 @@
 #endif
 #endif
 #endif
+#endif
 
 #ifdef sony                             /* Sony News WorkStations        */
 #define UNIX
@@ -42,6 +43,12 @@
 #define MYOS "LINUX" 
 #endif
 
+#ifdef __FreeBSD__                      /* FreeBSD Operating System        */ 
+#define UNIX
+#define ISO_CHARS
+#define MYOS "FreeBSD" 
+#endif
+
 #ifdef MSDOS                            /* Systeme d'operation de disque */
 #define MYOS "MSDOS"                    /* Microsoft :-)                 */
 #endif
@@ -51,8 +58,11 @@
 #define ISO_TERM    3
 #define COMMENT_CHAR 35                 /* '#' ligne de commentaire        */
 
-#define DICT_PATH "/usr/local/lib/dico"	 /* path par defaut unix/dos        */
+#ifndef MSDOS
+#define DICT_PATH "!!PREFIX!!/share/dico" /* path par defaut unix/dos        */
+#else
 #define DOS_PATH  "lexique"              /* path par defaut Dos uniquement  */
+#endif
 #define DICT_EXT ".dic"                  /* extension des fichiers dicos    */
 #define VERSION_FILE "version.dic"       /* fichier texte version dico      */
 
@@ -60,11 +70,13 @@
 #define OK    0
 #define MYVBUF 10240                     /* pour setvbuf() eventuel         */
 
+#ifndef __FreeBSD__
 #ifndef LINUX
 #ifndef sony
 #define MUST_HAVE_BUF                  /* Linux va moins vite avec setvbuf! */
 #endif
 #endif
+#endif
 
 typedef unsigned char byte;
 
@@ -147,7 +159,9 @@
     if(argv[1][0] =='-')                      /* option ligne commande?*/
         return   options( argv[1][1]  );
 
+#ifndef __FreeBSD__
     mybanner();                               /* on dit bonjour...     */
+#endif
 
     while( --argc)                            /* Allez, roulez !       */
     {
@@ -157,7 +171,9 @@
             lookfor( argv[argc] );
     }
 
+#ifndef __FreeBSD__
     fprintf(stderr,"\nTrouve %ld mot%s\n",count, count > 1 ? "s" :"" );
+#endif
 
        return OK ;
 }
@@ -369,7 +385,9 @@
     
     StrLwr( pattern );  /* passe en minuscules comme le dico */
     car = equival (pattern[0]);
+#ifndef __FreeBSD__
     fprintf(stderr, "Recherche %s dans la lettre %c... \n\n", pattern, car) ;
+#endif
 
     sprintf(fname, "%s%s%c%s", dict_path, sep, pattern[0], DICT_EXT ) ;
 
@@ -395,7 +413,11 @@
         if( fmatch(sbuf,pattern) )
         {
             translate( buf ); /* gere terminaux....   */
+#ifndef __FreeBSD__
             printf("\t%s\n", beautify(buf) );
+#else
+            printf("%s\n", beautify(buf) );
+#endif
             count ++ ;
         }
     }
@@ -451,8 +473,11 @@
             if( fmatch(sbuf,pattern) )
             { 
                 translate( buf ) ;
-                buf[0] = ToUpper( buf[0] ) ;  
+#ifndef __FreeBSD__
                 printf("\t%s\n", beautify (buf) );
+#else
+                printf("%s\n", beautify (buf) );
+#endif
                 count ++ ;
             } 
         }
@@ -474,7 +499,7 @@
 
 mybanner()
 {
-/*    printf("\nDICO V %s (%s) - R.Cougnenc 1992\n\n", __Version__, MYOS);*/
+    printf("\nDICO V %s (%s) - R.Cougnenc 1992\n\n", __Version__, MYOS);
 }
 /*--------------------------------------------------------------------------*/
 
@@ -526,7 +551,9 @@
    byte ville[50], code[6];
    byte *r = ville;
 
+/* #ifndef __FreeBSD__ */
    *str = ToUpper ( *str );                 /* Premiere lettre...     */
+/* #endif */
 
     if( ! strchr( str, '\t') )               /* Cas du nom commun      */
     {