Now you can simply try source code browsing on clicking here. You will see the definition of rt_mach_msg which is the real-time IPC function of RT-Mach MK95. If there are unknown keywords, functions or type-definitions (which must be hyper-linked, i.e., underlined) in it, you can click them and browse beyond the keyword.
WebSrc works based on a particular database that contains relations between each keyword and file name in which the keyword is defined (i.e., the keyword and the location of its definition). For any source tree, you must prepare such database in advance. Note that all you need is the database instead a fully HTML converted source tree. HTML conversion will be performed on demand only when you issue a CGI request.
On receiving a user request in the CGI fashion, WebSrc makes adequate response. For example, in case that the request contains a keyword, WebSrc looks up the keyword in a designated database, and if there is the corresponding tupple, it outputs the source file in the html style. In another case that the request contains only a file name, WebSrc simply finds the source code and outputs similarly.
The picture below depicts the relationship between elements composing the WebSrc system.
In practice, when WebSrc generates a database, the following tupples of information are required:
KEYWORD1 LINE1 FILE1where KEYWORD is the keyword which will be printed as a clickable link, FILE is the file name in which the keyword is defined, LINE is the beginning line number of the definition part in the file.
KEYWORD2 LINE2 FILE2
...
KEYWORDn LINEn FILEn
One easy solution is to use ``ctags'', which reasonably produces what we want. It is also recommended since it supports Pascal and FORTRAN as well as C language. Otherwise, you can use another kind of cross referencer, such as ``cxref'', but cxref is C specific and requires a completely arranged source tree.
In general, WebSrc is activated through its stub CGI program which is called by httpd server and activates WebSrc, adding the common information for the group depending on the stub.
There are two types of activation: one is issued from WebSrc's html style output, directly identifying the keyword, line number, and file name. Since all of keywords included in the original source file are fully looked up, we can say this is a priori activation in a sense. Another is issued through browser's form input, allowing higher flexibility to the user query.
mach_msg_return_t rt_mach_msg(msg, option, send_size, rcv_size, rcv_name, timeout, notify) rt_mach_msg_header_t *msg; mach_msg_option_t option; mach_msg_size_t send_size; mach_msg_size_t rcv_size; mach_port_t rcv_name; mach_msg_timeout_t timeout; mach_port_t notify; { mach_msg_return_t mr; ...
Please input a keyword, ``rt_mach_msg'' for example, and click the Search button (or press RETURN key). Before long, you will see the same output as you click the a priori keyword ``rt_mach_msg''. Then, click the [Allow partial matching:] Yes button in addition to the present condition, and push the Search button again. This query maybe requires a longer wait than above, but you will obtain more information, that is, other partially matching entries will be listed.
WebSrc is a small C code. You can compile it by only executing ``make prog'' command, then put it to the cgi accessible path, such as ``$(server directory)/cgi-bin''. I hope someone port it to Perl as a script so that there is no need to compile it.
Like WebSrc, other files, such as database, stub, and table of contents, etc. are also made through ``make others''. You only have to edit the Makefile for your configuration like follows:
######################################################################## # # User configurable variables # ######################################################################## # Default database path DBPATH = /export5/apache/cgi-bin/narita # converter name CGI = websrc # converter path CGIPATH = /export5/apache/cgi-bin/narita # Stub cgi path STUBPATH = /export5/apache/cgi-bin/narita # Stub cgi URL STUBURL = /cgi-bin/narita ######################################################################## # # RT-Mach # ######################################################################## # Source tree's origin ORIGIN = /usr/src3/RT-Mach/rtmach.RMK95/mk # database name DB = rmk # Stub cgi name STUB = stubRMK # Searcher URL SEARCHERURL = /person/narita/RTMACH.html # Searcher Title SEARCHERTITLE = 'Exploring the RT-Mach MK95 Source Code'
On executing ``make'', there are 6 files generated (note that ``rmk'' is the database's name, here):
You have to put the stub and database file to the explicitly specified place. Remember that you should not change the stub and database name when you move them to the directory.
It is responsible for you to create the searcher tag, like this. Searcher tag's fundamental function is to construct a query and send it to cgi stub. The query can be generated through the html FORM tag, GET method. You have to prepare the following input fields:
If you are interested in our WebSrc or have some problems, please ask us your question by e-mail to narita@mt.cs.keio.ac.jp.
You can download WebSrc source code on clicking here. All rights reserved. Copyright (C) 1996 by NARITA Tomio (narita@mt.cs.keio.ac.jp).