android_main.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdarg.h>
00022 #include <android/log.h>
00023 #include <ccnr_private.h>
00024
00025 static int
00026 logger(void *loggerdata, const char *format, va_list ap)
00027 {
00028 __android_log_vprint(ANDROID_LOG_INFO, "CCNR", format, ap);
00029 }
00030
00031 int
00032 start_ccnr(void)
00033 {
00034 struct ccnr_handle *h = NULL;
00035
00036 h = r_init_create(&logger, NULL);
00037 if (h == NULL) {
00038 exit(1);
00039 }
00040 ccnr_msg(h, "r_init_create h=%p", h);
00041 r_dispatch_run(h);
00042 s = (h->running != 0);
00043 ccnr_msg(h, "exiting.");
00044 r_init_destroy(&h);
00045 return 0;
00046 }