Lines Matching defs:jspec

74 format_jobspec(struct jobspec *jspec, int fmt_wanted)
85 if (jspec->fmtoutput != NULL) {
86 free(jspec->fmtoutput);
87 jspec->fmtoutput = NULL;
90 jspec->pluralfmt = 1; /* assume a "plural result" */
92 if (jspec->startnum >= 0) {
93 if (jspec->startnum != jspec->endrange)
95 jspec->startnum, jspec->endrange);
97 jspec->pluralfmt = 0;
99 jspec->startnum);
108 if (jspec->wanteduser != NULL)
109 strlcat(buildstr, jspec->wanteduser, strsize);
115 if (jspec->wantedhost != NULL)
120 if (jspec->wantedhost != NULL)
121 strsize += strlen(jspec->wantedhost);
122 jspec->fmtoutput = malloc(strsize);
125 strlcpy(jspec->fmtoutput, buildstr, strsize);
126 if (jspec->wantedhost != NULL)
127 strlcat(jspec->fmtoutput, jspec->wantedhost, strsize);
134 if (jspec->wanteduser != NULL) {
138 strlcat(buildstr, jspec->wanteduser, strsize);
140 if (jspec->wantedhost != NULL) {
141 if (jspec->wanteduser == NULL) {
151 if (jspec->wantedhost != NULL)
152 strsize += strlen(jspec->wantedhost);
153 jspec->fmtoutput = malloc(strsize);
156 strlcpy(jspec->fmtoutput, buildstr, strsize);
157 if (jspec->wantedhost != NULL)
158 strlcat(jspec->fmtoutput, jspec->wantedhost, strsize);
401 match_jobspec(struct jobqueue *jq, struct jobspec *jspec)
411 if (jspec == NULL || jq == NULL)
424 jspec->matcheduser = NULL;
429 if (jspec->startnum >= 0) {
430 if (jnum < jspec->startnum)
432 if (jnum > jspec->endrange)
443 if (jspec->wantedhost != NULL) {
444 if (fnmatch(jspec->wantedhost, cf_hoststr, 0) != 0)
452 if (jspec->wanteduser != NULL) {
456 if (fnmatch(jspec->wanteduser, cfinf->cji_acctuser, 0) != 0)
463 jspec->matchcnt++;
464 if (jspec->wanteduser != NULL) {
470 jspec->matcheduser = strdup(cfinf->cji_acctuser);
497 struct jobspec *jspec;
515 STAILQ_FOREACH(jspec, js_hdr, nextjs) {
518 matched = match_jobspec(*qent, jspec);
523 doentry(doentryinfo, *qent, jspec);
524 if (jspec->matcheduser != NULL) {
525 free(jspec->matcheduser);
526 jspec->matcheduser = NULL;
536 doentry(doentryinfo, NULL, jspec);
546 STAILQ_FOREACH(jspec, js_hdr, nextjs) {
547 matched = match_jobspec(*qent, jspec);
552 doentry(doentryinfo, *qent, jspec);
553 if (jspec->matcheduser != NULL) {
554 free(jspec->matcheduser);
555 jspec->matcheduser = NULL;