This file is indexed.

/usr/include/midgard2/midgard/midgard_error.h is in libmidgard2-dev 10.05.7.1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* 
 * Copyright (C) 2006 Piotr Pokora <piotrek.pokora@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef MIDGARD_ERROR_H
#define MIDGARD_ERROR_H

#include "midgard_connection.h"

G_BEGIN_DECLS

#define MIDGARD_GENERIC_ERROR midgard_error_generic()
#define MGD_GENERIC_ERROR MIDGARD_GENERIC_ERROR

typedef enum
{
	MGD_ERR_OK = -0, /**< MD_ERR_OK  <br /> */ 
	MGD_ERR_ERROR = -1, /**<  <br />*/ 
	MGD_ERR_ACCESS_DENIED = -2, /**< Access denied *  <br /> */
	MGD_ERR_NO_METADATA = -3,
	MGD_ERR_NOT_OBJECT = -4, /**< Not Midgard Object   <br /> */
	MGD_ERR_NOT_EXISTS = -5, /**< Object does not exist   <br /> */
	MGD_ERR_INVALID_NAME = -6 , /**<   <br /> */
	MGD_ERR_DUPLICATE = -7 , /**< Object already exist   <br /> */
	MGD_ERR_HAS_DEPENDANTS = -8 , /**< Object has dependants   <br /> */
	MGD_ERR_RANGE = -9, /**<   <br /> */
	MGD_ERR_NOT_CONNECTED = -10, /**< Not connected to the Midgard database   <br /> */
	MGD_ERR_SG_NOTFOUND = -11, /**< Sitegroup not found   <br /> */
	MGD_ERR_INVALID_OBJECT = -12, /**< Object not registered as Midgard Object   <br /> */ 
	MGD_ERR_QUOTA = -13, /**< Quota limit reached   <br /> */
	MGD_ERR_INTERNAL = -14, /**< Critical internal error   <br /> */
	MGD_ERR_OBJECT_NAME_EXISTS = -15, /**< Object with such name exists in tree   <br /> */
	MGD_ERR_OBJECT_NO_STORAGE = -16, /**< Storage table not defined for object   <br /> */
	MGD_ERR_OBJECT_NO_PARENT= -17, /**< Parent object in tree not defined   <br /> */
	MGD_ERR_INVALID_PROPERTY_VALUE = -18, /**< Invalid property value   <br /> */
	MGD_ERR_INVALID_PROPERTY = -19, /**<Invalid property <br />*/
	MGD_ERR_USER_DATA = -20, /**< Empty error message reserved for application's developers   <br /> */
	MGD_ERR_OBJECT_DELETED = -21, /**< Object deleted   <br /> */
	MGD_ERR_OBJECT_PURGED = -22, /**< Object purged   <br /> */
	MGD_ERR_OBJECT_EXPORTED = -23, /**< Object already exported   <br /> */
	MGD_ERR_OBJECT_IMPORTED = -24, /**< Object already imported   <br /> */
	MGD_ERR_MISSED_DEPENDENCE = -25, /**< Missed dependence for object   <br /> */
	MGD_ERR_TREE_IS_CIRCULAR = -26, /**< Circular reference found in object's tree <br />*/
	MGD_ERR_OBJECT_IS_LOCKED = -27 /**< Object is locked */
}MgdErrorGeneric;

