* commit '4f9b6ec4b13ba2a923a3ba4983e4b28122d92eda': Remove extern "C" barriers to using C++.
This commit is contained in:
commit
4668c5997e
15 changed files with 21 additions and 124 deletions
26
adb/adb.h
26
adb/adb.h
|
@ -23,10 +23,6 @@
|
|||
#include "adb_trace.h"
|
||||
#include "fdevent.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MAX_PAYLOAD 4096
|
||||
|
||||
#define A_SYNC 0x434e5953
|
||||
|
@ -47,14 +43,8 @@ extern "C" {
|
|||
// Increment this when we want to force users to start a new adb server.
|
||||
#define ADB_SERVER_VERSION 32
|
||||
|
||||
typedef struct amessage amessage;
|
||||
typedef struct apacket apacket;
|
||||
typedef struct asocket asocket;
|
||||
typedef struct alistener alistener;
|
||||
typedef struct aservice aservice;
|
||||
typedef struct atransport atransport;
|
||||
typedef struct adisconnect adisconnect;
|
||||
typedef struct usb_handle usb_handle;
|
||||
struct atransport;
|
||||
struct usb_handle;
|
||||
|
||||
struct amessage {
|
||||
unsigned command; /* command identifier constant */
|
||||
|
@ -171,12 +161,12 @@ struct adisconnect
|
|||
** object, it's a special value used to indicate that a client wants to
|
||||
** connect to a service implemented within the ADB server itself.
|
||||
*/
|
||||
typedef enum transport_type {
|
||||
enum transport_type {
|
||||
kTransportUsb,
|
||||
kTransportLocal,
|
||||
kTransportAny,
|
||||
kTransportHost,
|
||||
} transport_type;
|
||||
};
|
||||
|
||||
#define TOKEN_SIZE 20
|
||||
|
||||
|
@ -363,10 +353,10 @@ extern const char *adb_device_banner;
|
|||
extern int HOST;
|
||||
extern int SHELL_EXIT_NOTIFY_FD;
|
||||
|
||||
typedef enum {
|
||||
enum subproc_mode {
|
||||
SUBPROC_PTY = 0,
|
||||
SUBPROC_RAW = 1,
|
||||
} subproc_mode;
|
||||
} ;
|
||||
|
||||
#define CHUNK_SIZE (64*1024)
|
||||
|
||||
|
@ -389,8 +379,4 @@ void handle_offline(atransport *t);
|
|||
|
||||
void send_connect(atransport *t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
|
||||
#include "adb.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int auth_enabled;
|
||||
|
||||
int adb_auth_keygen(const char* filename);
|
||||
|
@ -68,8 +64,4 @@ void adb_auth_confirm_key(unsigned char *data, size_t len, atransport *t);
|
|||
|
||||
#endif // ADB_HOST
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __ADB_AUTH_H
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
|
||||
#include "adb.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* connect to adb, connect to the named service, and return
|
||||
** a valid fd for interacting with that service upon success
|
||||
** or a negative number on failure
|
||||
|
@ -58,8 +54,4 @@ const char *adb_error(void);
|
|||
*/
|
||||
int adb_status(int fd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
#include <stdbool.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Reads exactly len bytes from fd into buf.
|
||||
*
|
||||
|
@ -46,8 +42,4 @@ bool WriteFdExactly(int fd, const void *buf, size_t len);
|
|||
/* Same as WriteFdExactly, but with an implicit len = strlen(buf). */
|
||||
bool WriteStringFully(int fd, const char* str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADB_IO_H */
|
||||
|
|
|
@ -19,17 +19,13 @@
|
|||
|
||||
#include "adb.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// error/status codes for install_listener.
|
||||
typedef enum {
|
||||
enum install_status_t {
|
||||
INSTALL_STATUS_OK = 0,
|
||||
INSTALL_STATUS_INTERNAL_ERROR = -1,
|
||||
INSTALL_STATUS_CANNOT_BIND = -2,
|
||||
INSTALL_STATUS_CANNOT_REBIND = -3,
|
||||
} install_status_t;
|
||||
};
|
||||
|
||||
extern alistener listener_list;
|
||||
|
||||
|
@ -47,8 +43,4 @@ int format_listeners(char* buf, size_t buflen);
|
|||
int remove_listener(const char *local_name, atransport* transport);
|
||||
void remove_all_listeners(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ADB_LISTENERS_H */
|
||||
|
|
|
@ -23,10 +23,6 @@
|
|||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* define ADB_TRACE to 1 to enable tracing support, or 0 to disable it */
|
||||
#define ADB_TRACE 1
|
||||
|
||||
|
@ -34,7 +30,7 @@ extern "C" {
|
|||
* forget to update the corresponding 'tags' table in
|
||||
* the adb_trace_init() function implemented in adb.c
|
||||
*/
|
||||
typedef enum {
|
||||
enum AdbTrace {
|
||||
TRACE_ADB = 0, /* 0x001 */
|
||||
TRACE_SOCKETS,
|
||||
TRACE_PACKETS,
|
||||
|
@ -47,7 +43,7 @@ typedef enum {
|
|||
TRACE_SERVICES,
|
||||
TRACE_AUTH,
|
||||
TRACE_FDEVENT,
|
||||
} AdbTrace;
|
||||
} ;
|
||||
|
||||
#if ADB_TRACE
|
||||
|
||||
|
@ -148,8 +144,4 @@ void adb_trace_init(void);
|
|||
# define ADB_TRACING 0
|
||||
#endif /* ADB_TRACE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ADB_TRACE_H */
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
|
||||
#include <stdint.h> /* for int64_t */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* events that may be observed */
|
||||
#define FDE_READ 0x0001
|
||||
#define FDE_WRITE 0x0002
|
||||
|
@ -32,7 +28,7 @@ extern "C" {
|
|||
/* features that may be set (via the events set/add/del interface) */
|
||||
#define FDE_DONT_CLOSE 0x0080
|
||||
|
||||
typedef struct fdevent fdevent;
|
||||
struct fdevent;
|
||||
|
||||
typedef void (*fd_func)(int fd, unsigned events, void *userdata);
|
||||
|
||||
|
@ -82,8 +78,4 @@ struct fdevent {
|
|||
void *arg;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -130,8 +130,6 @@ fail:
|
|||
return -1;
|
||||
}
|
||||
|
||||
typedef struct syncsendbuf syncsendbuf;
|
||||
|
||||
struct syncsendbuf {
|
||||
unsigned id;
|
||||
unsigned size;
|
||||
|
@ -557,8 +555,6 @@ int do_sync_ls(const char *path)
|
|||
}
|
||||
}
|
||||
|
||||
typedef struct copyinfo copyinfo;
|
||||
|
||||
struct copyinfo
|
||||
{
|
||||
copyinfo *next;
|
||||
|
@ -804,12 +800,12 @@ int do_sync_push(const char *lpath, const char *rpath, int show_progress)
|
|||
}
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct sync_ls_build_list_cb_args {
|
||||
copyinfo **filelist;
|
||||
copyinfo **dirlist;
|
||||
const char *rpath;
|
||||
const char *lpath;
|
||||
} sync_ls_build_list_cb_args;
|
||||
};
|
||||
|
||||
void
|
||||
sync_ls_build_list_cb(unsigned mode, unsigned size, unsigned time,
|
||||
|
|
|
@ -17,10 +17,6 @@
|
|||
#ifndef _FILE_SYNC_SERVICE_H_
|
||||
#define _FILE_SYNC_SERVICE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define htoll(x) (x)
|
||||
#define ltohl(x) (x)
|
||||
|
||||
|
@ -38,7 +34,7 @@ extern "C" {
|
|||
#define ID_FAIL MKID('F','A','I','L')
|
||||
#define ID_QUIT MKID('Q','U','I','T')
|
||||
|
||||
typedef union {
|
||||
union syncmsg {
|
||||
unsigned id;
|
||||
struct {
|
||||
unsigned id;
|
||||
|
@ -65,7 +61,7 @@ typedef union {
|
|||
unsigned id;
|
||||
unsigned msglen;
|
||||
} status;
|
||||
} syncmsg;
|
||||
} ;
|
||||
|
||||
|
||||
void file_sync_service(int fd, void *cookie);
|
||||
|
@ -76,8 +72,4 @@ int do_sync_pull(const char *rpath, const char *lpath, int show_progress, int pu
|
|||
|
||||
#define SYNC_DATA_MAX (64*1024)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -121,7 +121,6 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
typedef struct JdwpProcess JdwpProcess;
|
||||
struct JdwpProcess {
|
||||
JdwpProcess* next;
|
||||
JdwpProcess* prev;
|
||||
|
@ -455,11 +454,10 @@ FoundIt:
|
|||
#define JDWP_CONTROL_NAME "\0jdwp-control"
|
||||
#define JDWP_CONTROL_NAME_LEN (sizeof(JDWP_CONTROL_NAME)-1)
|
||||
|
||||
typedef struct {
|
||||
struct JdwpControl {
|
||||
int listen_socket;
|
||||
fdevent* fde;
|
||||
|
||||
} JdwpControl;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
|
@ -570,10 +568,10 @@ static JdwpControl _jdwp_control;
|
|||
** this simply returns the list of known JDWP process pids
|
||||
**/
|
||||
|
||||
typedef struct {
|
||||
struct JdwpSocket {
|
||||
asocket socket;
|
||||
int pass;
|
||||
} JdwpSocket;
|
||||
};
|
||||
|
||||
static void
|
||||
jdwp_socket_close( asocket* s )
|
||||
|
@ -642,8 +640,6 @@ create_jdwp_service_socket( void )
|
|||
** to the client...
|
||||
**/
|
||||
|
||||
typedef struct JdwpTracker JdwpTracker;
|
||||
|
||||
struct JdwpTracker {
|
||||
asocket socket;
|
||||
JdwpTracker* next;
|
||||
|
@ -754,4 +750,3 @@ init_jdwp(void)
|
|||
}
|
||||
|
||||
#endif /* !ADB_HOST */
|
||||
|
||||
|
|
|
@ -21,16 +21,8 @@
|
|||
#ifndef __QEMU_TRACING_H
|
||||
#define __QEMU_TRACING_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Initializes connection with the adb-debug qemud service in the emulator. */
|
||||
int adb_qemu_trace_init(void);
|
||||
void adb_qemu_trace(const char* fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __QEMU_TRACING_H */
|
||||
|
|
|
@ -43,8 +43,6 @@
|
|||
#include "remount_service.h"
|
||||
#include "transport.h"
|
||||
|
||||
typedef struct stinfo stinfo;
|
||||
|
||||
struct stinfo {
|
||||
void (*func)(int fd, void *cookie);
|
||||
int fd;
|
||||
|
|
|
@ -487,10 +487,10 @@ static asocket *create_host_service_socket(const char *name, const char* serial)
|
|||
/* a Remote socket is used to send/receive data to/from a given transport object
|
||||
** it needs to be closed when the transport is forcibly destroyed by the user
|
||||
*/
|
||||
typedef struct aremotesocket {
|
||||
struct aremotesocket {
|
||||
asocket socket;
|
||||
adisconnect disconnect;
|
||||
} aremotesocket;
|
||||
};
|
||||
|
||||
static int remote_socket_enqueue(asocket *s, apacket *p)
|
||||
{
|
||||
|
|
|
@ -54,10 +54,6 @@
|
|||
|
||||
#include "fdevent.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OS_PATH_SEPARATOR '\\'
|
||||
#define OS_PATH_SEPARATOR_STR "\\"
|
||||
#define ENV_PATH_SEPARATOR_STR ";"
|
||||
|
@ -296,10 +292,6 @@ extern char* adb_strtok_r(char *str, const char *delim, char **saveptr);
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OS_PATH_SEPARATOR '/'
|
||||
#define OS_PATH_SEPARATOR_STR "/"
|
||||
#define ENV_PATH_SEPARATOR_STR ":"
|
||||
|
@ -540,8 +532,4 @@ static __inline__ unsigned long adb_thread_id()
|
|||
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ADB_SYSDEPS_H */
|
||||
|
|
|
@ -406,7 +406,6 @@ static int list_transports_msg(char* buffer, size_t bufferlen)
|
|||
* number of client connections that want it through a single
|
||||
* live TCP connection
|
||||
*/
|
||||
typedef struct device_tracker device_tracker;
|
||||
struct device_tracker {
|
||||
asocket socket;
|
||||
int update_needed;
|
||||
|
@ -536,7 +535,6 @@ void update_transports(void)
|
|||
}
|
||||
#endif // ADB_HOST
|
||||
|
||||
typedef struct tmsg tmsg;
|
||||
struct tmsg
|
||||
{
|
||||
atransport *transport;
|
||||
|
|
Loading…
Reference in a new issue