Lines Matching refs:sh
63 static share_t *sh = NULL;
73 if (sh == NULL) {
74 sh = (share_t *)malloc(sizeof (*sh));
75 if (sh == NULL)
84 sh->sh_path = (char *)strtok_r(p, w, &lasts);
85 if (sh->sh_path == NULL)
87 sh->sh_res = (char *)strtok_r(NULL, w, &lasts);
88 if (sh->sh_res == NULL)
90 sh->sh_fstype = (char *)strtok_r(NULL, w, &lasts);
91 if (sh->sh_fstype == NULL)
93 sh->sh_opts = (char *)strtok_r(NULL, w, &lasts);
94 if (sh->sh_opts == NULL)
96 sh->sh_descr = (char *)strtok_r(NULL, "", &lasts);
97 if (sh->sh_descr == NULL)
98 sh->sh_descr = "";
100 *shp = sh;
105 sharedup(share_t *sh)
113 if (sh->sh_path) {
114 nsh->sh_path = strdup(sh->sh_path);
119 if (sh->sh_res) {
120 nsh->sh_res = strdup(sh->sh_res);
124 if (sh->sh_fstype) {
125 nsh->sh_fstype = strdup(sh->sh_fstype);
129 if (sh->sh_opts) {
130 nsh->sh_opts = strdup(sh->sh_opts);
134 if (sh->sh_descr) {
135 nsh->sh_descr = strdup(sh->sh_descr);
147 sharefree(share_t *sh)
149 if (sh->sh_path != NULL)
150 free(sh->sh_path);
151 if (sh->sh_res != NULL)
152 free(sh->sh_res);
153 if (sh->sh_fstype != NULL)
154 free(sh->sh_fstype);
155 if (sh->sh_opts != NULL)
156 free(sh->sh_opts);
157 if (sh->sh_descr != NULL)
158 free(sh->sh_descr);
159 free(sh);