typedef enum
{
	MIDGARD_GENERIC_ERROR_OK = -0, /**< MD_ERR_OK  <br /> */ 
	MIDGARD_GENERIC_ERROR_ERROR = -1, /**<  <br />*/ 
	MIDGARD_GENERIC_ERROR_ACCESS_DENIED = -2, /**< Access denied *  <br /> */
	MIDGARD_GENERIC_ERROR_NO_METADATA = -3,
	MIDGARD_GENERIC_ERROR_NOT_OBJECT = -4, /**< Not Midgard Object   <br /> */
	MIDGARD_GENERIC_ERROR_NOT_EXISTS = -5, /**< Object does not exist   <br /> */
	MIDGARD_GENERIC_ERROR_INVALID_NAME = -6 , /**<   <br /> */
	MIDGARD_GENERIC_ERROR_DUPLICATE = -7 , /**< Object already exist   <br /> */
	MIDGARD_GENERIC_ERROR_HAS_DEPENDANTS = -8 , /**< Object has dependants   <br /> */
	MIDGARD_GENERIC_ERROR_RANGE = -9, /**<   <br /> */
	MIDGARD_GENERIC_ERROR_NOT_CONNECTED = -10, /**< Not connected to the Midgard database   <br /> */
	MIDGARD_GENERIC_ERROR_SG_NOTFOUND = -11, /**< Sitegroup not found   <br /> */
	MIDGARD_GENERIC_ERROR_INVALID_OBJECT = -12, /**< Object not registered as Midgard Object   <br /> */ 
	MIDGARD_GENERIC_ERROR_QUOTA = -13, /**< Quota limit reached   <br /> */
	MIDGARD_GENERIC_ERROR_INTERNAL = -14, /**< Critical internal error   <br /> */
	MIDGARD_GENERIC_ERROR_OBJECT_NAME_EXISTS = -15, /**< Object with such name exists in tree   <br /> */
	MIDGARD_GENERIC_ERROR_OBJECT_NO_STORAGE = -16, /**< Storage table not defined for object   <br /> */
	MIDGARD_GENERIC_ERROR_OBJECT_NO_PARENT= -17, /**< Parent object in tree not defined   <br /> */
	MIDGARD_GENERIC_ERROR_INVALID_PROPERTY_VALUE = -18, /**< Invalid property value   <br /> */
	MIDGARD_GENERIC_ERROR_INVALID_PROPERTY = -19, /**<Invalid property <br />*/
	MIDGARD_GENERIC_ERROR_USER_DATA = -20, /**< Empty error message reserved for application's developers   <br /> */
	MIDGARD_GENERIC_ERROR_OBJECT_DELETED = -21, /**< Object deleted   <br /> */
	MIDGARD_GENERIC_ERROR_OBJECT_PURGED = -22, /**< Object purged   <br /> */
	MIDGARD_GENERIC_ERROR_OBJECT_EXPORTED = -23, /**< Object already exported   <br /> */
	MIDGARD_GENERIC_ERROR_OBJECT_IMPORTED = -24, /**< Object already imported   <br /> */
	MIDGARD_GENERIC_ERROR_MISSED_DEPENDENCE = -25, /**< Missed dependence for object   <br /> */
	MIDGARD_GENERIC_ERROR_TREE_IS_CIRCULAR = -26, /**< Circular reference found in object's tree <br />*/
	MIDGARD_GENERIC_ERROR_OBJECT_IS_LOCKED = -27 /**< Object is locked */
} MidgardGenericError;

GQuark 		midgard_error_generic		(void);
const gchar 	*midgard_error_string		(GQuark domain, gint errcode);
void 		midgard_set_error		(MidgardConnection *mgd, GQuark domain, gint errcode, const gchar *msg, ...);
void 		midgard_error_default_log	(const gchar *domain, GLogLevelFlags level, const gchar *msg, gpointer ptr);
gint 		midgard_error_parse_loglevel	(const gchar *levelstring);

#define MIDGARD_ERRNO_SET(str, errcode)  \
	str->errnum = errcode;  \
	midgard_set_error(str, \
	MGD_GENERIC_ERROR, \
	errcode, \
	NULL); \
	g_signal_emit_by_name(str, "error"); 	

#define MIDGARD_ERRNO_SET_STRING(__mgd, __errcode, __format...) G_STMT_START { \
	__mgd->errnum = __errcode; \
	midgard_set_error(__mgd, \
			MGD_GENERIC_ERROR, \
                        __errcode, __format); \
        g_clear_error(&__mgd->err); \
	g_signal_emit_by_name (__mgd, "error"); \
	} G_STMT_END

void mgd_info(const gchar *format, ...);

G_END_DECLS

#endif /* MIDGARD_ERROR_H */