none
[openafs-wiki.git] / AFSLore / CodeArchitecture.mdwn
index 41519c9..806f9ec 100644 (file)
@@ -28,14 +28,45 @@ In the source itself ---
 
 - **find | grep** is very helpful. For example, to find all the RX packages (ie, so that you can start to identify the various namespaces of components), you can do:
 
-` find . -name \*.xg -exec grep -H "^package" {} \; | grep -v 'example' | grep -v 'bulktest' | sed -e 's|^./src/||' | sed -e 's/package/ /' | awk '{printf "%10s %s\n", $2, $1}' `
-
-which results in: ` VOTE_ ubik/ubik_int.xg: DISK_ ubik/ubik_int.xg: SAMPLE_ ubik/utst_int.xg: VL_ vlserver/vldbint.xg: UPDATE_ update/update.xg: TEST_ rxgk/test.xg: RXGK_ rxgk/rxgk_proto.xg: RXAFSCB_ fsint/afscbint.xg: RXAFS_ fsint/afsint.xg: RXSTATS_ rxstat/rxstat.xg: PR_ ptserver/ptint.xg: BOZO_ bozo/bosint.xg: BUMON_ bubasics/backmon.xg: TC_ bubasics/butc.xg: BC_ bubasics/bumon.xg: ADK_ dauth/adkint.xg: RMTSYS_ sys/rmtsys.xg: AFSVol volser/volint.xg: `
+    find . -name \*.xg -exec grep -H "^package" {} \; | grep -v 'example' | grep -v 'bulktest' | \
+      sed -e 's|^./src/||' | sed -e 's/package/ /' | awk '{printf "%10s   %s\n", $2, $1}'
+
+which results in:
+
+        VOTE_   ubik/ubik_int.xg:
+         DISK_   ubik/ubik_int.xg:
+       SAMPLE_   ubik/utst_int.xg:
+           VL_   vlserver/vldbint.xg:
+       UPDATE_   update/update.xg:
+         TEST_   rxgk/test.xg:
+         RXGK_   rxgk/rxgk_proto.xg:
+      RXAFSCB_   fsint/afscbint.xg:
+        RXAFS_   fsint/afsint.xg:
+      RXSTATS_   rxstat/rxstat.xg:
+           PR_   ptserver/ptint.xg:
+         BOZO_   bozo/bosint.xg:
+        BUMON_   bubasics/backmon.xg:
+           TC_   bubasics/butc.xg:
+           BC_   bubasics/bumon.xg:
+          ADK_   dauth/adkint.xg:
+       RMTSYS_   sys/rmtsys.xg:
+        AFSVol   volser/volint.xg:
 
 In other words, if something starts with BOZO\_, you know that it is generated by rxgen, and the interface is defined in `bozo/bosint.xg`.
 
 In addition to the package name, also note that only rxstat uses an M prefix; all others use S.
 
-- cscope: what it is, how to set up, how to use, example
+- cscope: a source code browser, linked to your editor. Setup is simple: cd to your source tree and run:
+
+    find . -name \*.[ch] > namelist
+    cscope -R -b
+
+Then run
+
+    cscope -d
+
+to start. The interface is simple. I tend to use it for finding things, but not necessarily for editing. When I'm studying the source, trying to understand how components link together, or bug-hunting, I tend to live inside `cscope`.
+
 - doxygen: what it is, how to set up, how to use, how to make even more useful (ie, src code changes)
+
 - gdb: examples of using (primarily b, bt)