Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

novel generated from system headers #74

Open
debamitro opened this issue Nov 24, 2021 · 3 comments
Open

novel generated from system headers #74

debamitro opened this issue Nov 24, 2021 · 3 comments

Comments

@debamitro
Copy link

I have been working on a Rust library for only parsing structs from C headers. I want to generate a novel by scanning the headers on my MacBook.

@debamitro
Copy link
Author

Here is my code so far. And here is a novel generated from the output of the following command on my MacBook Pro:

cargo run -- `xcrun --show-sdk-path`/usr/include

I am still working on it.

@debamitro
Copy link
Author

I am done! I guess I could try to add some more drama, but I don't have any more ideas tonight. The generated novel is at the same link and so is the source code. I think there are ~58000 words.

@hugovk
Copy link
Member

hugovk commented Dec 1, 2021

😆

Preview:

Introduction

This is the story of a brave knight who ventured into /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include in an attempt to conquer all the C structs he could find there

Chapter 1

One fine day our hero ventured into /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pcap/nflog.h

He conquered the puny struct nflog_hdr_t
which had a uint8_t called nflog_family, and a uint8_t called nflog_version, and a uint16_t called nflog_rid.

He conquered the puny struct nflog_tlv_t
which had a uint16_t called tlv_length, and a uint16_t called tlv_type.

He conquered the puny struct nflog_packet_hdr_t
which had a uint16_t called hw_protocol, and a uint8_t called hook, and a uint8_t called pad.

He conquered the puny struct nflog_timestamp_t
which had a uint64_t called sec, and a uint64_t called usec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants