… | |
… | |
81 | } |
81 | } |
82 | |
82 | |
83 | struct vehicleprofile * |
83 | struct vehicleprofile * |
84 | vehicleprofile_new(struct attr *parent, struct attr **attrs) |
84 | vehicleprofile_new(struct attr *parent, struct attr **attrs) |
85 | { |
85 | { |
|
|
86 | dbg(0,"EEnter\n"); |
|
|
87 | |
86 | struct vehicleprofile *this_; |
88 | struct vehicleprofile *this_; |
87 | struct attr **attr, *type_attr; |
89 | struct attr **attr, *type_attr; |
88 | if (! (type_attr=attr_search(attrs, NULL, attr_name))) { |
90 | if (! (type_attr=attr_search(attrs, NULL, attr_name))) { |
89 | return NULL; |
91 | return NULL; |
90 | } |
92 | } |
… | |
… | |
96 | this_->height=-1; |
98 | this_->height=-1; |
97 | this_->weight=-1; |
99 | this_->weight=-1; |
98 | this_->axle_weight=-1; |
100 | this_->axle_weight=-1; |
99 | this_->through_traffic_penalty=9000; |
101 | this_->through_traffic_penalty=9000; |
100 | for (attr=attrs;*attr; attr++) |
102 | for (attr=attrs;*attr; attr++) |
|
|
103 | { |
101 | vehicleprofile_set_attr_do(this_, *attr); |
104 | vehicleprofile_set_attr_do(this_, *attr); |
|
|
105 | } |
|
|
106 | |
|
|
107 | dbg(0,"return\n"); |
102 | return this_; |
108 | return this_; |
103 | } |
109 | } |
104 | |
110 | |
105 | int |
111 | int |
106 | vehicleprofile_get_attr(struct vehicleprofile *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
112 | vehicleprofile_get_attr(struct vehicleprofile *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) |