- no more PHP-5.0 only tests
[m6w6/ext-http] / http_api.c
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #define HTTP_WANT_SAPI
16 #include "php_http.h"
17
18 #include "php_output.h"
19 #include "ext/standard/url.h"
20
21 #include "php_http_api.h"
22 #include "php_http_send_api.h"
23
24 #ifdef ZEND_ENGINE_2
25 # include "php_http_exception_object.h"
26 #endif
27
28 PHP_MINIT_FUNCTION(http_support)
29 {
30 HTTP_LONG_CONSTANT("HTTP_SUPPORT", HTTP_SUPPORT);
31 HTTP_LONG_CONSTANT("HTTP_SUPPORT_REQUESTS", HTTP_SUPPORT_REQUESTS);
32 HTTP_LONG_CONSTANT("HTTP_SUPPORT_MAGICMIME", HTTP_SUPPORT_MAGICMIME);
33 HTTP_LONG_CONSTANT("HTTP_SUPPORT_ENCODINGS", HTTP_SUPPORT_ENCODINGS);
34 HTTP_LONG_CONSTANT("HTTP_SUPPORT_SSLREQUESTS", HTTP_SUPPORT_SSLREQUESTS);
35
36 HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_COMMA", HTTP_PARAMS_ALLOW_COMMA);
37 HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_FAILURE", HTTP_PARAMS_ALLOW_FAILURE);
38 HTTP_LONG_CONSTANT("HTTP_PARAMS_RAISE_ERROR", HTTP_PARAMS_RAISE_ERROR);
39 HTTP_LONG_CONSTANT("HTTP_PARAMS_DEFAULT", HTTP_PARAMS_DEFAULT);
40
41 return SUCCESS;
42 }
43
44 PHP_HTTP_API long _http_support(long feature)
45 {
46 long support = HTTP_SUPPORT;
47
48 #ifdef HTTP_HAVE_CURL
49 support |= HTTP_SUPPORT_REQUESTS;
50 # ifdef HTTP_HAVE_SSL
51 support |= HTTP_SUPPORT_SSLREQUESTS;
52 # endif
53 #endif
54 #ifdef HTTP_HAVE_MAGIC
55 support |= HTTP_SUPPORT_MAGICMIME;
56 #endif
57 #ifdef HTTP_HAVE_ZLIB
58 support |= HTTP_SUPPORT_ENCODINGS;
59 #endif
60
61 if (feature) {
62 return (feature == (support & feature));
63 }
64 return support;
65 }
66
67 /* char *pretty_key(char *, size_t, zend_bool, zend_bool) */
68 char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen)
69 {
70 size_t i;
71 int wasalpha;
72
73 if (key && key_len) {
74 if ((wasalpha = HTTP_IS_CTYPE(alpha, key[0]))) {
75 key[0] = (char) (uctitle ? HTTP_TO_CTYPE(upper, key[0]) : HTTP_TO_CTYPE(lower, key[0]));
76 }
77 for (i = 1; i < key_len; i++) {
78 if (HTTP_IS_CTYPE(alpha, key[i])) {
79 key[i] = (char) (((!wasalpha) && uctitle) ? HTTP_TO_CTYPE(upper, key[i]) : HTTP_TO_CTYPE(lower, key[i]));
80 wasalpha = 1;
81 } else {
82 if (xhyphen && (key[i] == '_')) {
83 key[i] = '-';
84 }
85 wasalpha = 0;
86 }
87 }
88 }
89 return key;
90 }
91 /* }}} */
92
93 /* {{{ void http_error(long, long, char*) */
94 void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...)
95 {
96 va_list args;
97
98 va_start(args, format);
99 #ifdef ZEND_ENGINE_2
100 if ((type == E_THROW) || (PG(error_handling) == EH_THROW)) {
101 char *message;
102 zend_class_entry *ce = http_exception_get_for_code(code);
103
104 http_try {
105 vspprintf(&message, 0, format, args);
106 zend_throw_exception(ce, message, code TSRMLS_CC);
107 efree(message);
108 } http_catch(PG(exception_class) ? PG(exception_class) : HTTP_EX_DEF_CE);
109 } else
110 #endif
111 php_verror(NULL, "", type, format, args TSRMLS_CC);
112 va_end(args);
113 }
114 /* }}} */
115
116 #ifdef ZEND_ENGINE_2
117 static inline void copy_bt_args(zval *from, zval *to TSRMLS_DC)
118 {
119 zval **args, **trace_0, *old_trace_0, *trace = NULL;
120
121 if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), from, "trace", lenof("trace"), 0 TSRMLS_CC))) {
122 if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) {
123 old_trace_0 = *trace_0;
124 if (Z_TYPE_PP(trace_0) == IS_ARRAY && SUCCESS == zend_hash_find(Z_ARRVAL_PP(trace_0), "args", sizeof("args"), (void *) &args)) {
125 if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), to, "trace", lenof("trace"), 0 TSRMLS_CC))) {
126 if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) {
127 ZVAL_ADDREF(*args);
128 add_assoc_zval(*trace_0, "args", *args);
129 }
130 }
131 }
132 }
133 }
134 }
135
136 /* {{{ zval *http_exception_wrap(zval *, zval *, zend_class_entry *) */
137 zval *_http_exception_wrap(zval *old_exception, zval *new_exception, zend_class_entry *ce TSRMLS_DC)
138 {
139 int inner = 1;
140 char *message;
141 zval *sub_exception, *tmp_exception;
142
143 if (!new_exception) {
144 MAKE_STD_ZVAL(new_exception);
145 object_init_ex(new_exception, ce);
146
147 zend_update_property(ce, new_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC);
148 copy_bt_args(old_exception, new_exception TSRMLS_CC);
149
150 sub_exception = old_exception;
151
152 while ((sub_exception = zend_read_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(sub_exception) == IS_OBJECT) {
153 ++inner;
154 }
155
156 spprintf(&message, 0, "Exception caused by %d inner exception(s)", inner);
157 zend_update_property_string(ZEND_EXCEPTION_GET_DEFAULT(), new_exception, "message", lenof("message"), message TSRMLS_CC);
158 efree(message);
159 } else {
160 sub_exception = new_exception;
161 tmp_exception = new_exception;
162
163 while ((tmp_exception = zend_read_property(Z_OBJCE_P(tmp_exception), tmp_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(tmp_exception) == IS_OBJECT) {
164 sub_exception = tmp_exception;
165 }
166
167 zend_update_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC);
168 copy_bt_args(old_exception, new_exception TSRMLS_CC);
169 copy_bt_args(old_exception, sub_exception TSRMLS_CC);
170 }
171
172 zval_ptr_dtor(&old_exception);
173 return new_exception;
174 }
175 /* }}} */
176 #endif /* ZEND_ENGINE_2 */
177
178 /* {{{ void http_log(char *, char *, char *) */
179 void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC)
180 {
181 time_t now;
182 struct tm nowtm;
183 char datetime[20] = {0};
184
185 now = HTTP_G->request.time;
186 strftime(datetime, sizeof(datetime), "%Y-%m-%d %H:%M:%S", php_localtime_r(&now, &nowtm));
187
188 #define HTTP_LOG_WRITE(file, type, msg) \
189 if (file && *file) { \
190 php_stream *log = php_stream_open_wrapper_ex(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); \
191 \
192 if (log) { \
193 php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \
194 php_stream_close(log); \
195 } \
196 \
197 }
198
199 HTTP_LOG_WRITE(file, ident, message);
200 HTTP_LOG_WRITE(HTTP_G->log.composite, ident, message);
201 }
202 /* }}} */
203
204 static void http_ob_blackhole(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
205 {
206 *handled_output = ecalloc(1,1);
207 *handled_output_len = 0;
208 }
209
210 /* {{{ STATUS http_exit(int, char*, char*) */
211 STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC)
212 {
213 if ( (send_header && (SUCCESS != http_send_status_header(status, header))) ||
214 (status && (SUCCESS != http_send_status(status)))) {
215 http_error_ex(HE_WARNING, HTTP_E_HEADER, "Failed to exit with status/header: %d - %s", status, STR_PTR(header));
216 STR_FREE(header);
217 STR_FREE(body);
218 return FAILURE;
219 }
220
221 if (!OG(ob_lock)) {
222 php_end_ob_buffers(0 TSRMLS_CC);
223 }
224 if ((SUCCESS == sapi_send_headers(TSRMLS_C)) && body) {
225 PHPWRITE(body, strlen(body));
226 }
227
228 switch (status) {
229 case 301: http_log(HTTP_G->log.redirect, "301-REDIRECT", header); break;
230 case 302: http_log(HTTP_G->log.redirect, "302-REDIRECT", header); break;
231 case 303: http_log(HTTP_G->log.redirect, "303-REDIRECT", header); break;
232 case 305: http_log(HTTP_G->log.redirect, "305-REDIRECT", header); break;
233 case 307: http_log(HTTP_G->log.redirect, "307-REDIRECT", header); break;
234 case 304: http_log(HTTP_G->log.cache, "304-CACHE", header); break;
235 case 404: http_log(HTTP_G->log.not_found, "404-NOTFOUND", NULL); break;
236 case 405: http_log(HTTP_G->log.allowed_methods, "405-ALLOWED", header); break;
237 default: http_log(NULL, header, body); break;
238 }
239
240 STR_FREE(header);
241 STR_FREE(body);
242
243 if (HTTP_G->force_exit) {
244 zend_bailout();
245 } else {
246 php_ob_set_internal_handler(http_ob_blackhole, 4096, "blackhole", 0 TSRMLS_CC);
247 }
248
249 return SUCCESS;
250 }
251 /* }}} */
252
253 /* {{{ STATUS http_check_method(char *) */
254 STATUS _http_check_method_ex(const char *method, const char *methods)
255 {
256 const char *found;
257
258 if ( (found = strstr(methods, method)) &&
259 (found == method || !HTTP_IS_CTYPE(alpha, found[-1])) &&
260 (strlen(found) >= strlen(method) && !HTTP_IS_CTYPE(alpha, found[strlen(method)]))) {
261 return SUCCESS;
262 }
263 return FAILURE;
264 }
265 /* }}} */
266
267 /* {{{ zval *http_get_server_var_ex(char *, size_t) */
268 PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zend_bool check TSRMLS_DC)
269 {
270 zval **hsv, **var;
271 char *env;
272
273 /* if available, this is a lot faster than accessing $_SERVER */
274 if (sapi_module.getenv) {
275 if ((!(env = sapi_module.getenv((char *) key, key_size TSRMLS_CC))) || (check && !*env)) {
276 return NULL;
277 }
278 if (HTTP_G->server_var) {
279 zval_ptr_dtor(&HTTP_G->server_var);
280 }
281 MAKE_STD_ZVAL(HTTP_G->server_var);
282 ZVAL_STRING(HTTP_G->server_var, env, 1);
283 return HTTP_G->server_var;
284 }
285
286 #ifdef ZEND_ENGINE_2
287 zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC);
288 #endif
289
290 if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) {
291 return NULL;
292 }
293 if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), (char *) key, key_size, (void *) &var))) {
294 return NULL;
295 }
296 if (check && !((Z_TYPE_PP(var) == IS_STRING) && Z_STRVAL_PP(var) && Z_STRLEN_PP(var))) {
297 return NULL;
298 }
299 return *var;
300 }
301 /* }}} */
302
303 /* {{{ STATUS http_get_request_body(char **, size_t *) */
304 PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC)
305 {
306 *length = 0;
307 *body = NULL;
308
309 if (SG(request_info).raw_post_data) {
310 *length = SG(request_info).raw_post_data_length;
311 *body = SG(request_info).raw_post_data;
312
313 if (dup) {
314 *body = estrndup(*body, *length);
315 }
316 return SUCCESS;
317 } else if (sapi_module.read_post && !HTTP_G->read_post_data) {
318 char buf[4096];
319 int len;
320
321 HTTP_G->read_post_data = 1;
322
323 while (0 < (len = sapi_module.read_post(buf, sizeof(buf) TSRMLS_CC))) {
324 *body = erealloc(*body, *length + len + 1);
325 memcpy(*body + *length, buf, len);
326 *length += len;
327 (*body)[*length] = '\0';
328 }
329
330 /* check for error */
331 if (len < 0) {
332 STR_FREE(*body);
333 *length = 0;
334 return FAILURE;
335 }
336
337 SG(request_info).raw_post_data = *body;
338 SG(request_info).raw_post_data_length = *length;
339
340 if (dup) {
341 *body = estrndup(*body, *length);
342 }
343 return SUCCESS;
344 }
345
346 return FAILURE;
347 }
348 /* }}} */
349
350 /* {{{ php_stream *http_get_request_body_stream(void) */
351 PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D)
352 {
353 php_stream *s = NULL;
354
355 if (SG(request_info).raw_post_data) {
356 s = php_stream_open_wrapper("php://input", "rb", 0, NULL);
357 } else if (sapi_module.read_post && !HTTP_G->read_post_data) {
358 HTTP_G->read_post_data = 1;
359
360 if ((s = php_stream_temp_new())) {
361 char buf[4096];
362 int len;
363
364 while (0 < (len = sapi_module.read_post(buf, sizeof(buf) TSRMLS_CC))) {
365 php_stream_write(s, buf, len);
366 }
367
368 if (len < 0) {
369 php_stream_close(s);
370 s = NULL;
371 } else {
372 php_stream_rewind(s);
373 }
374 }
375 }
376
377 return s;
378 }
379 /* }}} */
380
381 /* {{{ void http_parse_params_default_callback(...) */
382 PHP_HTTP_API void _http_parse_params_default_callback(void *arg, const char *key, int keylen, const char *val, int vallen TSRMLS_DC)
383 {
384 char *kdup;
385 zval tmp, *entry;
386 HashTable *ht = (HashTable *) arg;
387
388 if (ht) {
389 INIT_ZARR(tmp, ht);
390
391 if (vallen) {
392 MAKE_STD_ZVAL(entry);
393 array_init(entry);
394 kdup = estrndup(key, keylen);
395 add_assoc_stringl_ex(entry, kdup, keylen + 1, (char *) val, vallen, 1);
396 efree(kdup);
397 add_next_index_zval(&tmp, entry);
398 } else {
399 add_next_index_stringl(&tmp, (char *) key, keylen, 1);
400 }
401 }
402 }
403 /* }}} */
404
405 /* {{{ STATUS http_parse_params(const char *, HashTable *) */
406 PHP_HTTP_API STATUS _http_parse_params_ex(const char *param, int flags, http_parse_params_callback cb, void *cb_arg TSRMLS_DC)
407 {
408 #define ST_QUOTE 1
409 #define ST_VALUE 2
410 #define ST_KEY 3
411 #define ST_ASSIGN 4
412 #define ST_ADD 5
413
414 int st = ST_KEY, keylen = 0, vallen = 0;
415 char *s, *c, *key = NULL, *val = NULL;
416
417 for(c = s = estrdup(param);;) {
418 #if 0
419 char *tk = NULL, *tv = NULL;
420
421 if (key) {
422 if (keylen) {
423 tk= estrndup(key, keylen);
424 } else {
425 tk = ecalloc(1, 7);
426 memcpy(tk, key, 3);
427 tk[3]='.'; tk[4]='.'; tk[5]='.';
428 }
429 }
430 if (val) {
431 if (vallen) {
432 tv = estrndup(val, vallen);
433 } else {
434 tv = ecalloc(1, 7);
435 memcpy(tv, val, 3);
436 tv[3]='.'; tv[4]='.'; tv[5]='.';
437 }
438 }
439 fprintf(stderr, "[%6s] %c \"%s=%s\"\n",
440 (
441 st == ST_QUOTE ? "QUOTE" :
442 st == ST_VALUE ? "VALUE" :
443 st == ST_KEY ? "KEY" :
444 st == ST_ASSIGN ? "ASSIGN" :
445 st == ST_ADD ? "ADD":
446 "HUH?"
447 ), *c?*c:'0', tk, tv
448 );
449 STR_FREE(tk); STR_FREE(tv);
450 #endif
451 continued:
452 switch (st) {
453 case ST_QUOTE:
454 quote:
455 if (*c == '"') {
456 if (*(c-1) == '\\') {
457 memmove(c-1, c, strlen(c)+1);
458 goto quote;
459 } else {
460 goto add;
461 }
462 } else {
463 if (!val) {
464 val = c;
465 }
466 if (!*c) {
467 --val;
468 st = ST_ADD;
469 }
470 }
471 break;
472
473 case ST_VALUE:
474 switch (*c) {
475 case '"':
476 if (!val) {
477 st = ST_QUOTE;
478 }
479 break;
480
481 case ' ':
482 break;
483
484 case ';':
485 case '\0':
486 goto add;
487 break;
488 case ',':
489 if (flags & HTTP_PARAMS_ALLOW_COMMA) {
490 goto add;
491 }
492 default:
493 if (!val) {
494 val = c;
495 }
496 break;
497 }
498 break;
499
500 case ST_KEY:
501 switch (*c) {
502 case ',':
503 if (flags & HTTP_PARAMS_ALLOW_COMMA) {
504 goto allow_comma;
505 }
506 case '\r':
507 case '\n':
508 case '\t':
509 case '\013':
510 case '\014':
511 goto failure;
512 break;
513
514 case '=':
515 if (key) {
516 keylen = c - key;
517 st = ST_VALUE;
518 } else {
519 goto failure;
520 }
521 break;
522
523 case ' ':
524 if (key) {
525 keylen = c - key;
526 st = ST_ASSIGN;
527 }
528 break;
529
530 case ';':
531 case '\0':
532 allow_comma:
533 if (key) {
534 keylen = c-- - key;
535 st = ST_ADD;
536 }
537 break;
538
539 default:
540 if (!key) {
541 key = c;
542 }
543 break;
544 }
545 break;
546
547 case ST_ASSIGN:
548 if (*c == '=') {
549 st = ST_VALUE;
550 } else if (!*c || *c == ';' || ((flags & HTTP_PARAMS_ALLOW_COMMA) && *c == ',')) {
551 st = ST_ADD;
552 } else if (*c != ' ') {
553 goto failure;
554 }
555 break;
556
557 case ST_ADD:
558 add:
559 if (val) {
560 vallen = c - val;
561 if (st != ST_QUOTE) {
562 while (val[vallen-1] == ' ') --vallen;
563 }
564 } else {
565 val = "";
566 vallen = 0;
567 }
568
569 cb(cb_arg, key, keylen, val, vallen TSRMLS_CC);
570
571 st = ST_KEY;
572 key = val = NULL;
573 keylen = vallen = 0;
574 break;
575 }
576 if (*c) {
577 ++c;
578 } else if (st == ST_ADD) {
579 goto add;
580 } else {
581 break;
582 }
583 }
584
585 efree(s);
586 return SUCCESS;
587
588 failure:
589 if (flags & HTTP_PARAMS_RAISE_ERROR) {
590 http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Unexpected character (%c) at pos %tu of %zu", *c, c-s, strlen(s));
591 }
592 if (flags & HTTP_PARAMS_ALLOW_FAILURE) {
593 --c;
594 st = ST_ADD;
595 goto continued;
596 }
597 efree(s);
598 return FAILURE;
599 }
600 /* }}} */
601
602 /* {{{ array_join */
603 int apply_array_append_func(void *pDest, int num_args, va_list args, zend_hash_key *hash_key)
604 {
605 int flags;
606 char *key = NULL;
607 HashTable *dst;
608 zval **data = NULL, **value = (zval **) pDest;
609
610 dst = va_arg(args, HashTable *);
611 flags = va_arg(args, int);
612
613 if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) {
614 if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) {
615 key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1);
616 zend_hash_find(dst, key, hash_key->nKeyLength, (void *) &data);
617 } else {
618 zend_hash_quick_find(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) &data);
619 }
620
621 ZVAL_ADDREF(*value);
622 if (data) {
623 if (Z_TYPE_PP(data) != IS_ARRAY) {
624 convert_to_array(*data);
625 }
626 add_next_index_zval(*data, *value);
627 } else if (key) {
628 zend_hash_add(dst, key, hash_key->nKeyLength, value, sizeof(zval *), NULL);
629 } else {
630 zend_hash_quick_add(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, value, sizeof(zval *), NULL);
631 }
632
633 if (key) {
634 efree(key);
635 }
636 }
637
638 return ZEND_HASH_APPLY_KEEP;
639 }
640
641 int apply_array_merge_func(void *pDest, int num_args, va_list args, zend_hash_key *hash_key)
642 {
643 int flags;
644 char *key = NULL;
645 HashTable *dst;
646 zval **value = (zval **) pDest;
647
648 dst = va_arg(args, HashTable *);
649 flags = va_arg(args, int);
650
651 if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) {
652 ZVAL_ADDREF(*value);
653 if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) {
654 key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1);
655 zend_hash_update(dst, key, hash_key->nKeyLength, (void *) value, sizeof(zval *), NULL);
656 efree(key);
657 } else {
658 zend_hash_quick_update(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) value, sizeof(zval *), NULL);
659 }
660 }
661
662 return ZEND_HASH_APPLY_KEEP;
663 }
664 /* }}} */
665
666 /*
667 * Local variables:
668 * tab-width: 4
669 * c-basic-offset: 4
670 * End:
671 * vim600: noet sw=4 ts=4 fdm=marker
672 * vim<600: noet sw=4 ts=4
673 */
674