5ba7f2cd6e6e5bd5e3d3604fcfa5fddca3ff50c6
[cacao.git] / src / cacaoh / headers.c
1 /* src/cacaoh/headers.c - functions for header generation
2
3    Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    Contact: cacao@cacaojvm.org
26
27    Authors: Reinhard Grafl
28
29    Changes: Mark Probst
30             Philipp Tomsich
31             Christian Thalinger
32
33    $Id: headers.c 4570 2006-03-07 18:18:44Z twisti $
34
35 */
36
37
38 #include <assert.h>
39 #include <ctype.h>
40 #include <stdarg.h>
41 #include <stdlib.h>
42 #include <string.h>
43
44 #include "config.h"
45 #include "vm/types.h"
46
47 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
48 # if defined(__DARWIN__)
49 #  include <signal.h>
50 # endif
51 # include <ucontext.h>
52 #endif
53
54 #include "mm/boehm.h"
55 #include "mm/memory.h"
56 #include "native/include/java_lang_String.h"
57 #include "native/include/java_lang_Throwable.h"
58 #include "toolbox/chain.h"
59 #include "toolbox/logging.h"
60 #include "vm/builtin.h"
61 #include "vm/class.h"
62 #include "vm/global.h"
63 #include "vm/method.h"
64 #include "vm/loader.h"
65 #include "vm/options.h"
66 #include "vm/stringlocal.h"
67 #include "vm/jit/asmpart.h"
68
69
70 #if defined(ENABLE_INTRP)
71 /* dummy interpreter stack to keep the compiler happy */
72
73 u1 *intrp_main_stack;
74 #endif
75
76
77 /* for raising exceptions from native methods *********************************/
78
79 #if !defined(USE_THREADS) || !defined(NATIVE_THREADS)
80 java_objectheader *_no_threads_exceptionptr = NULL;
81 #endif
82
83
84 /* replace some non-vmcore functions ******************************************/
85
86 functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
87                                                                 bool isstatic)
88 {
89         /* return something different than NULL, otherwise we get an exception */
90
91         return (functionptr) 1;
92 }
93
94 java_objectheader *native_new_and_init(classinfo *c) { return NULL; }
95 java_objectheader *native_new_and_init_string(classinfo *c, java_lang_String *s) { return NULL; }
96 java_objectheader *native_new_and_init_int(classinfo *c, s4 i) { return NULL; }
97 java_objectheader *native_new_and_init_throwable(classinfo *c, java_lang_Throwable *t) { return NULL; }
98
99
100 java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...)
101 { return NULL; }
102
103
104 /* code patching functions */
105 void patcher_builtin_arraycheckcast(u1 *sp) {}
106
107 #if defined(__MIPS__)
108 long compare_and_swap(long *p, long oldval, long newval)
109 {
110         if (*p == oldval) {
111                 *p = newval;
112                 return oldval;
113         } else
114                 return *p;
115 }
116 #endif
117
118
119 u1 *createcompilerstub(methodinfo *m) { return NULL; }
120 #if defined(ENABLE_INTRP)
121 u1 *intrp_createcompilerstub(methodinfo *m) { return NULL; }
122 #endif
123
124 u1 *codegen_createnativestub(functionptr f, methodinfo *m) { return NULL; }
125
126 void removecompilerstub(u1 *stub) {}
127 void removenativestub(u1 *stub) {}
128
129 void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop) {}
130 u1* asm_initialize_thread_stack(void *func, u1 *stack) { return NULL; }
131
132 void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p) { return NULL; }
133
134 void asm_handle_builtin_exception(classinfo *c) {}
135
136
137 #if defined(ENABLE_JIT)
138 void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out) {}
139 #endif
140
141 #if defined(ENABLE_INTRP)
142 void intrp_asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out) {}
143 #endif
144
145
146 void *Java_java_lang_VMObject_clone(void *env, void *clazz, void * this)
147 {
148         return NULL;
149 }
150
151 typecheck_result typeinfo_is_assignable_to_class(typeinfo *value,classref_or_classinfo dest)
152 {
153         return typecheck_TRUE;
154 }
155
156 void typeinfo_init_classinfo(typeinfo *info,classinfo *c)
157 {
158 }
159
160 bool typeinfo_init_class(typeinfo *info,classref_or_classinfo c)
161 {
162         return true;
163 }
164
165 void typeinfo_print(FILE *file,typeinfo *info,int indent) {}
166
167 void exceptions_print_exception(java_objectheader *xptr) {}
168 void stacktrace_print_trace(java_objectheader *xptr) {}
169
170
171 /* exception functions ********************************************************/
172
173 /* these should not be called */
174
175 void throw_main_exception_exit(void) { assert(0); }
176 void throw_exception(void) { assert(0); }
177 void throw_exception_exit(void) { assert(0); }
178
179 java_objectheader *new_verifyerror(methodinfo *m, const char *message)
180 {
181         assert(0);
182
183         /* keep compiler happy */
184
185         return NULL;
186 }
187
188 java_objectheader *new_exception_throwable(const char *classname, java_lang_Throwable *throwable)
189 {
190         assert(0);
191
192         /* keep compiler happy */
193
194         return NULL;
195 }
196
197
198 void throw_cacao_exception_exit(const char *exception, const char *message, ...)
199 {
200         va_list ap;
201
202         fprintf(stderr, "%s: ", exception);
203
204         va_start(ap, message);
205         vfprintf(stderr, message, ap);
206         va_end(ap);
207
208         fputc('\n', stderr);
209
210         exit(1);
211 }
212
213
214 void exceptions_throw_outofmemory_exit(void)
215 {
216         fprintf(stderr, "java.lang.InternalError: Out of memory\n");
217         exit(1);
218 }
219
220
221 java_objectheader *new_exception(const char *classname)
222 {
223         fprintf(stderr, "%s\n", classname);
224         exit(1);
225
226         /* keep compiler happy */
227
228         return NULL;
229 }
230
231
232 java_objectheader *new_exception_message(const char *classname, const char *message)
233 {
234         fprintf(stderr, "%s: %s\n", classname, message);
235         exit(1);
236
237         /* keep compiler happy */
238
239         return NULL;
240 }
241
242
243 java_objectheader *new_exception_utfmessage(const char *classname, utf *message)
244 {
245         fprintf(stderr, "%s: ", classname);
246         utf_display(message);
247         fputc('\n', stderr);
248
249         exit(1);
250
251         /* keep compiler happy */
252
253         return NULL;
254 }
255
256
257 java_objectheader *new_exception_javastring(const char *classname,
258                                                                                         java_lang_String *message)
259 {
260         fprintf(stderr, "%s: ", classname);
261         /* TODO print message */
262         fputc('\n', stderr);
263
264         exit(1);
265
266         /* keep compiler happy */
267
268         return NULL;
269 }
270
271
272 java_objectheader *new_classformaterror(classinfo *c, const char *message, ...)
273 {
274         va_list ap;
275
276         utf_display(c->name);
277         fprintf(stderr, ": ");
278
279         va_start(ap, message);
280         vfprintf(stderr, message, ap);
281         va_end(ap);
282
283         fputc('\n', stderr);
284
285         exit(1);
286
287         /* keep compiler happy */
288
289         return NULL;
290 }
291
292
293 void exceptions_throw_classformaterror(classinfo *c, const char *message, ...)
294 {
295         va_list ap;
296
297         va_start(ap, message);
298         (void) new_classformaterror(c, message, ap);
299         va_end(ap);
300 }
301
302
303 java_objectheader *new_classnotfoundexception(utf *name)
304 {
305         fprintf(stderr, "java.lang.ClassNotFoundException: ");
306         utf_fprint(stderr, name);
307         fputc('\n', stderr);
308
309         exit(1);
310
311         /* keep compiler happy */
312
313         return NULL;
314 }
315
316
317 java_objectheader *new_noclassdeffounderror(utf *name)
318 {
319         fprintf(stderr, "java.lang.NoClassDefFoundError: ");
320         utf_fprint(stderr, name);
321         fputc('\n', stderr);
322
323         exit(1);
324
325         /* keep compiler happy */
326
327         return NULL;
328 }
329
330
331 java_objectheader *exceptions_new_linkageerror(const char *message,
332                                                                                            classinfo *c)
333 {
334         fprintf(stderr, "java.lang.LinkageError: %s",message);
335         if (c) {
336                 utf_fprint_classname(stderr, c->name);
337         }
338         fputc('\n', stderr);
339
340         exit(1);
341
342         /* keep compiler happy */
343
344         return NULL;
345 }
346
347 java_objectheader *exceptions_new_nosuchmethoderror(classinfo *c,
348                                                                                                         utf *name, utf *desc)
349 {
350         fprintf(stderr, "java.lang.NoSuchMethodError: ");
351         utf_fprint(stderr, c->name);
352         fprintf(stderr, ".");
353         utf_fprint(stderr, name);
354         utf_fprint(stderr, desc);
355         fputc('\n', stderr);
356
357         exit(1);
358
359         /* keep compiler happy */
360
361         return NULL;
362 }
363
364
365 java_objectheader *new_internalerror(const char *message, ...)
366 {
367         va_list ap;
368
369         fprintf(stderr, "%s: ", string_java_lang_InternalError);
370
371         va_start(ap, message);
372         vfprintf(stderr, message, ap);
373         va_end(ap);
374
375         exit(1);
376
377         /* keep compiler happy */
378
379         return NULL;
380 }
381
382
383 java_objectheader *new_unsupportedclassversionerror(classinfo *c, const char *message, ...)
384 {
385         va_list ap;
386
387         fprintf(stderr, "%s: ", string_java_lang_UnsupportedClassVersionError);
388
389         utf_display(c->name);
390         fprintf(stderr, ": ");
391
392         va_start(ap, message);
393         vfprintf(stderr, message, ap);
394         va_end(ap);
395
396         exit(1);
397
398         /* keep compiler happy */
399
400         return NULL;
401 }
402
403
404 java_objectheader *new_illegalmonitorstateexception(void)
405 {
406         fprintf(stderr, "%s", string_java_lang_IllegalMonitorStateException);
407         exit(1);
408
409         /* keep compiler happy */
410
411         return NULL;
412 }
413
414
415 java_objectheader *new_negativearraysizeexception(void)
416 {
417         fprintf(stderr, "%s", string_java_lang_NegativeArraySizeException);
418         exit(1);
419
420         /* keep compiler happy */
421
422         return NULL;
423 }
424
425
426 void exceptions_throw_negativearraysizeexception(void)
427 {
428         (void) new_negativearraysizeexception();
429 }
430
431
432 java_objectheader *new_nullpointerexception(void)
433 {
434         fprintf(stderr, "%s", string_java_lang_NullPointerException);
435         exit(1);
436
437         /* keep compiler happy */
438
439         return NULL;
440 }
441
442
443 void exceptions_throw_nullpointerexception(void)
444 {
445         (void) new_nullpointerexception();
446 }
447
448
449 void classnotfoundexception_to_noclassdeffounderror(void)
450 {
451 }
452
453 /* machine dependent stuff ****************************************************/
454
455 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
456 threadcritnode asm_criticalsections;
457 void thread_restartcriticalsection(ucontext_t *uc) {}
458 #endif
459
460 void md_param_alloc(methoddesc *md) {}
461
462
463 #if defined(ENABLE_INTRP)
464 void print_dynamic_super_statistics(void) {}
465 #endif
466
467
468 /************************ global variables **********************/
469
470 chain *ident_chain;     /* chain with method and field names in current class */
471 FILE *file = NULL;
472 static u4 outputsize;
473 static bool dopadding;
474
475
476 static void printIDpart(int c)
477 {
478         if ((c >= 'a' && c <= 'z') ||
479                 (c >= 'A' && c <= 'Z') ||
480                 (c >= '0' && c <= '9') ||
481                 (c == '_'))
482                 putc(c, file);
483         else
484                 putc('_', file);
485 }
486
487
488 void printID(utf *u)
489 {
490         char *utf_ptr = u->text;
491         int i;
492
493         for (i = 0; i < utf_strlen(u); i++) 
494                 printIDpart(utf_nextu2(&utf_ptr));
495 }
496
497
498 static void addoutputsize (int len)
499 {
500         u4 newsize,i;
501         if (!dopadding) return;
502
503         newsize = ALIGN(outputsize, len);
504         
505         for (i = outputsize; i < newsize; i++) fprintf(file, "   u1 pad%d\n", (int) i);
506         outputsize = newsize;
507 }
508
509
510 void printOverloadPart(utf *desc)
511 {
512         char *utf_ptr=desc->text;
513         u2 c;
514
515         fprintf(file, "__");
516
517         while ((c = utf_nextu2(&utf_ptr)) != ')') {
518                 switch (c) {
519                 case 'I':
520                 case 'S':
521                 case 'B':
522                 case 'C':
523                 case 'Z':
524                 case 'J':
525                 case 'F':
526                 case 'D': 
527                         fprintf(file, "%c", (char) c);
528                         break;
529                 case '[':
530                         fprintf(file, "_3");
531                         break;
532                 case 'L':
533                         putc('L', file);
534                         while ((c = utf_nextu2(&utf_ptr)) != ';')
535                                 printIDpart(c);
536                         fprintf(file, "_2");
537                         break;
538                 case '(':
539                         break;
540                 default: 
541                         log_text("invalid method descriptor");
542                         assert(0);
543                 }
544         }
545 }
546
547 static char *printtype(char *utf_ptr)
548 {
549         u2 c;
550
551         switch (utf_nextu2(&utf_ptr)) {
552         case 'V': fprintf (file, "void");
553                 break;
554         case 'I':
555         case 'S':
556         case 'B':
557         case 'C':
558         case 'Z': addoutputsize (4);
559                 fprintf (file, "s4");
560                 break;
561         case 'J': addoutputsize (8);
562                 fprintf (file, "s8");
563                 break;
564         case 'F': addoutputsize (4);
565                 fprintf (file, "float");
566                 break;
567         case 'D': addoutputsize (8);
568                 fprintf (file, "double");
569                 break;
570         case '[':
571                 addoutputsize ( sizeof(java_arrayheader*) ); 
572                 switch (utf_nextu2(&utf_ptr)) {
573                 case 'I':  fprintf (file, "java_intarray*"); break;
574                 case 'J':  fprintf (file, "java_longarray*"); break;
575                 case 'Z':  fprintf (file, "java_booleanarray*"); break;
576                 case 'B':  fprintf (file, "java_bytearray*"); break;
577                 case 'S':  fprintf (file, "java_shortarray*"); break;
578                 case 'C':  fprintf (file, "java_chararray*"); break;
579                 case 'F':  fprintf (file, "java_floatarray*"); break;
580                 case 'D':  fprintf (file, "java_doublearray*"); break;
581                                 
582                 case '[': fprintf(file, "java_objectarray*");
583                         while ((c = utf_nextu2(&utf_ptr)) == '[');
584                         if (c == 'L')
585                                 while (utf_nextu2(&utf_ptr) != ';');
586                         break;
587                            
588                 case 'L':  fprintf(file, "java_objectarray*");
589                         while (utf_nextu2(&utf_ptr) != ';');
590                         break;
591                 default:
592                         log_text("invalid type descriptor");
593                         assert(0);
594                 }
595                 break;
596                 
597         case 'L': 
598                 addoutputsize ( sizeof(java_objectheader*));
599                 fprintf (file, "struct ");
600                 while ( (c = utf_nextu2(&utf_ptr)) != ';' ) printIDpart (c);     
601                 fprintf (file, "*");
602                 break;
603                                         
604         default:
605                 log_text("Unknown type in field descriptor");
606                 assert(0);
607         }
608         
609         return utf_ptr;
610 }
611
612
613 /***** determine the number of entries of a utf string in the ident chain *****/
614
615 static int searchidentchain_utf(utf *ident) 
616 {
617         utf *u = chain_first(ident_chain);     /* first element of list */
618         int count = 0;
619
620         while (u) {
621                 if (u==ident) count++;         /* string found */
622                 u = chain_next(ident_chain);   /* next element in list */ 
623         }
624
625         return count;
626 }
627
628
629 /************** print structure for direct access to objects ******************/
630
631 static void printfields(classinfo *c)
632 {
633         u4 i;
634         fieldinfo *f;
635         int ident_count;
636         
637         if (!c) {
638                 addoutputsize(sizeof(java_objectheader));
639                 fprintf(file, "   java_objectheader header;\n");
640                 return;
641         }
642                 
643         printfields(c->super.cls);
644         
645         for (i = 0; i < c->fieldscount; i++) {
646                 f = &(c->fields[i]);
647                 
648                 if (!(f->flags & ACC_STATIC)) {
649                         fprintf(file, "   ");
650                         printtype(f->descriptor->text);
651                         fprintf(file, " ");
652                         utf_fprint(file, f->name);
653
654                         /* rename multiple fieldnames */
655                         if ((ident_count = searchidentchain_utf(f->name)))
656                                 fprintf(file, "%d", ident_count - 1);
657                         chain_addlast(ident_chain, f->name);    
658
659                         fprintf(file, ";\n");
660                 }
661         }
662 }
663
664
665 /***************** store prototype for native method in file ******************/
666
667 void printmethod(methodinfo *m)
668 {
669         char *utf_ptr;
670         u2 paramnum = 1;
671
672         /* search for return-type in descriptor */      
673         utf_ptr = m->descriptor->text;
674         while (utf_nextu2(&utf_ptr) != ')');
675
676         /* create remarks */
677         fprintf(file, "\n/*\n * Class:     ");
678         utf_fprint(file, m->class->name);
679         fprintf(file, "\n * Method:    ");
680         utf_fprint(file, m->name);
681         fprintf(file, "\n * Signature: ");
682         utf_fprint(file, m->descriptor);
683         fprintf(file, "\n */\n");
684
685         /* create prototype */                  
686         fprintf(file, "JNIEXPORT ");
687         printtype(utf_ptr);
688         fprintf(file, " JNICALL Java_");
689         printID(m->class->name);
690
691         chain_addlast(ident_chain, m->name);
692
693         fprintf(file, "_");
694         printID(m->name);
695
696         /* ATTENTION: We use the methodinfo's isleafmethod variable as
697            nativelyoverloaded, so we can save some space during
698            runtime. */
699
700         if (m->isleafmethod)
701                 printOverloadPart(m->descriptor);
702
703         fprintf(file, "(JNIEnv *env");
704         
705         utf_ptr = m->descriptor->text + 1;
706                         
707         if (!(m->flags & ACC_STATIC)) {
708                 fprintf(file, ", struct ");
709                 printID(m->class->name);
710                 fprintf(file, "* this");
711
712         } else {
713                 fprintf(file, ", jclass clazz");
714         }
715
716         if ((*utf_ptr) != ')') fprintf(file, ", ");
717                         
718         while ((*utf_ptr) != ')') {
719                 utf_ptr = printtype(utf_ptr);
720                 fprintf(file, " par%d", paramnum++);
721                 if ((*utf_ptr)!=')') fprintf(file, ", ");
722         }
723                         
724         fprintf(file, ");\n\n");
725 }
726
727
728 /******* remove package-name in fully-qualified classname *********************/
729
730 void gen_header_filename(char *buffer, utf *u)
731 {
732         s4 i;
733   
734         for (i = 0; i < utf_strlen(u); i++) {
735                 if ((u->text[i] == '/') || (u->text[i] == '$')) {
736                         buffer[i] = '_';  /* convert '$' and '/' to '_' */
737
738                 } else {
739                         buffer[i] = u->text[i];
740                 }
741         }
742         buffer[utf_strlen(u)] = '\0';
743 }
744
745
746 /* create headerfile for classes and store native methods in chain ************/
747
748 void headerfile_generate(classinfo *c, char *opt_directory)
749 {
750         char header_filename[1024] = "";
751         char classname[1024]; 
752         char uclassname[1024];
753         u2 i;
754         methodinfo *m;                  
755         u2 j;
756         methodinfo *m2;
757         bool nativelyoverloaded;
758
759         /* prevent compiler warnings */
760
761         nativelyoverloaded = false;
762
763         /* open headerfile for class */
764         gen_header_filename(classname, c->name);
765
766         /* create chain for renaming fields */
767         ident_chain = chain_new();
768         
769         if (opt_directory) {
770                 sprintf(header_filename, "%s/%s.h", opt_directory, classname);
771
772         } else {
773                 sprintf(header_filename, "%s.h", classname);
774         }
775
776         file = fopen(header_filename, "w");
777         if (!file) {
778                 log_text("Can not open file to store header information");
779                 assert(0);
780         }
781
782         fprintf(file, "/* This file is machine generated, don't edit it! */\n\n");
783
784         /* convert to uppercase */
785         for (i = 0; classname[i]; i++) {
786                 uclassname[i] = toupper(classname[i]);
787         }
788         uclassname[i] = '\0';
789
790         fprintf(file, "#ifndef _%s_H\n#define _%s_H\n\n", uclassname, uclassname);
791
792         /* create structure for direct access to objects */     
793         fprintf(file, "/* Structure information for class: ");
794         utf_fprint(file, c->name);
795         fprintf(file, " */\n\n");
796         fprintf(file, "typedef struct ");
797         printID(c->name);                                                       
798         fprintf(file, " {\n");
799         outputsize = 0;
800         dopadding = true;
801
802         printfields(c);
803
804         fprintf(file, "} ");
805         printID(c->name);
806         fprintf(file, ";\n\n");
807
808         /* create chain for renaming overloaded methods */
809         chain_free(ident_chain);
810         ident_chain = chain_new();
811
812         /* create method-prototypes */
813                                 
814         /* find overloaded methods */
815
816         for (i = 0; i < c->methodscount; i++) {
817                 m = &(c->methods[i]);
818
819                 if (!(m->flags & ACC_NATIVE))
820                         continue;
821
822                 /* We use the methodinfo's isleafmethod variable as
823                    nativelyoverloaded, so we can save some space during
824                    runtime. */
825
826                 if (!m->isleafmethod) {
827                         nativelyoverloaded = false;
828
829                         for (j = i + 1; j < c->methodscount; j++) {
830                                 m2 = &(c->methods[j]);
831
832                                 if (!(m2->flags & ACC_NATIVE))
833                                         continue;
834
835                                 if (m->name == m2->name) {
836                                         m2->isleafmethod = true;
837                                         nativelyoverloaded = true;
838                                 }
839                         }
840                 }
841
842                 m->isleafmethod = nativelyoverloaded;
843         }
844
845         for (i = 0; i < c->methodscount; i++) {
846                 m = &(c->methods[i]);
847
848                 if (m->flags & ACC_NATIVE)
849                         printmethod(m);
850         }
851
852         chain_free(ident_chain);
853
854         fprintf(file, "#endif\n\n");
855
856         fclose(file);
857 }
858
859
860 /******** print classname, '$' used to seperate inner-class name ***********/
861
862 void print_classname(classinfo *clazz)
863 {
864         utf *u = clazz->name;
865     char *endpos  = u->text + u->blength;
866     char *utf_ptr = u->text; 
867         u2 c;
868
869     while (utf_ptr < endpos) {
870                 if ((c = utf_nextu2(&utf_ptr)) == '_')
871                         putc('$', file);
872                 else
873                         putc(c, file);
874         }
875
876
877
878 /*
879  * These are local overrides for various environment variables in Emacs.
880  * Please do not remove this and leave it at the end of the file, where
881  * Emacs will automagically detect them.
882  * ---------------------------------------------------------------------
883  * Local variables:
884  * mode: c
885  * indent-tabs-mode: t
886  * c-basic-offset: 4
887  * tab-width: 4
888  * End:
889  */