2 * collection4 - graph_list.c
3 * Copyright (C) 2010 Florian octo Forster
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301 USA
21 * Florian octo Forster <ff at octo.it>
34 #include <sys/types.h>
37 #include <yajl/yajl_parse.h>
39 #include "graph_list.h"
41 #include "data_provider.h"
42 #include "filesystem.h"
44 #include "graph_config.h"
45 #include "graph_def.h"
46 #include "graph_ident.h"
47 #include "graph_instance.h"
48 #include "utils_cgi.h"
49 #include "utils_search.h"
52 #include <fcgi_stdio.h>
57 #define UPDATE_INTERVAL 900
62 static graph_config_t **gl_active = NULL;
63 static size_t gl_active_num = 0;
65 static graph_config_t **gl_staging = NULL;
66 static size_t gl_staging_num = 0;
68 /* Graphs created on-the-fly for files which don't match any existing graph
70 static graph_config_t **gl_dynamic = NULL;
71 static size_t gl_dynamic_num = 0;
73 static char **host_list = NULL;
74 static size_t host_list_len = 0;
76 static time_t gl_last_update = 0;
81 static int gl_add_graph_internal (graph_config_t *cfg, /* {{{ */
82 graph_config_t ***gl_array, size_t *gl_array_num)
86 #define ARRAY_PTR (*gl_array)
87 #define ARRAY_SIZE (*gl_array_num)
92 tmp = realloc (ARRAY_PTR, sizeof (*ARRAY_PTR) * (ARRAY_SIZE + 1));
97 ARRAY_PTR[ARRAY_SIZE] = cfg;
104 } /* }}} int gl_add_graph_internal */
106 static void gl_destroy (graph_config_t ***gl_array, /* {{{ */
107 size_t *gl_array_num)
111 if ((gl_array == NULL) || (gl_array_num == NULL))
114 #define ARRAY_PTR (*gl_array)
115 #define ARRAY_SIZE (*gl_array_num)
117 for (i = 0; i < ARRAY_SIZE; i++)
119 graph_destroy (ARRAY_PTR[i]);
128 } /* }}} void gl_destroy */
130 static int gl_register_host (const char *host) /* {{{ */
138 for (i = 0; i < host_list_len; i++)
139 if (strcmp (host_list[i], host) == 0)
142 tmp = realloc (host_list, sizeof (*host_list) * (host_list_len + 1));
147 host_list[host_list_len] = strdup (host);
148 if (host_list[host_list_len] == NULL)
153 } /* }}} int gl_register_host */
155 static int gl_clear_hosts (void) /* {{{ */
159 for (i = 0; i < host_list_len; i++)
167 } /* }}} int gl_clear_hosts */
169 static int gl_compare_hosts (const void *v0, const void *v1) /* {{{ */
171 return (strcmp (*(char * const *) v0, *(char * const *) v1));
172 } /* }}} int gl_compare_hosts */
174 static int gl_register_file (const graph_ident_t *file, /* {{{ */
175 __attribute__((unused)) void *user_data)
181 for (i = 0; i < gl_active_num; i++)
183 graph_config_t *cfg = gl_active[i];
186 if (!graph_ident_matches (cfg, file))
189 status = graph_add_file (cfg, file);
202 cfg = graph_create (file);
203 gl_add_graph_internal (cfg, &gl_dynamic, &gl_dynamic_num);
204 graph_add_file (cfg, file);
207 gl_register_host (ident_get_host (file));
210 } /* }}} int gl_register_file */
212 static int gl_register_ident (graph_ident_t *ident, /* {{{ */
213 __attribute__((unused)) void *user_data)
215 /* TODO: Check for duplicates if multiple data providers are used. */
217 return (gl_register_file (ident, user_data));
218 } /* }}} int gl_register_ident */
220 static const char *get_part_from_param (const char *prim_key, /* {{{ */
225 val = param (prim_key);
229 return (param (sec_key));
230 } /* }}} const char *get_part_from_param */
232 static int gl_clear_instances (void) /* {{{ */
236 for (i = 0; i < gl_active_num; i++)
237 graph_clear_instances (gl_active[i]);
240 } /* }}} int gl_clear_instances */
242 static void gl_dump_cb (void *ctx, /* {{{ */
243 const char *str, unsigned int len)
245 int fd = *((int *) ctx);
251 buffer_size = (size_t) len;
252 while (buffer_size > 0)
254 status = write (fd, buffer, buffer_size);
257 fprintf (stderr, "write(2) failed with status %i\n", errno);
262 buffer_size -= status;
264 } /* }}} void gl_dump_cb */
266 static int gl_update_cache (void) /* {{{ */
270 yajl_gen_config handler_config = { /* pretty = */ 1, /* indent = */ " " };
271 const char *cache_file = graph_config_get_cachefile ();
277 memset (&statbuf, 0, sizeof (statbuf));
278 status = stat (cache_file, &statbuf);
281 if (statbuf.st_mtime >= gl_last_update)
282 /* Not writing to cache because it's at least as new as our internal data */
288 fprintf (stderr, "gl_update_cache: stat(2) failed with status %i\n",
290 /* Continue writing the file if possible. */
293 fd = open (cache_file, O_WRONLY | O_TRUNC | O_CREAT,
294 S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
298 fprintf (stderr, "gl_update_cache: open(2) failed with status %i\n",
303 memset (&lock, 0, sizeof (lock));
304 lock.l_type = F_WRLCK;
305 lock.l_whence = SEEK_SET;
307 lock.l_len = 0; /* lock everything */
311 status = fcntl (fd, F_SETLKW, &lock);
318 fprintf (stderr, "gl_update_cache: fcntl(2) failed with status %i\n", errno);
323 handler = yajl_gen_alloc2 (gl_dump_cb, &handler_config,
324 /* alloc funcs = */ NULL, /* ctx = */ &fd);
331 fprintf (stderr, "gl_update_cache: Start writing data\n");
334 yajl_gen_array_open (handler);
336 for (i = 0; i < gl_active_num; i++)
337 graph_to_json (gl_active[i], handler);
339 for (i = 0; i < gl_dynamic_num; i++)
340 graph_to_json (gl_dynamic[i], handler);
342 yajl_gen_array_close (handler);
344 yajl_gen_free (handler);
347 fprintf (stderr, "gl_update_cache: Finished writing data\n");
351 } /* }}} int gl_update_cache */
354 * JSON parsing functions
356 #define CTX_MASK 0xff000000
357 #define CTX_GRAPH 0x01000000
358 #define CTX_GRAPH_SELECT 0x02000000
359 #define CTX_INST 0x03000000
360 #define CTX_INST_SELECT 0x04000000
361 #define CTX_INST_FILE 0x05000000
363 #define CTX_IDENT_MASK 0x00ff0000
364 #define CTX_IDENT_HOST 0x00010000
365 #define CTX_IDENT_PLUGIN 0x00020000
366 #define CTX_IDENT_PLUGIN_INSTANCE 0x00030000
367 #define CTX_IDENT_TYPE 0x00040000
368 #define CTX_IDENT_TYPE_INSTANCE 0x00050000
370 struct gl_json_context_s
375 graph_instance_t *inst;
376 graph_ident_t *ident;
380 typedef struct gl_json_context_s gl_json_context_t;
382 static void set_state (gl_json_context_t *ctx, /* {{{ */
383 uint32_t new_state, uint32_t mask)
385 uint32_t old_state = ctx->state;
386 ctx->state = (old_state & ~mask) | (new_state & mask);
387 } /* }}} void set_state */
389 static int gl_json_string (void *user_data, /* {{{ */
390 const unsigned char *str,
391 unsigned int str_length)
393 gl_json_context_t *ctx = user_data;
394 char buffer[str_length + 1];
396 memcpy (buffer, str, str_length);
397 buffer[str_length] = 0;
399 if (((ctx->state & CTX_MASK) == CTX_GRAPH_SELECT)
400 || ((ctx->state & CTX_MASK) == CTX_INST_SELECT)
401 || ((ctx->state & CTX_MASK) == CTX_INST_FILE))
403 switch (ctx->state & CTX_IDENT_MASK)
406 ident_set_host (ctx->ident, buffer);
408 case CTX_IDENT_PLUGIN:
409 ident_set_plugin (ctx->ident, buffer);
411 case CTX_IDENT_PLUGIN_INSTANCE:
412 ident_set_plugin_instance (ctx->ident, buffer);
415 ident_set_type (ctx->ident, buffer);
417 case CTX_IDENT_TYPE_INSTANCE:
418 ident_set_type_instance (ctx->ident, buffer);
424 } /* }}} int gl_json_string */
426 static int gl_json_start_map (void *user_data) /* {{{ */
428 gl_json_context_t *ctx = user_data;
430 if (((ctx->state & CTX_MASK) == CTX_GRAPH_SELECT)
431 || ((ctx->state & CTX_MASK) == CTX_INST_SELECT)
432 || ((ctx->state & CTX_MASK) == CTX_INST_FILE))
434 assert (ctx->ident == NULL);
435 ctx->ident = ident_create (ANY_TOKEN,
436 ANY_TOKEN, ANY_TOKEN,
437 ANY_TOKEN, ANY_TOKEN);
441 } /* }}} int gl_json_start_map */
443 static int gl_json_end_map (void *user_data) /* {{{ */
445 gl_json_context_t *ctx = user_data;
447 if ((ctx->state & CTX_MASK) == CTX_GRAPH_SELECT)
451 /* ctx->ident should now hold the valid selector */
452 assert (ctx->cfg == NULL);
453 assert (ctx->inst == NULL);
454 assert (ctx->ident != NULL);
456 for (i = 0; i < gl_active_num; i++)
458 if (graph_compare (gl_active[i], ctx->ident) != 0)
461 ctx->cfg = gl_active[i];
462 ctx->dynamic_graph = 0;
466 if (ctx->cfg == NULL)
468 ctx->cfg = graph_create (ctx->ident);
469 ctx->dynamic_graph = 1;
472 ident_destroy (ctx->ident);
475 set_state (ctx, CTX_GRAPH, CTX_MASK);
477 else if ((ctx->state & CTX_MASK) == CTX_INST_SELECT)
479 /* ctx->ident should now hold the valid selector */
480 assert (ctx->cfg != NULL);
481 assert (ctx->inst == NULL);
482 assert (ctx->ident != NULL);
484 ctx->inst = inst_create (ctx->cfg, ctx->ident);
485 ident_destroy (ctx->ident);
488 set_state (ctx, CTX_INST, CTX_MASK);
490 else if ((ctx->state & CTX_MASK) == CTX_INST_FILE)
492 /* ctx->ident should now hold the valid file */
493 assert (ctx->cfg != NULL);
494 assert (ctx->inst != NULL);
495 assert (ctx->ident != NULL);
497 inst_add_file (ctx->inst, ctx->ident);
498 ident_destroy (ctx->ident);
501 /* Don't reset the state here, files are in an array. */
503 else if ((ctx->state & CTX_MASK) == CTX_INST)
505 /* ctx->inst should now hold a complete instance */
506 assert (ctx->cfg != NULL);
507 assert (ctx->inst != NULL);
508 assert (ctx->ident == NULL);
510 graph_add_inst (ctx->cfg, ctx->inst);
511 /* don't destroy / free ctx->inst */
514 /* Don't reset the state here, instances are in an array. */
516 else if ((ctx->state & CTX_MASK) == CTX_GRAPH)
518 /* ctx->cfg should now hold a complete graph */
519 assert (ctx->cfg != NULL);
520 assert (ctx->inst == NULL);
521 assert (ctx->ident == NULL);
523 if (ctx->dynamic_graph)
524 gl_add_graph_internal (ctx->cfg, &gl_dynamic, &gl_dynamic_num);
525 /* else: already contained in gl_active */
528 /* Don't reset the state here, graphs are in an array. */
532 } /* }}} int gl_json_end_map */
534 static int gl_json_end_array (void *user_data) /* {{{ */
536 gl_json_context_t *ctx = user_data;
538 if ((ctx->state & CTX_MASK) == CTX_INST_FILE)
539 set_state (ctx, CTX_INST, CTX_MASK);
540 else if ((ctx->state & CTX_MASK) == CTX_INST)
541 set_state (ctx, CTX_GRAPH, CTX_MASK);
542 else if ((ctx->state & CTX_MASK) == CTX_GRAPH)
548 } /* }}} int gl_json_end_array */
550 static int gl_json_key (void *user_data, /* {{{ */
551 const unsigned char *str,
552 unsigned int str_length)
554 gl_json_context_t *ctx = user_data;
555 char buffer[str_length + 1];
557 memcpy (buffer, str, str_length);
558 buffer[str_length] = 0;
560 if ((ctx->state & CTX_MASK) == CTX_GRAPH)
562 if (strcasecmp ("select", buffer) == 0)
563 set_state (ctx, CTX_GRAPH_SELECT, CTX_MASK);
564 else if (strcasecmp ("instances", buffer) == 0)
565 set_state (ctx, CTX_INST, CTX_MASK);
567 else if ((ctx->state & CTX_MASK) == CTX_INST)
569 if (strcasecmp ("select", buffer) == 0)
570 set_state (ctx, CTX_INST_SELECT, CTX_MASK);
571 else if (strcasecmp ("files", buffer) == 0)
572 set_state (ctx, CTX_INST_FILE, CTX_MASK);
574 else if (((ctx->state & CTX_MASK) == CTX_GRAPH_SELECT)
575 || ((ctx->state & CTX_MASK) == CTX_INST_SELECT)
576 || ((ctx->state & CTX_MASK) == CTX_INST_FILE))
578 assert (ctx->ident != NULL);
580 if (strcasecmp ("host", buffer) == 0)
581 set_state (ctx, CTX_IDENT_HOST, CTX_IDENT_MASK);
582 else if (strcasecmp ("plugin", buffer) == 0)
583 set_state (ctx, CTX_IDENT_PLUGIN, CTX_IDENT_MASK);
584 else if (strcasecmp ("plugin_instance", buffer) == 0)
585 set_state (ctx, CTX_IDENT_PLUGIN_INSTANCE, CTX_IDENT_MASK);
586 else if (strcasecmp ("type", buffer) == 0)
587 set_state (ctx, CTX_IDENT_TYPE, CTX_IDENT_MASK);
588 else if (strcasecmp ("type_instance", buffer) == 0)
589 set_state (ctx, CTX_IDENT_TYPE_INSTANCE, CTX_IDENT_MASK);
593 } /* }}} int gl_json_key */
595 yajl_callbacks gl_json_callbacks =
598 /* boolean = */ NULL,
599 /* integer = */ NULL,
602 /* string = */ gl_json_string,
603 /* start_map = */ gl_json_start_map,
604 /* map_key = */ gl_json_key,
605 /* end_map = */ gl_json_end_map,
606 /* start_array = */ NULL,
607 /* end_array = */ gl_json_end_array
610 static int gl_read_cache (_Bool block) /* {{{ */
613 gl_json_context_t context;
614 yajl_parser_config handle_config = { /* comments = */ 0, /* check UTF-8 */ 0 };
623 fd = open (graph_config_get_cachefile (), O_RDONLY);
626 fprintf (stderr, "gl_read_cache: open(2) failed with status %i\n", errno);
635 memset (&lock, 0, sizeof (lock));
636 lock.l_type = F_RDLCK;
637 lock.l_whence = SEEK_SET;
639 lock.l_len = 0; /* lock everything */
643 status = fcntl (fd, cmd, &lock);
647 if (!block && ((errno == EACCES) || (errno == EAGAIN)))
657 fprintf (stderr, "gl_read_cache: fcntl(2) failed with status %i\n",
663 fprintf (stderr, "gl_read_cache: Opening and locking "
664 "cache file successful\n");
666 memset (&statbuf, 0, sizeof (statbuf));
667 status = fstat (fd, &statbuf);
671 fprintf (stderr, "gl_read_cache: fstat(2) failed with status %i\n",
681 /* Read the file. No excuses. */
683 else if (statbuf.st_mtime <= gl_last_update)
685 /* Our current data is at least as new as the cache. Return. */
686 fprintf (stderr, "gl_read_cache: Not using cache because "
687 "the internal data is newer\n");
692 else if ((statbuf.st_mtime + UPDATE_INTERVAL) < now)
694 /* We'll scan the directory anyway, so there is no need to parse the cache
696 fprintf (stderr, "gl_read_cache: Not using cache because it's too old\n");
702 memset (&context, 0, sizeof (context));
703 context.state = CTX_GRAPH;
706 context.ident = NULL;
708 handle = yajl_alloc (&gl_json_callbacks,
710 /* alloc funcs = */ NULL,
713 fprintf (stderr, "gl_read_cache: Start parsing data\n");
719 char buffer[1024*1024];
721 rd_status = read (fd, buffer, sizeof (buffer));
724 if ((errno == EINTR) || (errno == EAGAIN))
728 fprintf (stderr, "gl_read_cache: read(2) failed with status %i\n",
733 else if (rd_status == 0)
735 yajl_parse_complete (handle);
741 (unsigned char *) &buffer[0],
742 (unsigned int) rd_status);
748 gl_last_update = statbuf.st_mtime;
751 fprintf (stderr, "gl_read_cache: Finished parsing data\n");
755 } /* }}} int gl_read_cache */
760 int gl_add_graph (graph_config_t *cfg) /* {{{ */
762 return (gl_add_graph_internal (cfg, &gl_staging, &gl_staging_num));
763 } /* }}} int gl_add_graph */
765 int gl_config_submit (void) /* {{{ */
767 graph_config_t **old;
771 old_num = gl_active_num;
773 gl_active = gl_staging;
774 gl_active_num = gl_staging_num;
779 gl_destroy (&old, &old_num);
782 } /* }}} int graph_config_submit */
784 int gl_graph_get_all (_Bool include_dynamic, /* {{{ */
785 graph_callback_t callback, void *user_data)
789 if (callback == NULL)
792 gl_update (/* request served = */ 0);
794 for (i = 0; i < gl_active_num; i++)
798 status = (*callback) (gl_active[i], user_data);
803 if (!include_dynamic)
806 for (i = 0; i < gl_dynamic_num; i++)
810 status = (*callback) (gl_dynamic[i], user_data);
816 } /* }}} int gl_graph_get_all */
818 graph_config_t *gl_graph_get_selected (void) /* {{{ */
820 const char *host = get_part_from_param ("graph_host", "host");
821 const char *plugin = get_part_from_param ("graph_plugin", "plugin");
822 const char *plugin_instance = get_part_from_param ("graph_plugin_instance", "plugin_instance");
823 const char *type = get_part_from_param ("graph_type", "type");
824 const char *type_instance = get_part_from_param ("graph_type_instance", "type_instance");
825 graph_ident_t *ident;
829 || (plugin == NULL) || (plugin_instance == NULL)
830 || (type == NULL) || (type_instance == NULL))
833 ident = ident_create (host, plugin, plugin_instance, type, type_instance);
835 gl_update (/* request served = */ 0);
837 for (i = 0; i < gl_active_num; i++)
839 if (graph_compare (gl_active[i], ident) != 0)
842 ident_destroy (ident);
843 return (gl_active[i]);
846 for (i = 0; i < gl_dynamic_num; i++)
848 if (graph_compare (gl_dynamic[i], ident) != 0)
851 ident_destroy (ident);
852 return (gl_dynamic[i]);
855 ident_destroy (ident);
857 } /* }}} graph_config_t *gl_graph_get_selected */
859 /* gl_instance_get_all, gl_graph_instance_get_all {{{ */
860 struct gl_inst_callback_data /* {{{ */
863 graph_inst_callback_t callback;
865 }; /* }}} struct gl_inst_callback_data */
867 static int gl_inst_callback_handler (graph_instance_t *inst, /* {{{ */
870 struct gl_inst_callback_data *data = user_data;
872 return ((*data->callback) (data->cfg, inst, data->user_data));
873 } /* }}} int gl_inst_callback_handler */
875 int gl_graph_instance_get_all (graph_config_t *cfg, /* {{{ */
876 graph_inst_callback_t callback, void *user_data)
878 struct gl_inst_callback_data data =
885 if ((cfg == NULL) || (callback == NULL))
888 return (graph_inst_foreach (cfg, gl_inst_callback_handler, &data));
889 } /* }}} int gl_graph_instance_get_all */
891 int gl_instance_get_all (graph_inst_callback_t callback, /* {{{ */
896 gl_update (/* request served = */ 0);
898 for (i = 0; i < gl_active_num; i++)
902 status = gl_graph_instance_get_all (gl_active[i], callback, user_data);
907 for (i = 0; i < gl_dynamic_num; i++)
911 status = gl_graph_instance_get_all (gl_dynamic[i], callback, user_data);
917 } /* }}} int gl_instance_get_all */
918 /* }}} gl_instance_get_all, gl_graph_instance_get_all */
920 int gl_search (search_info_t *si, /* {{{ */
921 graph_inst_callback_t callback, void *user_data)
924 graph_ident_t *ident;
926 if ((si == NULL) || (callback == NULL))
929 if (search_has_selector (si))
931 ident = search_to_ident (si);
934 fprintf (stderr, "gl_search: search_to_ident failed\n");
943 for (i = 0; i < gl_active_num; i++)
947 if ((ident != NULL) && !graph_ident_intersect (gl_active[i], ident))
950 status = graph_search_inst (gl_active[i], si,
951 /* callback = */ callback,
952 /* user data = */ user_data);
957 for (i = 0; i < gl_dynamic_num; i++)
961 if ((ident != NULL) && !graph_ident_intersect (gl_dynamic[i], ident))
964 status = graph_search_inst (gl_dynamic[i], si,
965 /* callback = */ callback,
966 /* user data = */ user_data);
972 } /* }}} int gl_search */
974 int gl_search_string (const char *term, graph_inst_callback_t callback, /* {{{ */
979 for (i = 0; i < gl_active_num; i++)
983 status = graph_search_inst_string (gl_active[i], term,
984 /* callback = */ callback,
985 /* user data = */ user_data);
990 for (i = 0; i < gl_dynamic_num; i++)
994 status = graph_search_inst_string (gl_dynamic[i], term,
995 /* callback = */ callback,
996 /* user data = */ user_data);
1002 } /* }}} int gl_search_string */
1004 int gl_search_field (graph_ident_field_t field, /* {{{ */
1005 const char *field_value,
1006 graph_inst_callback_t callback, void *user_data)
1010 if ((field_value == NULL) || (callback == NULL))
1013 for (i = 0; i < gl_active_num; i++)
1017 status = graph_inst_search_field (gl_active[i],
1019 /* callback = */ callback,
1020 /* user data = */ user_data);
1025 for (i = 0; i < gl_dynamic_num; i++)
1029 status = graph_inst_search_field (gl_dynamic[i],
1031 /* callback = */ callback,
1032 /* user data = */ user_data);
1038 } /* }}} int gl_search_field */
1040 int gl_foreach_host (int (*callback) (const char *host, void *user_data), /* {{{ */
1046 for (i = 0; i < host_list_len; i++)
1048 status = (*callback) (host_list[i], user_data);
1054 } /* }}} int gl_foreach_host */
1056 int gl_update (_Bool request_served) /* {{{ */
1062 if (!request_served && (gl_last_update > 0))
1067 if ((gl_last_update + UPDATE_INTERVAL) >= now)
1069 /* Write data to cache if appropriate */
1076 gl_clear_instances ();
1078 gl_destroy (&gl_dynamic, &gl_dynamic_num);
1080 graph_read_config ();
1082 status = gl_read_cache (/* block = */ 1);
1083 /* We have *something* to work with. Even if it's outdated, just get on with
1084 * handling the request and take care of re-reading data later on. */
1085 if ((status == 0) && !request_served)
1089 || ((gl_last_update + UPDATE_INTERVAL) < now))
1092 gl_clear_instances ();
1094 gl_destroy (&gl_dynamic, &gl_dynamic_num);
1096 data_provider_get_idents (gl_register_ident, /* user data = */ NULL);
1098 gl_last_update = now;
1101 if (host_list_len > 0)
1102 qsort (host_list, host_list_len, sizeof (*host_list),
1105 for (i = 0; i < gl_active_num; i++)
1106 graph_sort_instances (gl_active[i]);
1112 } /* }}} int gl_update */
1114 /* vim: set sw=2 sts=2 et fdm=marker : */