Implementing Android Logcat in C