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;
74' href='#n174'>174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263