job.c - 9base - revived minimalist port of Plan 9 userland to Unix
 (HTM) git clone git://git.suckless.org/9base
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       job.c (695B)
       ---
            1 #include        "mk.h"
            2 
            3 Job *
            4 newjob(Rule *r, Node *nlist, char *stem, char **match, Word *pre, Word *npre, Word *tar, Word *atar)
            5 {
            6         register Job *j;
            7 
            8         j = (Job *)Malloc(sizeof(Job));
            9         j->r = r;
           10         j->n = nlist;
           11         j->stem = stem;
           12         j->match = match;
           13         j->p = pre;
           14         j->np = npre;
           15         j->t = tar;
           16         j->at = atar;
           17         j->nproc = -1;
           18         j->next = 0;
           19         return(j);
           20 }
           21 
           22 void
           23 dumpj(char *s, Job *j, int all)
           24 {
           25         Bprint(&bout, "%s\n", s);
           26         while(j){
           27                 Bprint(&bout, "job@%ld: r=%ld n=%ld stem='%s' nproc=%d\n",
           28                         j, j->r, j->n, j->stem, j->nproc);
           29                 Bprint(&bout, "\ttarget='%s' alltarget='%s' prereq='%s' nprereq='%s'\n",
           30                         wtos(j->t, ' '), wtos(j->at, ' '), wtos(j->p, ' '), wtos(j->np, ' '));
           31                 j = all? j->next : 0;
           32         }
           33 }