DECODESTDIN(3) DECODESTDIN(3) NNAAMMEE DecodeStdin - Decode form contents from a multipart/form- data WWW form SSYYNNOOPPSSIISS ##iinncclluuddee <> iinntt DDeeccooddeeSSttddiinn((ddeennttrryy **_d_a_t_a));; cchhaarr **cchheecckk__ddsseerrrroorr((_i_n_t));; ddeennttrryy _d_a_t_a_[_c_o_u_n_t_]_; eexxtteerrnn lloonngg _c_o_n_t_e_n_t_L_e_n_g_t_h_; eexxtteerrnn lloonngg _b_y_t_e_s_R_e_a_d_; cchhaarr _c_g_i_U_p_l_o_a_d_D_i_r_[_P_A_T_H___M_A_X_+_1_]_; DDEESSCCRRIIPPTTIIOONN DDeeccooddeeSSttddiinn parses stdin from a WWW form that contains the enctype multipart/form-data allocating memory for the information submitted and placing it in a dentry struc- ture. ddaattaa is a pointer to an array of dentry structures. DDeeccooddeeSSttddiinn returns the number of form fields found. If num is less then 0, a call to cchheecckk__ddsseerrrroorr((iinntt)) will return a pointer to a string that contains the text equiv- alent of the error number. DDeeccooddeeSSttddiinn is passed a structure which will be filled in with the contents of the submitted form. The structure is as follows: typedef struct { char *name; /* form field name */ char *val; /* form field value */ int type; /* form field type */ } dentry; The members of the structure are: _n_a_m_e The name value of the form input. _v_a_l The value entered by the user. _t_y_p_e One of three values defined in cgiupl.h, TYPE_FILE meaning file data (val will contain the name), TYPE_DATA meaning input, select, radio etc value, or TYPE_EMPTYFILE, where the file was not uploaded. BBUUGGSS There are no bugs known at this time, please report bugs to jbourne@hardrock.org. 1 DECODESTDIN(3) DECODESTDIN(3) 2