File header cleanup.

* sysdeps.h should always be included first.
 * TRACE_TAG needs to be defined before anything is included.
 * Some files were missing copyright headers.
 * Save precious bytes on my SSD by removing useless whitespace.

Change-Id: I88980e6e00b5be1093806cf286740d9e4a033b94
This commit is contained in:
Dan Albert 2015-03-19 15:21:08 -07:00
parent b4ebc475e6
commit 3313426fad
24 changed files with 148 additions and 89 deletions

View File

@ -14,7 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_ADB
#define TRACE_TAG TRACE_ADB
#include "sysdeps.h"
#include "adb.h"
#include <stdio.h>
#include <stdlib.h>
@ -27,8 +30,6 @@
#include <sys/time.h>
#include <stdint.h>
#include "sysdeps.h"
#include "adb.h"
#include "adb_auth.h"
#include "adb_io.h"
#include "adb_listeners.h"

View File

@ -14,7 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_ADB
#define TRACE_TAG TRACE_ADB
#include "sysdeps.h"
#include "adb_auth.h"
#include <errno.h>
#include <stdio.h>
@ -23,9 +26,7 @@
#include <unistd.h>
#include "adb.h"
#include "adb_auth.h"
#include "transport.h"
#include "sysdeps.h"
int auth_enabled = 0;

View File

@ -17,6 +17,8 @@
#ifndef __ADB_AUTH_H
#define __ADB_AUTH_H
#include "adb.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -14,24 +14,24 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_AUTH
#include "sysdeps.h"
#include "adb_auth.h"
#include <resolv.h>
#include <stdio.h>
#include <string.h>
#include "sysdeps.h"
#include "adb.h"
#include "adb_auth.h"
#include "cutils/list.h"
#include "cutils/sockets.h"
#include "fdevent.h"
#include "mincrypt/rsa.h"
#include "mincrypt/sha.h"
#include "adb.h"
#include "fdevent.h"
#include "transport.h"
#define TRACE_TAG TRACE_AUTH
struct adb_public_key {
struct listnode node;
RSAPublicKey key;

View File

@ -14,8 +14,14 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_AUTH
#include "sysdeps.h"
#include "adb_auth.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
# ifndef WIN32_LEAN_AND_MEAN
@ -28,11 +34,8 @@
# include <sys/stat.h>
# include <unistd.h>
#endif
#include <string.h>
#include "sysdeps.h"
#include "adb.h"
#include "adb_auth.h"
/* HACK: we need the RSAPublicKey struct
* but RSA_verify conflits with openssl */
@ -52,12 +55,9 @@
#include <openssl/base64.h>
#endif
#define TRACE_TAG TRACE_AUTH
#define ANDROID_PATH ".android"
#define ADB_KEY_FILE "adbkey"
struct adb_private_key {
struct listnode node;
RSA *rsa;

View File

@ -14,6 +14,11 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_ADB
#include "sysdeps.h"
#include "adb_client.h"
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
@ -23,10 +28,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_ADB
#include "adb_client.h"
#include "adb_io.h"
static transport_type __adb_transport = kTransportAny;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_RWX
#define TRACE_TAG TRACE_RWX
#include "sysdeps.h"
#include "adb_io.h"

View File

@ -14,15 +14,15 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_ADB
#define TRACE_TAG TRACE_ADB
#include "sysdeps.h"
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include "sysdeps.h"
#include "adb.h"
#include "adb_auth.h"
#include "adb_listeners.h"

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_ADB
#include "sysdeps.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@ -31,9 +35,6 @@
#include <unistd.h>
#endif
#include "sysdeps.h"
#define TRACE_TAG TRACE_ADB
#include "adb.h"
#include "adb_auth.h"
#include "adb_client.h"

View File

@ -15,25 +15,23 @@
** limitations under the License.
*/
#include <sys/ioctl.h>
#define TRACE_TAG TRACE_FDEVENT
#include "sysdeps.h"
#include "fdevent.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "adb_io.h"
#include "adb_trace.h"
#include "fdevent.h"
#include "sysdeps.h"
#define TRACE_TAG TRACE_FDEVENT
/* !!! Do not enable DEBUG for the adb that will run as the server:
** both stdout and stderr are used to communicate between the client

View File

@ -14,6 +14,11 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_SYNC
#include "sysdeps.h"
#include "file_sync_service.h"
#include <dirent.h>
#include <errno.h>
#include <selinux/android.h>
@ -25,12 +30,8 @@
#include <unistd.h>
#include <utime.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_SYNC
#include "adb.h"
#include "adb_io.h"
#include "file_sync_service.h"
#include "private/android_filesystem_config.h"
static bool should_use_fs_config(const char* path) {

View File

@ -1,12 +1,32 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* implement the "debug-ports" and "track-debug-ports" device services */
#define TRACE_TAG TRACE_JDWP
#include "sysdeps.h"
#define TRACE_TAG TRACE_JDWP
#include "adb.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "adb.h"
/* here's how these things work.
when adbd starts, it creates a unix server socket

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_ADB
#include "sysdeps.h"
#include <errno.h>
#include <fcntl.h>
#include <mntent.h>
@ -25,9 +29,6 @@
#include <string>
#include "sysdeps.h"
#define TRACE_TAG TRACE_ADB
#include "adb.h"
#include "adb_io.h"
#include "cutils/properties.h"

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_SERVICES
#include "sysdeps.h"
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
@ -32,9 +36,6 @@
#include "cutils/properties.h"
#endif
#include "sysdeps.h"
#define TRACE_TAG TRACE_SERVICES
#include "adb.h"
#include "adb_io.h"
#include "file_sync_service.h"

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_ADB
#include "sysdeps.h"
#include <fcntl.h>
#include <inttypes.h>
#include <stdarg.h>
@ -21,13 +25,12 @@
#include <stdio.h>
#include <sys/stat.h>
#define TRACE_TAG TRACE_ADB
#include "adb.h"
#include "cutils/properties.h"
#include "adb.h"
#include "ext4_sb.h"
#include "fs_mgr.h"
#include "remount_service.h"
#include "sysdeps.h"
#define FSTAB_PREFIX "/fstab."
struct fstab *fstab;

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_SOCKETS
#include "sysdeps.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
@ -21,14 +25,12 @@
#include <string.h>
#include <unistd.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_SOCKETS
#include "adb.h"
#include "adb_io.h"
#if !ADB_HOST
#include "cutils/properties.h"
#endif
#include "adb.h"
#include "adb_io.h"
#include "transport.h"
ADB_MUTEX_DEFINE( socket_list_lock );

View File

@ -1,10 +1,30 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define TRACE_TAG TRACE_SYSDEPS
#include "sysdeps.h"
#include <winsock2.h>
#include <winsock2.h> /* winsock.h *must* be included before windows.h. */
#include <windows.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#define TRACE_TAG TRACE_SYSDEPS
#include "adb.h"
extern void fatal(const char *fmt, ...);

View File

@ -14,8 +14,9 @@
* limitations under the License.
*/
#include "sysdeps.h"
#define TRACE_TAG TRACE_TRANSPORT
#include "sysdeps.h"
#include "transport.h"
#include <ctype.h>
@ -25,7 +26,6 @@
#include <string.h>
#include <unistd.h>
#define TRACE_TAG TRACE_TRANSPORT
#include "adb.h"
static void transport_unref(atransport *t);

View File

@ -14,21 +14,23 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_TRANSPORT
#include "sysdeps.h"
#include "transport.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_TRANSPORT
#include "adb.h"
#include "adb_io.h"
#if !ADB_HOST
#include "cutils/properties.h"
#endif
#include "transport.h"
#include "adb.h"
#include "adb_io.h"
#if ADB_HOST
/* we keep a list of opened transports. The atransport struct knows to which

View File

@ -14,15 +14,16 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_TRANSPORT
#include "sysdeps.h"
#include "transport.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysdeps.h>
#define TRACE_TAG TRACE_TRANSPORT
#include "adb.h"
#include "transport.h"
static int remote_read(apacket *p, atransport *t)
{

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_USB
#include "sysdeps.h"
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
@ -33,9 +37,6 @@
#include <linux/usb_ch9.h>
#endif
#include "sysdeps.h"
#define TRACE_TAG TRACE_USB
#include "adb.h"
#include "transport.h"

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_USB
#include "sysdeps.h"
#include <dirent.h>
#include <errno.h>
#include <linux/usb/ch9.h>
@ -25,9 +29,6 @@
#include <sys/types.h>
#include <unistd.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_USB
#include "adb.h"
#include "transport.h"

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_USB
#include "sysdeps.h"
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
@ -24,9 +28,6 @@
#include <stdio.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_USB
#include "adb.h"
#include "transport.h"

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
#define TRACE_TAG TRACE_USB
#include "sysdeps.h"
#include <winsock2.h> // winsock.h *must* be included before windows.h.
#include <adb_api.h>
#include <errno.h>
@ -23,9 +27,6 @@
#include <windows.h>
#include <winerror.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_USB
#include "adb.h"
#include "transport.h"