about summary refs log tree commit diff stats
path: root/cpp/001help
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-23 20:35:31 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-23 20:35:31 -0700
commit56ce557708c8387dc0fae590f10e4db62d409fa5 (patch)
treed409bcaea29aef040648cdecd3ab1ada67cf4236 /cpp/001help
parent732fd9b0ccaad2cad88ced9bd48f840350652b1e (diff)
downloadmu-56ce557708c8387dc0fae590f10e4db62d409fa5.tar.gz
1151
Diffstat (limited to 'cpp/001help')
-rw-r--r--cpp/001help12
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/001help b/cpp/001help
index c3ce7874..18d7efa6 100644
--- a/cpp/001help
+++ b/cpp/001help
@@ -1,3 +1,6 @@
+//: Everything this project/binary supports.
+//: This should give you a sense for what to look forward to in later layers.
+
 :(before "End Commandline Parsing")
 if (argc <= 1 || is_equal(argv[1], "--help")) {
   // this is the functionality later layers will provide
@@ -12,6 +15,15 @@ if (argc <= 1 || is_equal(argv[1], "--help")) {
   return 0;
 }
 
+//:: Helper function used by the above fragment of code (and later layers too,
+//:: who knows?).
+//: The :(code) directive appends function definitions to the end of the
+//: project. Regardless of where functions are defined, we can call them
+//: anywhere we like as long as we format the function header in a specific
+//: way: put it all on a single line without indent, end the line with ') {'
+//: and no trailing whitespace. As long as functions uniformly start this
+//: way, our makefile contains a little command to automatically generate
+//: declarations for them.
 :(code)
 bool is_equal(char* s, const char* lit) {
   return strncmp(s, lit, strlen(lit)) == 0;