/* parts.c */ #include #include #include "types.h" #include "parts.h" Pnodeptr palloc(void) { return (Pnodeptr) malloc(sizeof(struct pnode)); } void makenull_part(Pnodeptr *parts) { } int member_part(struct part_element_type x, Pnodeptr parts, Pnodeptr *p) { } int insert_part(struct part_element_type x, Pnodeptr *parts) { Pnodeptr p,q,r; int found; if (member_part(x,*parts,&r) == FALSE) { p = *parts; q = p; found = FALSE; while ((p != NULL) && !found) if(strcmp(p->part.pno,x.pno) < 0) { q = p; p = p->next; } else found = TRUE; if (q == p) { *parts = palloc(); (*parts)->part = x; (*parts)->next = p; return TRUE; } else { p = palloc(); p->part = x; p->next = q->next; q->next = p; return TRUE; } } else return FALSE; } int delete_part(struct part_element_type x, Snodeptr suppliers[], Pnodeptr *parts) { } void print_parts(Pnodeptr parts) { } void delete_all_supply_for_part(Pnodeptr q, Snodeptr suppliers[], Pnodeptr parts) { }