Quick Search:

View

Revision:
Expand:  
Changeset: MAIN:ragge:20050521142921

Diff

Diff from 1.42 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/pcc/pcc/cc/cc/cc.c

Annotated File View

ragge
1.42
1 /*      $Id: cc.c,v 1.42 2005/05/21 14:29:21 ragge Exp $        */
ragge
1.3
2 /*
3  * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code and documentation must retain the above
10  * copyright notice, this list of conditions and the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditionsand the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * All advertising materials mentioning features or use of this software
15  * must display the following acknowledgement:
16  *      This product includes software developed or owned by Caldera
17  *      International, Inc.
18  * Neither the name of Caldera International, Inc. nor the names of other
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
23  * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED.  IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
27  * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
ragge
1.2
35
ragge
1.1
36 /*
ragge
1.3
37  * Front-end to the C compiler.
ragge
1.18
38  *
39  * Brief description of its syntax:
40  * - Files that end with .c are passed via cpp->ccom->as->ld
41  * - Files that end with .s are passed as->ld
42  * - Files that end with .o are passed directly to ld
43  * - Multiple files may be given on the command line.
44  * - Unrecognized options are all sent directly to ld.
45  * -c or -S cannot be combined with -o if multiple files are given.
46  *
47  * This file should be rewritten readable.
ragge
1.1
48  */
ragge
1.9
49 #include <sys/types.h>
ragge
1.36
50 #include <sys/wait.h>
ragge
1.2
51
ragge
1.1
52 #include <stdio.h>
53 #include <ctype.h>
54 #include <signal.h>
ragge
1.4
55 #include <string.h>
56 #include <fcntl.h>
57 #include <unistd.h>
58 #include <stdlib.h>
ragge
1.36
59 #include <stdarg.h>
60 #include <libgen.h>
pj
1.38
61 #include <errno.h>
ragge
1.24
62
ragge
1.39
63 #include "../../config.h"
64
ragge
1.24
65 #include "ccconfig.h"
ragge
1.3
66 /* C command */
ragge
1.1
67
ragge
1.20
68 #define MKS(x) _MKS(x)
69 #define _MKS(x) #x
70
71 /*
72  * Many specific definitions, should be declared elsewhere.
73  */
74 #define STDINC    "/usr/include"
75
ragge
1.3
76 #define SBSIZE 10000
ragge
1.12
77 #define MAXINC 100
ragge
1.3
78 #define MAXFIL 100
ragge
1.12
79 #define MAXLIB 10000
ragge
1.14
80 #define MAXAV  10000
ragge
1.3
81 #define MAXOPT 100
82 char    *tmp3;
83 char    *tmp4;
ragge
1.1
84 char    *outfile;
pj
1.31
85 char *copy(char *as),*setsuf(char *aschar ch);
ragge
1.4
86 int getsuf(char []);
87 int main(intchar *[]);
ragge
1.36
88 void error(char *, ...);
89 void errorx(int evalchar *, ...);
ragge
1.4
90 int nodup(char **, char *);
91 int callsys(char [], char *[]);
92 int cunlink(char *);
ragge
1.36
93 void dexit(int eval);
ragge
1.4
94 void idexit(int);
pj
1.30
95 char *gettmp();
ragge
1.14
96 char    *av[MAXAV];
ragge
1.3
97 char    *clist[MAXFIL];
98 char    *llist[MAXLIB];
ragge
1.4
99 char    alist[20];
ragge
1.3
100 int dflag;
ragge
1.7
101 int     xflag;
ragge
1.3
102 int     pflag;
103 int     sflag;
104 int     cflag;
105 int     eflag;
106 int     gflag;
ragge
1.5
107 int     vflag;
ragge
1.7
108 int     tflag;
ragge
1.8
109 int     Eflag;
ragge
1.4
110 int     Oflag;
ragge
1.3
111 int     proflag;
ragge
1.1
112 int     exfail;
ragge
1.10
113 int     Xflag;
ragge
1.14
114 int     nostartfilesBstatic;
ragge
1.20
115 int     nostdinc;
ragge
1.14
116
ragge
1.23
117 char    *pass0 = LIBEXECDIR "/ccom";
118 char    *passp = LIBEXECDIR "/cpp";
ragge
1.20
119 char    *sysinc;
ragge
1.25
120 char *cppadd[] = CPPADD;
121 char *dynlinker[] = DYNLINKER;
122 char *crt0file = CRT0FILE;
123 char *startfiles[] = STARTFILES;
124 char *endfiles[] = ENDFILES;
125 char *cppmdadd[] = CPPMDADD;
ragge
1.1
126
ragge
1.4
127 int
pj
1.26
128 main(int argcchar *argv[])
129 {
ragge
1.15
130         char *t, *u;
ragge
1.1
131         char *assource;
ragge
1.3
132         char **pv, *ptemp[MAXOPT], **pvt;
ragge
1.36
133         int ncnlijcnxona;
ragge
1.3
134
ragge
1.36
135         i = nc = nl = nxo = 0;
ragge
1.3
136         pv = ptemp;
137         while(++i < argc) {
ragge
1.18
138                 if (argv[i][0] == '-')
139                 switch (argv[i][1]) {
ragge
1.3
140                 default:
141                         goto passa;
ragge
1.22
142
143                 case 'B'/* other search paths for binaries XXX support? */
144                         break;
145
ragge
1.10
146                 case 'X':
147                         Xflag++;
148                         break;
ragge
1.15
149                 case 'W'/* Ignore (most of) W-flags */
150                         if (strncmp(argv[i], "-Wl,"4) == 0) {
151                                 /* options to the linker */
152                                 t = &argv[i][4];
153                                 while ((u = strchr(t','))) {
154                                         *u++ = 0;
155                                         llist[nl++] = t;
156                                         t = u;
157                                 }
158                                 llist[nl++] = t;
159                         }
160                         break;
161
ragge
1.6
162                 case 'f'/* Ignore -ffreestanding */
163                         break;
ragge
1.14
164
ragge
1.25
165                 case 'g'/* create debug output */
166                         gflag++;
167                         break;
168
ragge
1.20
169                 case 'i':
170                         if (strcmp(argv[i], "-isystem") == 0) {
171                                 sysinc = argv[++i];
172                         } else
173                                 goto passa;
174                         break;
175
ragge
1.14
176                 case 'n'/* handle -n flags */
177                         if (strcmp(argv[i], "-nostdinc") == 0)
ragge
1.20
178                                 nostdinc++;
ragge
1.14
179                         else if (strcmp(argv[i], "-nostartfiles") == 0)
180                                 nostartfiles = 1;
181                         else
182                                 goto passa;
183                         break;
184
ragge
1.7
185                 case 'x':
186                         xflag++;
187                         i++; /* skip args */
188                         break;
189                 case 't':
190                         tflag++;
191                         break;
ragge
1.1
192                 case 'S':
193                         sflag++;
194                         cflag++;
ragge
1.3
195                         break;
ragge
1.1
196                 case 'o':
ragge
1.18
197                         if (outfile)
ragge
1.36
198                                 errorx(8"too many -o");
ragge
1.18
199                         outfile = argv[++i];
ragge
1.3
200                         break;
ragge
1.1
201                 case 'O':
ragge
1.4
202                         Oflag++;
ragge
1.3
203                         break;
ragge
1.1
204                 case 'p':
205                         proflag++;
ragge
1.3
206                         break;
ragge
1.1
207                 case 'E':
ragge
1.8
208                         Eflag++;
209                         break;
ragge
1.1
210                 case 'P':
211                         pflag++;
ragge
1.3
212                         *pv++ = argv[i];
ragge
1.1
213                 case 'c':
214                         cflag++;
ragge
1.3
215                         break;
216
ragge
1.24
217 #if 0
ragge
1.3
218                 case '2':
219                         if(argv[i][2] == '\0')
220                                 pref = "/lib/crt2.o";
221                         else {
222                                 pref = "/lib/crt20.o";
223                         }
224                         break;
ragge
1.24
225 #endif
ragge
1.1
226                 case 'D':
227                 case 'I':
228                 case 'U':
229                 case 'C':
ragge
1.20
230                         *pv++ = argv[i];
ragge
1.3
231                         if (pv >= ptemp+MAXOPT)
232                                 {
ragge
1.36
233                                 error("Too many DIUC options");
ragge
1.3
234                                 --pv;
235                                 }
236                         break;
237
ragge
1.1
238                 case 'd':
ragge
1.3
239                         dflag++;
ragge
1.4
240                         strncpy(alistargv[i], 19);
ragge
1.3
241                         break;
ragge
1.5
242                 case 'v':
ragge
1.39
243                         printf("%s\n"VERSSTR);
ragge
1.5
244                         vflag++;
245                         break;
ragge
1.14
246
247                 case 's':
248                         if (strcmp(argv[i], "-static") == 0)
249                                 Bstatic = 1;
250                         else
251                                 goto passa;
252                         break;
ragge
1.3
253                 } else {
254                 passa:
255                         t = argv[i];
ragge
1.11
256                         if (*argv[i] == '-' && argv[i][1] == 'L')
257                                 ;
258                         else if((c=getsuf(t))=='c' || c=='s'|| Eflag) {
ragge
1.3
259                                 clist[nc++] = t;
260                                 if (nc>=MAXFIL)
261                                         {
ragge
1.36
262                                         error("Too many source files");
ragge
1.3
263                                         exit(1);
264                                         }
265                                 t = setsuf(t'o');
266                         }
267                         if (nodup(llistt)) {
268                                 llist[nl++] = t;
269                                 if (nl >= MAXLIB)
270                                         {
ragge
1.36
271                                         error("Too many object/library files");
ragge
1.3
272                                         exit(1);
273                                         }
274                                 if (getsuf(t)=='o')
275                                         nxo++;
ragge
1.1
276                         }
277                 }
278         }
ragge
1.18
279         /* Sanity checking */
280         if (nc == 0 && nl == 0)
ragge
1.36
281                 errorx(8"no input files");
ragge
1.18
282         if (outfile && (cflag || sflag) && nc > 1)
ragge
1.36
283                 errorx(8"-o given with -c || -S and more than one file");
ragge
1.19
284         if (outfile && clist[0] && strcmp(outfileclist[0]) == 0)
ragge
1.36
285                 errorx(8"output file will be clobbered");
ragge
1.18
286
ragge
1.4
287         if (gflagOflag = 0;
ragge
1.24
288 #if 0
289         if (proflag)
ragge
1.3
290                 pref = "/lib/mcrt0.o";
ragge
1.24
291 #endif
ragge
1.3
292         if(nc==0)
293                 goto nocom;
294         if (pflag==0) {
pj
1.30
295                 tmp3 = gettmp();
296                 tmp4 = gettmp();
ragge
1.1
297         }
ragge
1.3
298         if (signal(SIGINTSIG_IGN) != SIG_IGN/* interrupt */
ragge
1.1
299                 signal(SIGINTidexit);
ragge
1.3
300         if (signal(SIGTERMSIG_IGN) != SIG_IGN)        /* terminate */
ragge
1.1
301                 signal(SIGTERMidexit);
ragge
1.3
302         pvt = pv;
ragge
1.1
303         for (i=0i<nci++) {
ragge
1.18
304                 /*
305                  * C preprocessor
306                  */
ragge
1.37
307                 if (nc>1 && !Eflag)
ragge
1.1
308                         printf("%s:\n"clist[i]);
pj
1.32
309                 assource = tmp3;
ragge
1.3
310                 if (getsuf(clist[i])=='s') {
ragge
1.1
311                         assource = clist[i];
ragge
1.7
312                         if (!xflag)
313                                 goto assemble;
pj
1.32
314                 }
ragge
1.1
315                 if (pflag)
316                         tmp4 = setsuf(clist[i], 'i');
ragge
1.5
317                 na = 0;
318                 av[na++] = "cpp";
ragge
1.20
319                 av[na++] = "-D__PCC__=" MKS(PCC_MAJOR);
ragge
1.40
320                 av[na++] = "-D__PCC_MINOR__=" MKS(PCC_MINOR);
321                 av[na++] = "-D__PCC_MINORMINOR__=" MKS(PCC_MINORMINOR);
ragge
1.20
322                 if (!nostdinc)
ragge
1.21
323                         av[na++] = "-S"av[na++] = STDINC;
ragge
1.20
324                 if (sysinc)
325                         av[na++] = "-S"av[na++] = sysinc;
ragge
1.5
326                 for (j = 0cppadd[j]; j++)
327                         av[na++] = cppadd[j];
ragge
1.24
328                 for (j = 0cppmdadd[j]; j++)
329                         av[na++] = cppmdadd[j];
ragge
1.7
330                 if (tflag)
ragge
1.20
331                         av[na++] = "-t";
ragge
1.7
332                 for(pv=ptemppv <pvtpv++)
333                         av[na++] = *pv;
ragge
1.5
334                 av[na++] = clist[i];
ragge
1.20
335                 if (!Eflag)
336                         av[na++] = tmp4;
ragge
1.3
337                 av[na++]=0;
338                 if (callsys(passpav))
339                         {exfail++; eflag++;}
ragge
1.11
340                 if (Eflag)
ragge
1.37
341                         continue;
ragge
1.7
342                 if (xflag)
343                         goto assemble;
ragge
1.18
344
345                 /*
346                  * C compiler
347                  */
ragge
1.25
348                 na = 0;
349                 av[na++]= "ccom";
350                 if (gflag)
351                         av[na++] = "-g";
ragge
1.42
352                 if (Oflag)
353                         av[na++] = "-O";
ragge
1.25
354                 av[na++] = tmp4;
ragge
1.3
355                 if (pflag || exfail)
356                         {
ragge
1.1
357                         cflag++;
358                         continue;
ragge
1.3
359                         }
ragge
1.16
360                 if(sflag) {
361                         if (outfile)
362                                 assource = tmp3 = outfile;
363                         else
364                                 assource = tmp3 = setsuf(clist[i], 's');
365                 }
ragge
1.25
366                 av[na++] = tmp3;
367 #if 0
ragge
1.3
368                 if (proflag) {
369                         av[3] = "-XP";
370                         av[4] = 0;
371                 } else
372                         av[3] = 0;
ragge
1.25
373 #endif
374                 av[na++] = NULL;
ragge
1.3
375                 if (callsys(pass0av)) {
ragge
1.1
376                         cflag++;
377                         eflag++;
378                         continue;
379                 }
380                 if (sflag)
381                         continue;
ragge
1.18
382
383                 /*
384                  * Assembler
385                  */
ragge
1.1
386         assemble:
ragge
1.3
387                 av[0] = "as";
388                 av[1] = "-o";
ragge
1.18
389                 if (outfile && cflag)
390                         av[2] = outfile;
391                 else
392                         av[2] = setsuf(clist[i], 'o');
ragge
1.7
393                 av[3] = xflag ? tmp4 : assource;
ragge
1.3
394                 if (dflag) {
395                         av[4] = alist;
396                         av[5] = 0;
397                 } else
398                         av[4] = 0;
ragge
1.21
399                 if (callsys("/bin/as"av)) {
ragge
1.1
400                         cflag++;
401                         eflag++;
ragge
1.7
402                         cunlink(tmp4);
ragge
1.1
403                         continue;
404                 }
ragge
1.7
405                 cunlink(tmp4);
ragge
1.1
406         }
ragge
1.18
407
ragge
1.37
408         if (Eflag)
409                 dexit(eflag);
410
ragge
1.18
411         /*
412          * Linker
413          */
ragge
1.1
414 nocom:
415         if (cflag==0 && nl!=0) {
ragge
1.6
416                 j = 0;
417                 av[j++] = "ld";
418                 av[j++] = "-X";
419                 av[j++] = "-d";
420                 av[j++] = "-e";
421                 av[j++] = "__start";
ragge
1.14
422                 if (Bstatic == 0) { /* Dynamic linkage */
ragge
1.24
423                         for (i = 0dynlinker[i]; i++)
424                                 av[j++] = dynlinker[i];
ragge
1.14
425                 }
ragge
1.1
426                 if (outfile) {
ragge
1.3
427                         av[j++] = "-o";
428                         av[j++] = outfile;
429                 }
ragge
1.14
430                 if (!nostartfiles) {
ragge
1.24
431                         av[j++] = crt0file;
432                         for (i = 0startfiles[i]; i++)
433                                 av[j++] = startfiles[i];
ragge
1.14
434                 }
ragge
1.24
435                 i = 0;
ragge
1.14
436                 while(i<nl) {
ragge
1.3
437                         av[j++] = llist[i++];
ragge
1.14
438                         if (j >= MAXAV)
ragge
1.36
439                                 error("Too many ld options");
ragge
1.14
440                 }
ragge
1.11
441 #if 0
ragge
1.3
442                 if (gflag)
443                         av[j++] = "-lg";
ragge
1.11
444 #endif
ragge
1.6
445                 av[j++] = "-lc";
ragge
1.14
446                 if (!nostartfiles) {
ragge
1.24
447                         for (i = 0endfiles[i]; i++)
448                                 av[j++] = endfiles[i];
ragge
1.14
449                 }
ragge
1.3
450                 av[j++] = 0;
451                 eflag |= callsys("/bin/ld"av);
ragge
1.1
452                 if (nc==1 && nxo==1 && eflag==0)
ragge
1.3
453                         cunlink(setsuf(clist[0], 'o'));
ragge
1.1
454         }
ragge
1.36
455         dexit(eflag);
ragge
1.4
456         return 0;
ragge
1.1
457 }
458
ragge
1.36
459 /*
460  * exit and cleanup after interrupt.
461  */
ragge
1.4
462 void
463 idexit(int arg)
ragge
1.1
464 {
ragge
1.36
465         dexit(100);
ragge
1.1
466 }
467
ragge
1.36
468 /*
469  * exit and cleanup.
470  */
ragge
1.4
471 void
ragge
1.36
472 dexit(int eval)
ragge
1.1
473 {
ragge
1.10
474         if (!pflag && !Xflag) {
ragge
1.1
475                 if (sflag==0)
476                         cunlink(tmp3);
477                 cunlink(tmp4);
478         }
ragge
1.36
479         exit(eval);
ragge
1.1
480 }
481
ragge
1.36
482 static void
483 ccerror(char *sva_list ap)
ragge
1.1
484 {
ragge
1.36
485         vfprintf(Eflag ? stderr : stdoutsap);
ragge
1.8
486         putc('\n'Eflagstderr : stdout);
ragge
1.1
487         exfail++;
488         cflag++;
489         eflag++;
490 }
491
ragge
1.36
492 /*
493  * complain a bit.
494  */
495 void
496 error(char *s, ...)
497 {
498         va_list ap;
499
500         va_start(aps);
501         ccerror(sap);
502         va_end(ap);
503 }
504
505 /*
506  * complain a bit and then exit.
507  */
ragge
1.18
508 void
ragge
1.36
509 errorx(int evalchar *s, ...)
ragge
1.18
510 {
ragge
1.36
511         va_list ap;
512
513         va_start(aps);
514         ccerror(sap);
515         va_end(ap);
516         dexit(eval);
ragge
1.18
517 }
ragge
1.3
518
ragge
1.4
519 int
ragge
1.3
520 getsuf(as)
521 char as[];
ragge
1.1
522 {
523         register char *s;
524
ragge
1.4
525         if ((s = strrchr(as'.')) && s[1] != '\0' && s[2] == '\0')
526                 return s[1];
ragge
1.3
527         return(0);
ragge
1.1
528 }
529
ragge
1.36
530 /*
531  * Get basename of string s and change its suffix to ch.
532  */
ragge
1.1
533 char *
ragge
1.36
534 setsuf(char *schar ch)
ragge
1.1
535 {
ragge
1.36
536         s = copy(basename(s));
pj
1.31
537         s[strlen(s) - 1] = ch;
ragge
1.36
538         return(s);
ragge
1.1
539 }
540
ragge
1.4
541 int
ragge
1.3
542 callsys(fv)
543 char f[], *v[]; {
ragge
1.1
544         int tstatus;
ragge
1.4
545         char *s;
ragge
1.5
546
547         if (vflag) {
ragge
1.41
548                 fprintf(stderr"%s "f);
549                 for (t = 1v[t]; t++)
ragge
1.6
550                         fprintf(stderr"%s "v[t]);
551                 fprintf(stderr"\n");
ragge
1.5
552         }
ragge
1.1
553
ragge
1.3
554         if ((t=fork())==0) {
ragge
1.1
555                 execv(fv);
ragge
1.4
556                 if ((s = strrchr(f'/')))
557                         execvp(s+1v);
ragge
1.1
558                 printf("Can't find %s\n"f);
ragge
1.3
559                 exit(100);
560         } else
561                 if (t == -1) {
562                         printf("Try again\n");
563                         return(100);
564                 }
565         while(t!=wait(&status));
ragge
1.1
566         if ((t=(status&0377)) != 0 && t!=14) {
ragge
1.3
567                 if (t!=2)               /* interrupt */
ragge
1.36
568                         errorx(8"Fatal error in %s"f);
569                 dexit(eflag);
ragge
1.1
570         }
ragge
1.3
571         return((status>>8) & 0377);
ragge
1.1
572 }
573
ragge
1.3
574 char *
pj
1.28
575 copy(char *as)
ragge
1.3
576 {
pj
1.28
577         char *p;
578
ragge
1.36
579         if ((p = strdup(as)) == NULL)
580                 errorx(8"no space for file names");
ragge
1.3
581
pj
1.28
582         return p;
ragge
1.3
583 }
584
ragge
1.4
585 int
ragge
1.3
586 nodup(los)
587 char **l, *os;
ragge
1.1
588 {
589         register char *t, *s;
590         register int c;
591
592         s = os;
593         if (getsuf(s) != 'o')
ragge
1.3
594                 return(1);
ragge
1.4
595         while((t = *l++)) {
596                 while((c = *s++))
ragge
1.1
597                         if (c != *t++)
598                                 break;
ragge
1.3
599                 if (*t=='\0' && c=='\0')
600                         return(0);
ragge
1.1
601                 s = os;
602         }
ragge
1.3
603         return(1);
ragge
1.1
604 }
605
ragge
1.4
606 int
ragge
1.3
607 cunlink(f)
608 char *f;
ragge
1.1
609 {
ragge
1.13
610         if (f==0 || Xflag)
ragge
1.3
611                 return(0);
612         return(unlink(f));
ragge
1.1
613 }
pj
1.30
614
615 char *
616 gettmp()
617 {
618         char *sfn = strdup("/tmp/ctm.XXXXXX");
619         int fd = -1;
620
621         if ((fd = mkstemp(sfn)) == -1) {
622                 fprintf(stderr"%s: %s\n"sfnstrerror(errno));
623                 exit(8);
624         }
625         close(fd);
626
627         return sfn;
628 }
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-01 14:21 +0200