void switch_size_pts_coords(struct size_pts *s)
{
- PTS_RET_IF(s == NULL, "Invalid argument");
+ PGEN_RET_IF(s == NULL, "Invalid argument");
double val;
val = s->x;
s->x = s->y;
void switch_size_px_coords(struct size_px *s)
{
- PTS_RET_IF(s == NULL, "Invalid argument");
+ PGEN_RET_IF(s == NULL, "Invalid argument");
int val;
val = s->x;
s->x = s->y;
void add_size_pts(const struct size_pts *from, struct size_pts *to)
{
- PTS_RET_IF(from == NULL || to == NULL, "Invalid argument");
+ PGEN_RET_IF(from == NULL || to == NULL, "Invalid argument");
to->x += from->x;
to->y += from->y;
}
void neg_size_pts(struct size_pts *s)
{
- PTS_RET_IF(s == NULL, "Invalid argument");
+ PGEN_RET_IF(s == NULL, "Invalid argument");
s->x = -s->x;
s->y = -s->y;
}
int i;
struct paper_size_pts *cur_s;
- PTS_RETV_IF(name == NULL || s == NULL, -1, "Invalid argument");
+ PGEN_RETV_IF(name == NULL || s == NULL, -1, "Invalid argument");
for (i = 0; paper_sizes[i].name != NULL; ++i) {
cur_s = &(paper_sizes[i]);
double ratio_x;
double ratio_y;
- PTS_RETV_IF(s_pts == NULL || border_s_px == NULL || px == NULL, -1 , "Invalid argument");
+ PGEN_RETV_IF(s_pts == NULL || border_s_px == NULL || px == NULL, -1 , "Invalid argument");
ratio_x = border_s_px->x / s_pts->x;
ratio_y = border_s_px->y / s_pts->y;
px->x = ratio_x * s_pts->x;
px->y = ratio_y * s_pts->y;
- PTS_DEBUG("px->x px->y :(%d, %d)",px->x, px->y);
+ PGEN_DEBUG("px->x px->y :(%d, %d)",px->x, px->y);
PGEN_TRACE_END;
return 0;
}