nescc-ncg(1)

πŸ“¦ version 1.3.5, in debian bookworm, ubuntu jammy

πŸ’– nescc-ncg β€” the manual, but make it cute πŸ’–

okay bestie, welcome to the nescc-ncg(1) page, from the General Commands Manual section. yes she's a real one. let's get into it 🫢


✨ NAME ✨

nescc-ncg β€” extract constants from nesC files πŸ“


✨ SYNOPSIS ✨

nescc-ncg [any nescc option] [tool-specific options]
          [-o output-file] [-nescc=driver]
          tool nesC-file filenames-or-constant-names...

✨ DESCRIPTION ✨

so like, nescc-ncg is a tool that extracts constants from nesC files so you can use them in other applications. it's usually besties with nescc-mig (which generates the code that processes nesC messages), and together they pull out the constants used in particular messages β€” think constants representing various commands, that vibe πŸ’…

the tool argument says what tool should be generated. the nesC-file is a nesC file that uses the constants you wanna extract. and if your constants are all in a single .h file that does not depend on any other files, then you can just hand over the .h file directly as the msg-format-file. 🌸

⚠️ heads up queen: if some of your constants are defined with unique(...) or uniqueCount(...), you must specify your whole application as the nesC-file, or you will not get the correct constant values. no cap, that one matters. 😭

each filenames-or-constant-names is either a constant name (if it consists only of letters, numbers and _) or a filename. in the first case, that specified constant gets extracted. in the second case, all constants from the specified C file get extracted. πŸŽ€

lowkey important: only constants declared in C files will be found by nescc-ncg.

the current tools are java, python and C, which generate java, python and C code that contains the values of the requested constants. iconic lineup tbh πŸ‘‘


✨ OPTIONS ✨

you can pass any nescc option, plus these:

  • -o output-file β€” specify the file in which to output the generated code. πŸ“
  • -nescc=driver β€” use driver instead of nescc to extract constants. for example, if you specify -nescc=ncc, you can use nescc-ncg to extract constants from TinyOS applications (which are normally compiled with ncc). πŸš—
  • tool-specific options β€” see below, bestie ⬇️

🌈 JAVA TOOL 🌈

this tool generates a java class with the values of the requested constants. these constants will be public final static and have a type chosen from byte, short, char, int, long β€” the chosen type will be the first one in this list that can hold the constant's value, which lowkey reduces the need for casts. slay ✨

the java tool accepts the following options:

  • -java-classname=full-class-name β€” this option is required and specifies the package and name of the generated class. if the full-class-name has no ., then no package directive is included in the output. πŸ’–
  • -java-extends=class-name β€” specify the class the generated class will extend. the default is Object. πŸ¦‹

🐍 PYTHON TOOL 🐍

this tool generates a Python class with the values of the requested constants. these constants will be class (rather than instance) variables. periodt πŸ’…

the Python tool accepts the following options:

  • -python-classname=full-class-name β€” this option is required and specifies the name of the generated class. 🌸
  • -python-extends=class-name β€” specify the class the generated class will extend. the default is is to not inherit. πŸ™ˆ (yes the original says "is is", we respect the heritage)

πŸ‘‘ C TOOL πŸ‘‘

this tool generates a C header file with the values of the requested constants (defined as enum constants). so very C of it πŸ’œ

the C tool accepts the following option:

  • -c-prefix=prefix β€” this option specifies a prefix to attach to the generated constants. πŸŽ€

πŸ’€ ERRORS πŸ’€

nescc-ncg reports an error if ncc cannot compile nesC-file. that's it, that's the whole drama 😭


🌟 SEE ALSO 🌟


and that's the tea, bestie 🫢 this whole page came to you courtesy of the General Commands Manual, dated April 27, 2004. go forth and extract those constants, you absolute main character πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from