Lines Matching refs:sh
64 static share_t *sh = NULL;
73 if (sh == NULL) {
74 sh = (share_t *)malloc(sizeof (*sh));
75 if (sh == NULL)
84 sh->sh_path = strtok(p, w);
85 if (sh->sh_path == NULL)
87 sh->sh_res = strtok(NULL, w);
88 if (sh->sh_res == NULL)
90 sh->sh_fstype = strtok(NULL, w);
91 if (sh->sh_fstype == NULL)
93 sh->sh_opts = strtok(NULL, w);
94 if (sh->sh_opts == NULL)
96 sh->sh_descr = strtok(NULL, "");
97 if (sh->sh_descr == NULL)
98 sh->sh_descr = "";
100 *shp = sh;
105 sharedup(share_t *sh)
113 nsh->sh_path = strdup(sh->sh_path);
116 nsh->sh_res = strdup(sh->sh_res);
119 nsh->sh_fstype = strdup(sh->sh_fstype);
122 nsh->sh_opts = strdup(sh->sh_opts);
125 nsh->sh_descr = strdup(sh->sh_descr);
136 sharefree(share_t *sh)
138 if (sh == NULL)
140 if (sh->sh_path != NULL)
141 free(sh->sh_path);
142 if (sh->sh_res != NULL)
143 free(sh->sh_res);
144 if (sh->sh_fstype != NULL)
145 free(sh->sh_fstype);
146 if (sh->sh_opts != NULL)
147 free(sh->sh_opts);
148 if (sh->sh_descr != NULL)
149 free(sh->sh_descr);
150 free(sh);