Initial commit.
This commit is contained in:
+74
@@ -0,0 +1,74 @@
|
||||
#ifndef __MONODROID_LOGGER_H__
|
||||
#define __MONODROID_LOGGER_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef ANDROID
|
||||
typedef enum android_LogPriority
|
||||
{
|
||||
ANDROID_LOG_UNKNOWN = 0,
|
||||
ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */
|
||||
ANDROID_LOG_VERBOSE,
|
||||
ANDROID_LOG_DEBUG,
|
||||
ANDROID_LOG_INFO,
|
||||
ANDROID_LOG_WARN,
|
||||
ANDROID_LOG_ERROR,
|
||||
ANDROID_LOG_FATAL,
|
||||
ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */
|
||||
} android_LogPriority;
|
||||
#endif
|
||||
|
||||
// Keep in sync with Mono.Android/src/Runtime/Logger.cs!LogCategories enum
|
||||
typedef enum _LogCategories
|
||||
{
|
||||
LOG_NONE = 0,
|
||||
LOG_DEFAULT = 1 << 0,
|
||||
LOG_ASSEMBLY = 1 << 1,
|
||||
LOG_DEBUGGER = 1 << 2,
|
||||
LOG_GC = 1 << 3,
|
||||
LOG_GREF = 1 << 4,
|
||||
LOG_LREF = 1 << 5,
|
||||
LOG_TIMING = 1 << 6,
|
||||
LOG_BUNDLE = 1 << 7,
|
||||
LOG_NET = 1 << 8,
|
||||
LOG_NETLINK = 1 << 9,
|
||||
} LogCategories;
|
||||
|
||||
#if 0
|
||||
|
||||
extern unsigned int log_categories;
|
||||
|
||||
#if DEBUG
|
||||
extern int gc_spew_enabled;
|
||||
#endif
|
||||
|
||||
void init_categories(const char *override_dir);
|
||||
|
||||
void log_error(LogCategories category, const char *format, ...);
|
||||
|
||||
void log_fatal(LogCategories category, const char *format, ...);
|
||||
|
||||
void log_info(LogCategories category, const char *format, ...);
|
||||
|
||||
void log_warn(LogCategories category, const char *format, ...);
|
||||
|
||||
void log_debug(LogCategories category, const char *format, ...);
|
||||
|
||||
#else
|
||||
|
||||
#define init_categories(override_dir)
|
||||
#define log_error(category, format, ...)
|
||||
#define log_fatal(category, format, ...)
|
||||
#define log_info(category, format, ...)
|
||||
#define log_warn(category, format, ...)
|
||||
#define log_debug(category, format, ...)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MONODROID_LOGGER_H__ */
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
#ifndef __MONODROID_H
|
||||
#define __MONODROID_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* VS 2010 and later have stdint.h */
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
#define MONO_API_EXPORT __declspec(dllexport)
|
||||
#define MONO_API_IMPORT __declspec(dllimport)
|
||||
|
||||
#else /* defined(_MSC_VER */
|
||||
|
||||
#define MONO_API_EXPORT __attribute__ ((visibility ("default")))
|
||||
#define MONO_API_IMPORT
|
||||
|
||||
#endif /* !defined(_MSC_VER) */
|
||||
|
||||
#if defined(MONO_DLL_EXPORT)
|
||||
#define MONO_API MONO_API_EXPORT
|
||||
#elif defined(MONO_DLL_IMPORT)
|
||||
#define MONO_API MONO_API_IMPORT
|
||||
#else /* !defined(MONO_DLL_IMPORT) && !defined(MONO_API_IMPORT) */
|
||||
#define MONO_API
|
||||
#endif /* MONO_DLL_EXPORT... */
|
||||
|
||||
enum FatalExitCodes
|
||||
{
|
||||
FATAL_EXIT_CANNOT_FIND_MONO = 1,
|
||||
FATAL_EXIT_ATTACH_JVM_FAILED = 2,
|
||||
FATAL_EXIT_DEBUGGER_CONNECT = 3,
|
||||
FATAL_EXIT_CANNOT_FIND_JNIENV = 4,
|
||||
FATAL_EXIT_CANNOT_FIND_APK = 10,
|
||||
FATAL_EXIT_TRIAL_EXPIRED = 11,
|
||||
FATAL_EXIT_PTHREAD_FAILED = 12,
|
||||
FATAL_EXIT_MISSING_ASSEMBLY = 13,
|
||||
FATAL_EXIT_CANNOT_LOAD_BUNDLE = 14,
|
||||
FATAL_EXIT_CANNOT_FIND_LIBMONOSGEN = 15,
|
||||
FATAL_EXIT_NO_ASSEMBLIES = 'A',
|
||||
FATAL_EXIT_MONO_MISSING_SYMBOLS = 'B',
|
||||
FATAL_EXIT_FORK_FAILED = 'F',
|
||||
FATAL_EXIT_MISSING_INIT = 'I',
|
||||
FATAL_EXIT_MISSING_TIMEZONE_MEMBERS = 'T',
|
||||
FATAL_EXIT_MISSING_ZIPALIGN = 'Z',
|
||||
FATAL_EXIT_OUT_OF_MEMORY = 'M',
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined __MONODROID_H */
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
#ifndef __XAMARIN_GETIFADDRS_H
|
||||
|
||||
#include "monodroid.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* We're implementing getifaddrs behavior, this is the structure we use. It is exactly the same as
|
||||
* struct ifaddrs defined in ifaddrs.h but since bionics doesn't have it we need to mirror it here.
|
||||
*/
|
||||
struct _monodroid_ifaddrs
|
||||
{
|
||||
struct _monodroid_ifaddrs *ifa_next; /* Pointer to the next structure. */
|
||||
|
||||
char *ifa_name; /* Name of this network interface. */
|
||||
unsigned int ifa_flags; /* Flags as from SIOCGIFFLAGS ioctl. */
|
||||
|
||||
struct sockaddr *ifa_addr; /* Network address of this interface. */
|
||||
struct sockaddr *ifa_netmask; /* Netmask of this interface. */
|
||||
union
|
||||
{
|
||||
/* At most one of the following two is valid. If the IFF_BROADCAST
|
||||
bit is set in `ifa_flags', then `ifa_broadaddr' is valid. If the
|
||||
IFF_POINTOPOINT bit is set, then `ifa_dstaddr' is valid.
|
||||
It is never the case that both these bits are set at once. */
|
||||
struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
|
||||
struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
|
||||
} ifa_ifu;
|
||||
/* These very same macros are defined by <net/if.h> for `struct ifaddr'.
|
||||
So if they are defined already, the existing definitions will be fine. */
|
||||
# ifndef _monodroid_ifa_broadaddr
|
||||
# define _monodroid_ifa_broadaddr ifa_ifu.ifu_broadaddr
|
||||
# endif
|
||||
# ifndef _monodroid_ifa_dstaddr
|
||||
# define _monodroid_ifa_dstaddr ifa_ifu.ifu_dstaddr
|
||||
# endif
|
||||
|
||||
void *ifa_data; /* Address-specific data (may be unused). */
|
||||
};
|
||||
|
||||
void _monodroid_getifaddrs_init(void);
|
||||
MONO_API int _monodroid_getifaddrs(struct _monodroid_ifaddrs **ifap);
|
||||
MONO_API void _monodroid_freeifaddrs(struct _monodroid_ifaddrs *ifa);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user