summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/common/main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-26 19:15:48 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-27 19:01:37 +0100
commit2934d0a4f4391b45e4bdb9adcbc1931b1323b986 (patch)
treec501997243ac52400a1f977c9faafff879aa00ad /src/host/layer23/src/common/main.c
parent000066110ade5227822532989b36f11c004b193f (diff)
layer23: Create an l23_app_info for various information and cb's
Make it possible that each l23 app can inject the copyright string, also prepare to have callbacks for the config handling and other places. This will be useful to add app specific config options.
Diffstat (limited to 'src/host/layer23/src/common/main.c')
-rw-r--r--src/host/layer23/src/common/main.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/host/layer23/src/common/main.c b/src/host/layer23/src/common/main.c
index ba16a321..2bcb2f43 100644
--- a/src/host/layer23/src/common/main.c
+++ b/src/host/layer23/src/common/main.c
@@ -60,12 +60,12 @@ int (*l23_app_exit) (struct osmocom_ms *ms) = NULL;
int quit = 0;
const char *openbsc_copyright =
- "Copyright (C) 2008-2010 ...\n"
- "Contributions by ...\n\n"
+ "%s"
+ "%s\n"
"License GPLv2+: GNU GPL version 2 or later "
"<http://gnu.org/licenses/gpl.html>\n"
"This is free software: you are free to change and redistribute it.\n"
- "There is NO WARRANTY, to the extent permitted by law.\n";
+ "There is NO WARRANTY, to the extent permitted by law.\n\n";
static void print_usage(const char *app)
{
@@ -157,12 +157,19 @@ void sighandler(int sigset)
exit (0);
}
+static void print_copyright()
+{
+ struct l23_app_info *app;
+ app = l23_app_info();
+ printf(openbsc_copyright,
+ app && app->copyright ? app->copyright : "",
+ app && app->contribution ? app->contribution : "");
+}
+
int main(int argc, char **argv)
{
int rc;
- printf("%s\n", openbsc_copyright);
-
INIT_LLIST_HEAD(&ms_list);
log_init(&log_info);
stderr_target = log_target_create_stderr();
@@ -176,6 +183,9 @@ int main(int argc, char **argv)
fprintf(stderr, "Failed to allocate MS\n");
exit(1);
}
+
+ print_copyright();
+
llist_add_tail(&ms->entity, &ms_list);
sprintf(ms->name, "1");