data2inc(1)

πŸ’Ύ data2inc(1) β€” the manual, but make it cute

okay so bestie, gather round, because we're talking about data2inc from the Free Pascal crew β€” it's a binary-to-pascal-include-file converter and it's genuinely so useful, no cap. πŸŽ€


✨ NAME ✨

data2inc β€” Free Pascal binary to pascal include file converter. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

data2inc [-ABSVH] msgfile [incfile] [constname]

look at her. three optional positional args, five lil flags, living her best life. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

so here's the tea: data2inc reads a binary or text file and converts it to a pascal typed constant declaration. that's the whole main character moment.

the constant it makes is an array of characters (zero based), and like β€” each character's ascii value is the value of the byte at the offset index in the binary file. (and index is just the index in the array, iykyk.) so byte 0 β†’ array slot 0, byte 1 β†’ array slot 1, etc etc, it's giving "mirror". ✨

and if the input file is a text file? then options will be read from the file itself, and an output file will be generated according to the options encountered. cute, right? the file tells you what to do. πŸ™ˆ


🫢 USAGE 🫢

two whole modes, bestie, pick your fighter:

mode one β€” -B (binary mode): data2inc with the -B option accepts a filename of a binary file, and it needs the name of an include file and a constant name. the output gets written to incfile. and the name of the constant constname is mandatory for a binary file β€” like, you cannot skip it, she will not let you. 😭

mode two β€” no -B (message file mode): data2inc without the -B option takes the name of a message description file as input. it will process the message file and write the output as described in the message file to incfile. the file is basically the boss here. πŸ‘‘


πŸ‘‘ OPTIONS πŸ‘‘

data2inc has a small number of options to control its behaviour β€” small but mighty, fr fr:

  • -A β€” write bytes instead of characters. the constant array will be an array of byte instead of an array of char. little type glow-up. πŸ’œ
  • -B β€” if this option is given, the msgfile will be treated as a binary file. 🧚
  • -H β€” emit a small helptext. tiny help, big heart. 🌸
  • -S β€” data2inc will write the output as an array of strings, or a 2 dimensional array of characters. two-dimensional?? she contains multitudes. 🌈
  • -V β€” show the version number and exit. that's it, that's the whole job, and she ate. ⭐

πŸ”₯ SEE ALSO πŸ”₯

go read those too, they're iconic in their own right. πŸ’–


ngl, if you're feeding her a binary file and you forget constname, that's on you β€” it's mandatory, remember? 🫢

okay that's the whole page!! this lil manual came from the Free Pascal fam, dated 12 November 2004, and it lives in section 1 of the manual β€” so yeah, data2inc(1), we love her, we stan, bye bestie!! πŸ’…βœ¨πŸŽ€πŸ¦‹πŸ’–