diff options
author | Colin Cross <ccross@android.com> | 2012-07-17 18:36:41 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-07-17 18:36:41 -0700 |
commit | f694ba5f7fa81f250045c107e919888661a734ae (patch) | |
tree | 9d3f48d28d81126862b9612767f5b49c0e5a4d0d /libsparse/sparse_defs.h | |
parent | b3a679386d26677290a09fdf4e3406c57e835fd0 (diff) | |
parent | f838788e6a4d57634a53eb597ee76a597feffcb5 (diff) | |
download | system_core-f694ba5f7fa81f250045c107e919888661a734ae.zip system_core-f694ba5f7fa81f250045c107e919888661a734ae.tar.gz system_core-f694ba5f7fa81f250045c107e919888661a734ae.tar.bz2 |
Merge changes I6c59381c,I0da088fc,I883572f5,Idc2cfe20,I1a156d10,I177abdb9,I18707bd9,I26744c74,I266f70e1,I75f10db2,I95aa2317,I2f21355b,I5d4ab07f,Ic138ad58,I012d8a42,If664e4fc
* changes:
fastboot: add support for auto-resparsing large files
fastboot: add fb_getvar
fastboot: use getopt_long
libsparse: rename symbols that conflict with libext4_utils
libsparse: add sparse_file_len
libsparse: add function to resparse a file and a utility to use it
libsparse: add callback output file type
libsparse: pseudo-subclass output_file for normal and gz files
libsparse: add sparse_file read and convert tools to use it
libsparse: fix windows image writing
libsparse: merge adjacent blocks of the same type
libsparse: add error reporting functions
libsparse: add support for including fds
libsparse: cleanups
libsparse: remove static variables
system/core: move libsparse into system/core
Diffstat (limited to 'libsparse/sparse_defs.h')
-rw-r--r-- | libsparse/sparse_defs.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libsparse/sparse_defs.h b/libsparse/sparse_defs.h new file mode 100644 index 0000000..b99cfd5 --- /dev/null +++ b/libsparse/sparse_defs.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2010 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. + */ + +#ifndef _LIBSPARSE_SPARSE_DEFS_ +#define _LIBSPARSE_SPARSE_DEFS_ + +#include <errno.h> +#include <stdio.h> + +#define __le64 u64 +#define __le32 u32 +#define __le16 u16 + +#define __be64 u64 +#define __be32 u32 +#define __be16 u16 + +#define __u64 u64 +#define __u32 u32 +#define __u16 u16 +#define __u8 u8 + +typedef unsigned long long u64; +typedef signed long long s64; +typedef unsigned int u32; +typedef unsigned short int u16; +typedef unsigned char u8; + +#define DIV_ROUND_UP(x, y) (((x) + (y) - 1)/(y)) +#define ALIGN(x, y) ((y) * DIV_ROUND_UP((x), (y))) +#define ALIGN_DOWN(x, y) ((y) * ((x) / (y))) + +#define error(fmt, args...) do { fprintf(stderr, "error: %s: " fmt "\n", __func__, ## args); } while (0) +#define error_errno(s, args...) error(s ": %s", ##args, strerror(errno)) + +#endif |