beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / src / cairo-error.c
blob1b9bd76be13a3c9218dcda33fbf7cb28b6f7fd37
1 /* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
2 /* cairo - a vector graphics library with display and print output
4 * Copyright © 2002 University of Southern California
5 * Copyright © 2005 Red Hat, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it either under the terms of the GNU Lesser General Public
9 * License version 2.1 as published by the Free Software Foundation
10 * (the "LGPL") or, at your option, under the terms of the Mozilla
11 * Public License Version 1.1 (the "MPL"). If you do not alter this
12 * notice, a recipient may use your version of this file under either
13 * the MPL or the LGPL.
15 * You should have received a copy of the LGPL along with this library
16 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
18 * You should have received a copy of the MPL along with this library
19 * in the file COPYING-MPL-1.1
21 * The contents of this file are subject to the Mozilla Public License
22 * Version 1.1 (the "License"); you may not use this file except in
23 * compliance with the License. You may obtain a copy of the License at
24 * http://www.mozilla.org/MPL/
26 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
27 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
28 * the specific language governing rights and limitations.
30 * The Original Code is the cairo graphics library.
32 * The Initial Developer of the Original Code is University of Southern
33 * California.
35 * Contributor(s):
36 * Carl D. Worth <cworth@cworth.org>
39 #include "cairoint.h"
40 #include "cairo-private.h"
42 #include "cairo-compiler-private.h"
43 #include "cairo-error-private.h"
45 #include <assert.h>
47 /**
48 * _cairo_error:
49 * @status: a status value indicating an error, (eg. not
50 * %CAIRO_STATUS_SUCCESS)
52 * Checks that status is an error status, but does nothing else.
54 * All assignments of an error status to any user-visible object
55 * within the cairo application should result in a call to
56 * _cairo_error().
58 * The purpose of this function is to allow the user to set a
59 * breakpoint in _cairo_error() to generate a stack trace for when the
60 * user causes cairo to detect an error.
62 * Return value: the error status.
63 **/
64 cairo_status_t
65 _cairo_error (cairo_status_t status)
67 CAIRO_ENSURE_UNIQUE;
68 assert (_cairo_status_is_error (status));
70 return status;
73 COMPILE_TIME_ASSERT ((int)CAIRO_INT_STATUS_LAST_STATUS == (int)CAIRO_STATUS_LAST_STATUS);