Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Evaluator_Dir_SRPC.H

Go to the documentation of this file.
00001 // Copyright (C) 2001, Compaq Computer Corporation
00002 // 
00003 // This file is part of Vesta.
00004 // 
00005 // Vesta is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 // 
00010 // Vesta is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with Vesta; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // Last modified on Mon Mar 24 10:44:49 EST 2003 by ken@xorian.net   
00020 //      modified on Fri Jul 14 18:50:32 PDT 2000 by mann   
00021 //      modified on Wed Sep 17 16:20:15 PDT 1997 by yuanyu 
00022 //      modified on Fri May 26 15:34:57 PDT 1995 by horning
00023 //      modified on Fri May 19 16:33:47 PDT 1995 by levin
00024 
00025 // This file describes the SRPC interface for evaluator directories.
00026 // An evaluator directory is a special form of immutable directory
00027 // used by the repository as the "base" for the mutable directory that
00028 // is provided for use as the file system root for an encapsulated tool.
00029 // An evaluator directory corresponds to a Vesta binding, and the
00030 // operations in this interface enable the repository implementation to
00031 // perform directory-like operations on the binding.  Since the
00032 // directory is immutable, only operations that interrogate its state
00033 // are defined.
00034 
00035 #ifndef Evaluator_Dir_SRPC_H
00036 #define Evaluator_Dir_SRPC_H
00037 
00038 // The interface includes the following procedures.  The enumeration
00039 // gives the value to be passed as the SRPC 'procId' parameter, and
00040 // the comments indicate arguments and return values.  The marshalled
00041 // types (i.e., those understood by SRPC) are parenthesized.
00042 
00043 enum { EVALUATOR_DIR_SRPC_VERSION = 3 };
00044 
00045 const int DIR_HANDLE_BYTES = 8;
00046 
00047 enum ed_entry_type {
00048   ed_none = 0,
00049   ed_directory = 1,
00050   ed_file = 2,
00051   ed_device = 3
00052 };
00053 
00054 enum ed_procs {
00055 
00056   ed_lookup = 0,
00057   // Arguments:
00058   //   dir      (bytes)    8-byte directory handle
00059   //   name     (chars)    name to be looked up in dir
00060   // Results:
00061   //   type     (int)      ed_entry_type.  If ed_none, name was not
00062   //                       found in dir.  Otherwise, additional results
00063   //                       follow:
00064   //   index    (int)      index of entry in dir 
00065   //   subdir   (bytes)    8-byte handle (present iff type == ed_directory)
00066   //   file     (int)      shortId of file (present iff type == ed_file)
00067   //   fptag    (bytes)    FP::Tag (present iff type == ed_file)
00068   //   rdev     (int)      device number (present iff type == ed_device)
00069 
00070   ed_lookup_index = 1,
00071   // Arguments:
00072   //   dir      (bytes)    8-byte directory handle
00073   //   index    (int)      index of entry in dir 
00074   // Results:
00075   //   type     (int)      ed_entry_type.  If ed_none, name was not
00076   //                       found in dir.  Otherwise, additional results
00077   //                       follow:
00078   //   name     (chars)    name in specified entry
00079   //   subdir   (bytes)    8-byte handle (present iff type == ed_directory)
00080   //   file     (int)      shortId of file (present iff type == ed_file)
00081   //   fptag    (bytes)    FP::Tag (present iff type == ed_file)
00082 
00083   ed_oldlist = 2,
00084   // Same as ed_list, but the "file" result is omitted.
00085 
00086   ed_list = 3
00087   // Arguments:
00088   //   dir      (bytes)    8-byte directory handle
00089   //   index    (int)      index at which to begin directory listing
00090   //   limit    (int)      maximum amount of listing to return, see below
00091   //   overhead (int)      used in limit calculation, see below
00092   // Results:
00093   //   returns a general sequence (in the SRPC sense), using send_seq_*
00094   //   (No length information is passed with send_seq_start.)  Each
00095   //   sequence element is a triple:
00096   //     name   (chars)    directory entry name
00097   //     type   (int)      ed_entry_type
00098   //     file   (int)      shortId of file (NullShortId if type != ed_file)
00099   //   The first element of the sequence will be the directory entry
00100   //   whose index is 'index'.  (The first entry in a directory has
00101   //   index 0.)  Successive elements of the sequence correspond to
00102   //   successively numbered members of the directory.  The sequence
00103   //   terminates when either:
00104   //     (a) extending the sequence by one would cause the cumulative
00105   //         cost of the sequence to exceed 'limit', where the cost
00106   //         of an element of the sequence is strlen(name)+overhead, or
00107   //     (b) the end of the directory is reached, in which case a
00108   //         special "terminating" entry is appended to the sequence
00109   //         whose 'name' is empty and whose 'type' is ed_none.  This
00110   //         entry is not included in the cost calculation.
00111   //   Notice that an empty sequence can arise only as a result of
00112   //   unfortunate settings for 'limit' and/or 'overhead'.
00113   //   It is an error to pass a negative number for 'index'.  Passing
00114   //   a value greater than the index of the last member in the directory
00115   //   is handled as in (b), above.
00116 
00117   };
00118 
00119 
00120 #endif  /* Evaluator_Dir_SRPC_H */

Generated on Mon May 8 00:48:44 2006 for Vesta by  doxygen 1.4.2