third_party/cairo/src/cairo-svg-surface.c
static cairo_bool_t
_extract_svg_surface (cairo_surface_t *surface,
		      cairo_svg_surface_t **svg_surface)
{
    cairo_surface_t *target;

    if (surface->status)
	return FALSE;
    if (surface->finished) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
	return FALSE;
    }

    if (!_cairo_surface_is_paginated (surface)) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
	return FALSE;
    }

    target = _cairo_paginated_surface_get_target (surface);
    if (target->status) {
	(void) _cairo_surface_set_error (surface, target->status);
	return FALSE;
    }
    if (target->finished) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
	return FALSE;
    }

    if (!_cairo_surface_is_svg (target)) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
	return FALSE;
    }

    *svg_surface = (cairo_svg_surface_t *) target;
    return TRUE;
}
/* If the abstract_surface is a paginated surface, and that paginated
 * surface's target is a svg_surface, then set svg_surface to that
 * target. Otherwise return FALSE.
 */
If the abstract_surface is a paginated surface, and that paginated
surface's target is a svg_surface, then set svg_surface to that
target. Otherwise return FALSE.
If the abstract_surface is a paginated surface and that paginated surface ' s target is a svg_surface then set svg_surface to that target . Otherwise return FALSE .
static cairo_bool_t
_extract_svg_surface (cairo_surface_t *surface,
		      cairo_svg_surface_t **svg_surface)
{
    cairo_surface_t *target;
    if (surface->status)
	return FALSE;
    if (surface->finished) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
	return FALSE;
    }
    if (!_cairo_surface_is_paginated (surface)) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
	return FALSE;
    }
    target = _cairo_paginated_surface_get_target (surface);
    if (target->status) {
	(void) _cairo_surface_set_error (surface, target->status);
	return FALSE;
    }
    if (target->finished) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_FINISHED));
	return FALSE;
    }
    if (!_cairo_surface_is_svg (target)) {
	(void) _cairo_surface_set_error (surface, _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH));
	return FALSE;
    }
    *svg_surface = (cairo_svg_surface_t *) target;
    return TRUE;
}
static cairo_bool_t _extract_svg_surface ( cairo_surface_t * surface , cairo_svg_surface_t * * svg_surface ) { cairo_surface_t * target ; if ( surface -> status ) return FALSE ; if ( surface -> finished ) { ( void ) _cairo_surface_set_error ( surface , _cairo_error ( CAIRO_STATUS_SURFACE_FINISHED ) ) ; return FALSE ; } if ( ! _cairo_surface_is_paginated ( surface ) ) { ( void ) _cairo_surface_set_error ( surface , _cairo_error ( CAIRO_STATUS_SURFACE_TYPE_MISMATCH ) ) ; return FALSE ; } target = _cairo_paginated_surface_get_target ( surface ) ; if ( target -> status ) { ( void ) _cairo_surface_set_error ( surface , target -> status ) ; return FALSE ; } if ( target -> finished ) { ( void ) _cairo_surface_set_error ( surface , _cairo_error ( CAIRO_STATUS_SURFACE_FINISHED ) ) ; return FALSE ; } if ( ! _cairo_surface_is_svg ( target ) ) { ( void ) _cairo_surface_set_error ( surface , _cairo_error ( CAIRO_STATUS_SURFACE_TYPE_MISMATCH ) ) ; return FALSE ; } * svg_surface = ( cairo_svg_surface_t * ) target ; return TRUE ; }
If the abstract_surface is a paginated surface, and that paginated
 surface's target is a svg_surface, then set svg_surface to that
 target.
If the abstract_surface is a paginated surface and that paginated surface ' s target is a svg_surface then set svg_surface to that target .