Switch kernel header parsing to python libclang
Replace the tokenizer in cpp.py with libclang.
Bug: 18937958
Change-Id: I27630904c6d2849418cd5ca3d3c612ec3078686d
diff --git a/libc/kernel/uapi/linux/ncp.h b/libc/kernel/uapi/linux/ncp.h
index e2cd7d4..b87cdba 100644
--- a/libc/kernel/uapi/linux/ncp.h
+++ b/libc/kernel/uapi/linux/ncp.h
@@ -27,14 +27,14 @@
#define NCP_DEALLOC_SLOT_REQUEST (0x5555)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ncp_request_header {
- __u16 type;
- __u8 sequence;
- __u8 conn_low;
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 task;
- __u8 conn_high;
- __u8 function;
- __u8 data[0];
+ __u8 task;
+ __u8 conn_high;
+ __u8 function;
+ __u8 data[0];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((packed));
#define NCP_REPLY (0x3333)
@@ -42,31 +42,31 @@
#define NCP_POSITIVE_ACK (0x9999)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ncp_reply_header {
- __u16 type;
- __u8 sequence;
- __u8 conn_low;
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 task;
- __u8 conn_high;
- __u8 completion_code;
- __u8 connection_state;
+ __u8 task;
+ __u8 conn_high;
+ __u8 completion_code;
+ __u8 connection_state;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u8 data[0];
+ __u8 data[0];
} __attribute__((packed));
#define NCP_VOLNAME_LEN (16)
#define NCP_NUMBER_OF_VOLUMES (256)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ncp_volume_info {
- __u32 total_blocks;
- __u32 free_blocks;
- __u32 purgeable_blocks;
+ __u32 total_blocks;
+ __u32 free_blocks;
+ __u32 purgeable_blocks;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 not_yet_purgeable_blocks;
- __u32 total_dir_entries;
- __u32 available_dir_entries;
- __u8 sectors_per_block;
+ __u32 not_yet_purgeable_blocks;
+ __u32 total_dir_entries;
+ __u32 available_dir_entries;
+ __u8 sectors_per_block;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- char volume_name[NCP_VOLNAME_LEN + 1];
+ char volume_name[NCP_VOLNAME_LEN + 1];
};
#define AR_READ (cpu_to_le16(1))
#define AR_WRITE (cpu_to_le16(2))
@@ -133,43 +133,43 @@
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
struct nw_nfs_info {
- __u32 mode;
- __u32 rdev;
+ __u32 mode;
+ __u32 rdev;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
struct nw_info_struct {
- __u32 spaceAlloc;
- __le32 attributes;
+ __u32 spaceAlloc;
+ __le32 attributes;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u16 flags;
- __le32 dataStreamSize;
- __le32 totalStreamSize;
- __u16 numberOfStreams;
+ __u16 flags;
+ __le32 dataStreamSize;
+ __le32 totalStreamSize;
+ __u16 numberOfStreams;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __le16 creationTime;
- __le16 creationDate;
- __u32 creatorID;
- __le16 modifyTime;
+ __le16 creationTime;
+ __le16 creationDate;
+ __u32 creatorID;
+ __le16 modifyTime;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __le16 modifyDate;
- __u32 modifierID;
- __le16 lastAccessDate;
- __u16 archiveTime;
+ __le16 modifyDate;
+ __u32 modifierID;
+ __le16 lastAccessDate;
+ __u16 archiveTime;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u16 archiveDate;
- __u32 archiverID;
- __u16 inheritedRightsMask;
- __le32 dirEntNum;
+ __u16 archiveDate;
+ __u32 archiverID;
+ __u16 inheritedRightsMask;
+ __le32 dirEntNum;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __le32 DosDirNum;
- __u32 volNumber;
- __u32 EADataSize;
- __u32 EAKeyCount;
+ __le32 DosDirNum;
+ __u32 volNumber;
+ __u32 EADataSize;
+ __u32 EAKeyCount;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 EAKeySize;
- __u32 NSCreator;
- __u8 nameLen;
- __u8 entryName[256];
+ __u32 EAKeySize;
+ __u32 NSCreator;
+ __u8 nameLen;
+ __u8 entryName[256];
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
} __attribute__((packed));
#define DM_ATTRIBUTES (cpu_to_le32(0x02))
@@ -189,30 +189,30 @@
#define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
#define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
struct nw_modify_dos_info {
- __le32 attributes;
+ __le32 attributes;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __le16 creationDate;
- __le16 creationTime;
- __u32 creatorID;
- __le16 modifyDate;
+ __le16 creationDate;
+ __le16 creationTime;
+ __u32 creatorID;
+ __le16 modifyDate;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __le16 modifyTime;
- __u32 modifierID;
- __u16 archiveDate;
- __u16 archiveTime;
+ __le16 modifyTime;
+ __u32 modifierID;
+ __u16 archiveDate;
+ __u16 archiveTime;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 archiverID;
- __le16 lastAccessDate;
- __u16 inheritanceGrantMask;
- __u16 inheritanceRevokeMask;
+ __u32 archiverID;
+ __le16 lastAccessDate;
+ __u16 inheritanceGrantMask;
+ __u16 inheritanceRevokeMask;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 maximumSpace;
+ __u32 maximumSpace;
} __attribute__((packed));
struct nw_search_sequence {
- __u8 volNumber;
+ __u8 volNumber;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
- __u32 dirBase;
- __u32 sequence;
+ __u32 dirBase;
+ __u32 sequence;
} __attribute__((packed));
#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */