lutemp (6) --- look up a template in the template directory 09/15/83 | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n integer function lutemp (temp, str, strlen) integer strlen character temp (ARB), str (strlen) Library: vswtlb (standard Subsystem library) _F_u_n_c_t_i_o_n | 'Lutemp' converts a single template into its equivalent string representation. The argument 'temp' is the template | to be expanded; 'str' is the string to receive the expansion | of at most 'strlen' characters. The function returns the | length of the expanded string contained in 'str' if the tem- plate was found, EOF otherwise. Normally, the routine 'expand' would be called to expand a template, since it rescans the text returned by 'lutemp' to evaluate any nested templates. | The following dynamic templates are available: date the current date, in form MMDDYY time the current time, in form HHMMSS user the login name of the user calling 'expand' pid the process id of the process calling 'expand' passwd the Subsystem password of the user calling 'expand' day the name of the current day of the week (e.g. tuesday) | home the login directory of the user calling | 'expand' The statically-defined templates reside in the file "=template=", and may be changed at the discretion of the Subsystem manager. For a complete list of templates, see the _U_s_e_r_'_s _G_u_i_d_e _t_o _t_h_e _P_r_i_m_o_s _F_i_l_e _S_y_s_t_e_m. Users may create their own personal templates by placing template names and replacement text in the file "=utemplate=" (nominally "=varsdir=/.template"). The template file is a standard text file which may be manipulated by any of the usual text processing tools. Each template appears on a line by itself, followed by blanks and its replacement text. Blank lines and comment lines (beginning with "#") may be added to the template file to improve readability. For an example of a template file, see lutemp (6) - 1 - lutemp (6) lutemp (6) --- look up a template in the template directory 09/15/83 =template=. _I_m_p_l_e_m_e_n_t_a_t_i_o_n | 'Lutemp' first looks up the requested template in a hashed | symbol table, which contains the values of all "static" | (determined at Subsystem initialization time) templates and | resides in the shared Subsystem data area, checking the | user's personal templates and then the system-defined tem- | plates. If the search succeeds, 'lutemp' returns the string | value associated with the template. Otherwise, 'lutemp' | assumes that the template is dynamic and searches a second | shared hash table containing the values of dynamic template. | If it finds the template in this table, 'lutemp' uses an | associated function code value to direct appropriate calls | to 'date' (for time, date, day, pid, user) or to file system | routines (for home), or to read values from Subsystem common | areas (for passwd). _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d str _C_a_l_l_s | equal, date, gcdir$, length, mapstr, scopy, Primos at$hom, | Primos at$or _B_u_g_s There is no protection against setting static values for the dynamic templates. The user can possibly cause problems for both himself and other Subsystem users by setting his own values for the dynamic template names. _S_e_e _A_l_s_o expand (2), open (2), getto (2), follow (2), _U_s_e_r_'_s _G_u_i_d_e _t_o _t_h_e _P_r_i_m_o_s _F_i_l_e _S_y_s_t_e_m lutemp (6) - 2 - lutemp (6)