Home | History | Annotate | Download | only in libutil

Lines Matching refs:mp

64 getmntoptstr(mntoptparse_t mp, const char *opt)
68 for (m = mp->mopts; m->m_option != NULL; m++)
79 return mp->optarg[m - mp->mopts];
83 getmntoptnum(mntoptparse_t mp, const char *opt)
88 const char *val = getmntoptstr(mp, opt);
115 freemntopts(mntoptparse_t mp)
117 free(mp->optbuf);
118 free(mp->optarg);
119 free(mp);
131 mntoptparse_t mp;
136 if ((mp = malloc(sizeof(struct mntoptparse))) == NULL)
140 if ((mp->optbuf = strdup(options)) == NULL) {
141 free(mp);
145 if ((mp->optarg = calloc(nopts, sizeof(char *))) == NULL) {
146 free(mp->optbuf);
147 free(mp);
151 mp->mopts = m0;
152 mp->options = options;
154 for (opt = mp->optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
178 mp->optarg[m - m0] = p;
187 free(mp->optbuf);
188 free(mp);
193 return mp;