nescc-ncg(1)
π 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 withunique(...)oruniqueCount(...), 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:
-ooutput-file β specify the file in which to output the generated code. π-nescc=driver β use driver instead ofnesccto extract constants. for example, if you specify-nescc=ncc, you can usenescc-ncgto extract constants from TinyOS applications (which are normally compiled withncc). π- 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 isObject. π¦
π 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
- debian bookworm: nescc 1.3.5-1.1 Β· GPL-2.0-only
- ubuntu jammy: nescc 1.3.5-1.1build1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms