getptype3
Retrieve a ptype from a ptype_list
Synopsys
#include "mut.h" ptype_list ∗getptype(pthead,type) ptype_list ∗pthead; long type;
Parameters
pthead
|
Pointer to a |
|---|---|
type
|
Flag indicating the pointer owner |
Overview
getptype looks for a ptype element in the list pointed to by pthead.
Return value
getptype returns a pointer to the ptype that match the type. Be careful, it is not the ptype->DATA that is returned. If no ptype has the given type, then NULL is returned.
Examples
#include "mut.h"
#include "mph.h"
void get_corner(ptfig, name, x2, y2)
phfig_list ∗ptfig;
char ∗name;
int ∗x2, ∗y2;
{
phins_list ∗i = getphins(ptfig, name);
ptype_list ∗p = getptype(i->USER, (long)PLACEABOX);
∗x2 = (num_list ∗)(p->DATA)->DATA;
∗y2 = (num_list ∗)(p->DATA)->NEXT->DATA;
}
Releases
4 releases since Debian 7 (Wheezy); the text changed 1 time.