diff options
author | Albert Lee <trisk@acm.jhu.edu> | 2008-12-01 19:22:35 -0500 |
---|---|---|
committer | Albert Lee <trisk@acm.jhu.edu> | 2008-12-01 19:22:35 -0500 |
commit | f134aa3cff690cfd93baf716a2782980507841a2 (patch) | |
tree | e7e125738bb228ad596658cd68affb6ebf14a12f /src/cmd/9660srv | |
parent | 13c28c2c13b03e17817c9094ca159b424d1b947f (diff) | |
download | plan9port-f134aa3cff690cfd93baf716a2782980507841a2.tar.gz plan9port-f134aa3cff690cfd93baf716a2782980507841a2.tar.bz2 plan9port-f134aa3cff690cfd93baf716a2782980507841a2.zip |
9660srv: dynamically init fcalls
Diffstat (limited to 'src/cmd/9660srv')
-rw-r--r-- | src/cmd/9660srv/main.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/cmd/9660srv/main.c b/src/cmd/9660srv/main.c index c3e5d9c9..cd20570c 100644 --- a/src/cmd/9660srv/main.c +++ b/src/cmd/9660srv/main.c @@ -53,21 +53,25 @@ int nojoliet; int noplan9; int norock; -void (*fcalls[])(void) = { - [Tversion] rversion, - [Tflush] rflush, - [Tauth] rauth, - [Tattach] rattach, - [Twalk] rwalk, - [Topen] ropen, - [Tcreate] rcreate, - [Tread] rread, - [Twrite] rwrite, - [Tclunk] rclunk, - [Tremove] rremove, - [Tstat] rstat, - [Twstat] rwstat, -}; +void (*fcalls[Tmax])(void); + +static void +initfcalls(void) +{ + fcalls[Tversion]= rversion; + fcalls[Tflush]= rflush; + fcalls[Tauth]= rauth; + fcalls[Tattach]= rattach; + fcalls[Twalk]= rwalk; + fcalls[Topen]= ropen; + fcalls[Tcreate]= rcreate; + fcalls[Tread]= rread; + fcalls[Twrite]= rwrite; + fcalls[Tclunk]= rclunk; + fcalls[Tremove]= rremove; + fcalls[Tstat]= rstat; + fcalls[Twstat]= rwstat; +} void main(int argc, char **argv) @@ -76,6 +80,7 @@ main(int argc, char **argv) Xfsub **xs; char *mtpt; + initfcalls(); stdio = 0; mtpt = nil; ARGBEGIN { |