From 5aa8031e5b1f6d4140cc7f16a9e88dd504e004c2 Mon Sep 17 00:00:00 2001 From: "raveit65 (via Travis CI)" Date: Thu, 22 Feb 2024 15:01:06 +0000 Subject: Deploy mate-desktop/python-caja to github.com/mate-desktop/python-caja.git:gh-pages --- .../0.html | 1427 ++++++++++++++++++++ .../1.html | 337 +++++ .../2.html | 399 ++++++ .../3.html | 935 +++++++++++++ .../index.html | 227 ++++ .../stats.html | 173 +++ .../style.css | 177 +++ 7 files changed, 3675 insertions(+) create mode 100644 2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/0.html create mode 100644 2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/1.html create mode 100644 2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/2.html create mode 100644 2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/3.html create mode 100644 2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/index.html create mode 100644 2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/stats.html create mode 100644 2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/style.css (limited to '2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master') diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/0.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/0.html new file mode 100644 index 0000000..55aed9f --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/0.html @@ -0,0 +1,1427 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
  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
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ *  Copyright (C) 2004 Novell, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library 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
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Dave Camp <dave@ximian.com>
+ *
+ */
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define NO_IMPORT
+
+#include "caja-python-object.h"
+#include "caja-python.h"
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <pygobject.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Caja extension headers */
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-info-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-column-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-location-widget-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-property-page-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define METHOD_PREFIX ""
+
+static GObjectClass *parent_class;
+
+/* These macros assumes the following things:
+ *   a METHOD_NAME is defined with is a string
+ *   a goto label called beach
+ *   the return value is called ret
+ */
+
+#define CHECK_METHOD_NAME(self)                                        \
+	if (!PyObject_HasAttrString(self, METHOD_NAME))                    \
+		goto beach;
+
+#define CHECK_OBJECT(object)										   \
+  	if (object->instance == NULL)									   \
+  	{																   \
+  		g_object_unref (object);									   \
+  		goto beach;													   \
+  	}																   \
+
+#define CONVERT_LIST(py_files, files)                                  \
+	{                                                                  \
+		GList *l;                                                      \
+        py_files = PyList_New(0);                                      \
+		for (l = files; l; l = l->next)                                \
+		{                                                              \
+			PyList_Append(py_files, pygobject_new((GObject*)l->data)); \
+		}                                                              \
+	}
+
+#define HANDLE_RETVAL(py_ret)                                          \
+    if (!py_ret)                                                       \
+    {                                                                  \
+        PyErr_Print();                                                 \
+		goto beach;                                                    \
+ 	}                                                                  \
+ 	else if (py_ret == Py_None)                                        \
+ 	{                                                                  \
+ 		goto beach;                                                    \
+	}
+
+#define HANDLE_LIST(py_ret, type, type_name)                           \
+    {                                                                  \
+        Py_ssize_t i = 0;                                              \
+    	if (!PySequence_Check(py_ret) || PyUnicode_Check(py_ret))      \
+    	{                                                              \
+    		PyErr_SetString(PyExc_TypeError,                           \
+    						METHOD_NAME " must return a sequence");    \
+    		goto beach;                                                \
+    	}                                                              \
+    	for (i = 0; i < PySequence_Size (py_ret); i++)                 \
+    	{                                                              \
+    		PyGObject *py_item;                                        \
+    		py_item = (PyGObject*)PySequence_GetItem (py_ret, i);      \
+    		if (!pygobject_check(py_item, &Py##type##_Type))           \
+    		{                                                          \
+    			PyErr_SetString(PyExc_TypeError,                       \
+    							METHOD_NAME                            \
+    							" must return a sequence of "          \
+    							type_name);                            \
+    			goto beach;                                            \
+    		}                                                          \
+    		ret = g_list_append (ret, (type*) g_object_ref(py_item->obj));  \
+            Py_DECREF(py_item);                                        \
+    	}                                                              \
+    }
+
+static void
+free_pygobject_data(gpointer data, gpointer user_data)
+{
+	/* Some CajaFile objects are cached and not freed until caja
+		itself is closed.  Since PyGObject stores data that must be freed by
+		the Python interpreter, we must always free it before the interpreter
+		is finalized. */
+	g_object_set_data((GObject *)data, "PyGObject::instance-data", NULL);
+}
+
+static void
+free_pygobject_data_list(GList *list)
+{
+	if (list == NULL)
+		return;
+
+	g_list_foreach(list, (GFunc)free_pygobject_data, NULL);
+}
+
+static PyObject *
+caja_python_boxed_new (PyTypeObject *type, gpointer boxed, gboolean free_on_dealloc)
+{
+	PyGBoxed *self = (PyGBoxed *) type->tp_alloc (type, 0);
+	self->gtype = pyg_type_from_object ( (PyObject *) type);
+	self->boxed = boxed;
+	self->free_on_dealloc = free_on_dealloc;
+
+	return (PyObject *) self;
+}
+
+#define METHOD_NAME "get_property_pages"
+static GList *
+caja_python_object_get_property_pages (CajaPropertyPageProvider *provider,
+										   GList 						*files)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    PyObject *py_files, *py_ret = NULL;
+    GList *ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+	CONVERT_LIST(py_files, files);
+
+    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 "(N)", py_files);
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaPropertyPage, "Caja.PropertyPage");
+
+ beach:
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_property_page_provider_iface_init (CajaPropertyPageProviderIface *iface)
+{
+	iface->get_pages = caja_python_object_get_property_pages;
+}
+
+#define METHOD_NAME "get_widget"
+static GtkWidget *
+caja_python_object_get_widget (CajaLocationWidgetProvider *provider,
+								   const char 				 	  *uri,
+								   GtkWidget 					  *window)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+	GtkWidget *ret = NULL;
+	PyObject *py_ret = NULL;
+	PyGObject *py_ret_gobj;
+	PyObject *py_uri = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+	py_uri = PyUnicode_FromString(uri);
+
+	py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 "(NN)", py_uri,
+								 pygobject_new((GObject *)window));
+	HANDLE_RETVAL(py_ret);
+
+	py_ret_gobj = (PyGObject *)py_ret;
+	if (!pygobject_check(py_ret_gobj, &PyGtkWidget_Type))
+	{
+		PyErr_SetString(PyExc_TypeError,
+					    METHOD_NAME "should return a gtk.Widget");
+		goto beach;
+	}
+	ret = (GtkWidget *)g_object_ref(py_ret_gobj->obj);
+
+ beach:
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+	return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_location_widget_provider_iface_init (CajaLocationWidgetProviderIface *iface)
+{
+	iface->get_widget = caja_python_object_get_widget;
+}
+
+#define METHOD_NAME "get_file_items"
+static GList *
+caja_python_object_get_file_items (CajaMenuProvider *provider,
+									   GtkWidget 			*window,
+									   GList 				*files)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL, *py_files;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	if (PyObject_HasAttrString(object->instance, "get_file_items_full"))
+	{
+		CONVERT_LIST(py_files, files);
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_file_items_full",
+									 "(NNN)",
+									 pygobject_new((GObject *)provider),
+									 pygobject_new((GObject *)window),
+									 py_files);
+	}
+	else if (PyObject_HasAttrString(object->instance, "get_file_items"))
+	{
+		CONVERT_LIST(py_files, files);
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+									 "(NN)",
+									 pygobject_new((GObject *)window),
+									 py_files);
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaMenuItem, "Caja.MenuItem");
+
+ beach:
+ 	free_pygobject_data_list(files);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+#define METHOD_NAME "get_background_items"
+static GList *
+caja_python_object_get_background_items (CajaMenuProvider *provider,
+											 GtkWidget 			  *window,
+											 CajaFileInfo 	  *file)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	if (PyObject_HasAttrString(object->instance, "get_background_items_full"))
+	{
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_background_items_full",
+									 "(NNN)",
+									 pygobject_new((GObject *)provider),
+									 pygobject_new((GObject *)window),
+									 pygobject_new((GObject *)file));
+	}
+	else if (PyObject_HasAttrString(object->instance, "get_background_items"))
+	{
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+									 "(NN)",
+									 pygobject_new((GObject *)window),
+									 pygobject_new((GObject *)file));
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaMenuItem, "Caja.MenuItem");
+
+ beach:
+	free_pygobject_data(file, NULL);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+	iface->get_background_items = caja_python_object_get_background_items;
+	iface->get_file_items = caja_python_object_get_file_items;
+}
+
+#define METHOD_NAME "get_columns"
+static GList *
+caja_python_object_get_columns (CajaColumnProvider *provider)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();                                    \
+
+	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 NULL);
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaColumn, "Caja.Column");
+
+ beach:
+	if (py_ret != NULL)
+		Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_column_provider_iface_init (CajaColumnProviderIface *iface)
+{
+	iface->get_columns = caja_python_object_get_columns;
+}
+
+#define METHOD_NAME "cancel_update"
+static void
+caja_python_object_cancel_update (CajaInfoProvider 		*provider,
+									  CajaOperationHandle 	*handle)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+	PyObject *py_handle = caja_python_boxed_new (_PyCajaOperationHandle_Type, handle, FALSE);
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+    PyObject_CallMethod(object->instance,
+								 METHOD_PREFIX METHOD_NAME, "(NN)",
+								 pygobject_new((GObject*)provider),
+								 py_handle);
+
+ beach:
+	pyg_gil_state_release(state);
+}
+#undef METHOD_NAME
+
+#define METHOD_NAME "update_file_info"
+static CajaOperationResult
+caja_python_object_update_file_info (CajaInfoProvider 		*provider,
+										 CajaFile 				*file,
+										 GClosure 					*update_complete,
+										 CajaOperationHandle   **handle)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    CajaOperationResult ret = CAJA_OPERATION_COMPLETE;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+	static volatile gssize handle_generator = 1;
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	*handle = NULL;
+
+	if (PyObject_HasAttrString(object->instance, "update_file_info_full"))
+	{
+        PyObject *py_handle;
+		void *h;
+
+        /* Generate a new handle with a default value. */
+        do {
+            h = (CajaOperationHandle *) g_atomic_pointer_add (&handle_generator, 1);
+        } while (!h);
+        py_handle = caja_python_boxed_new (_PyCajaOperationHandle_Type,
+                                           h, FALSE);
+
+		py_ret = PyObject_CallMethod(object->instance,
+									 METHOD_PREFIX "update_file_info_full", "(NNNN)",
+									 pygobject_new((GObject*)provider),
+									 py_handle,
+									 pyg_boxed_new(G_TYPE_CLOSURE, update_complete, TRUE, TRUE),
+									 pygobject_new((GObject*)file));
+		*handle = (void *) ((PyGBoxed *) py_handle)->boxed;
+	}
+	else if (PyObject_HasAttrString(object->instance, "update_file_info"))
+	{
+		py_ret = PyObject_CallMethod(object->instance,
+									 METHOD_PREFIX METHOD_NAME, "(N)",
+									 pygobject_new((GObject*)file));
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	if (!PyLong_Check(py_ret))
+	{
+		PyErr_SetString(PyExc_TypeError,
+						METHOD_NAME " must return None or a int");
+		goto beach;
+	}
+
+	ret = PyLong_AsLong(py_ret);
+
+    if (!*handle && ret == CAJA_OPERATION_IN_PROGRESS)
+        ret = CAJA_OPERATION_FAILED;
+
+ beach:
+ 	free_pygobject_data(file, NULL);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_info_provider_iface_init (CajaInfoProviderIface *iface)
+{
+	iface->cancel_update = caja_python_object_cancel_update;
+	iface->update_file_info = caja_python_object_update_file_info;
+}
+
+static void
+caja_python_object_instance_init (CajaPythonObject *object)
+{
+	CajaPythonObjectClass *class;
+  	debug_enter();
+
+	class = (CajaPythonObjectClass*)(((GTypeInstance*)object)->g_class);
+
+	object->instance = PyObject_CallObject(class->type, NULL);
+	if (object->instance == NULL)
+		PyErr_Print();
+}
+
+static void
+caja_python_object_finalize (GObject *object)
+{
+  	debug_enter();
+
+	if (((CajaPythonObject *)object)->instance != NULL)
+		Py_DECREF(((CajaPythonObject *)object)->instance);
+}
+
+static void
+caja_python_object_class_init (CajaPythonObjectClass *class,
+								   gpointer 				  class_data)
+{
+	debug_enter();
+
+	parent_class = g_type_class_peek_parent (class);
+
+	class->type = (PyObject*)class_data;
+
+	G_OBJECT_CLASS (class)->finalize = caja_python_object_finalize;
+}
+
+GType
+caja_python_object_get_type (GTypeModule *module,
+								 PyObject 	*type)
+{
+	GTypeInfo *info;
+	const char *type_name;
+	GType gtype;
+
+	static const GInterfaceInfo property_page_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_property_page_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo location_widget_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_location_widget_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo menu_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_menu_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo column_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_column_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo info_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_info_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	debug_enter_args("type=%s", PyUnicode_AsUTF8(PyObject_GetAttrString(type, "__name__")));
+	info = g_new0 (GTypeInfo, 1);
+
+	info->class_size = sizeof (CajaPythonObjectClass);
+	info->class_init = (GClassInitFunc)caja_python_object_class_init;
+	info->instance_size = sizeof (CajaPythonObject);
+	info->instance_init = (GInstanceInitFunc)caja_python_object_instance_init;
+
+	info->class_data = type;
+	Py_INCREF(type);
+
+	type_name = g_strdup_printf("%s+CajaPython",
+								PyUnicode_AsUTF8(PyObject_GetAttrString(type, "__name__")));
+
+	gtype = g_type_module_register_type (module,
+										 G_TYPE_OBJECT,
+										 type_name,
+										 info, 0);
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaPropertyPageProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_PROPERTY_PAGE_PROVIDER,
+									 &property_page_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaLocationWidgetProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_LOCATION_WIDGET_PROVIDER,
+									 &location_widget_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaMenuProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_MENU_PROVIDER,
+									 &menu_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaColumnProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_COLUMN_PROVIDER,
+									 &column_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaInfoProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_INFO_PROVIDER,
+									 &info_provider_iface_info);
+	}
+
+	return gtype;
+}
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/1.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/1.html new file mode 100644 index 0000000..e57c5b3 --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/1.html @@ -0,0 +1,337 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
 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
/*
+ *  caja-python-object.h - Generation of wrapper objects for caja
+ *                           extension objects in python.
+ *
+ *  Copyright (C) 2003 Novell, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library 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
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Dave Camp <dave@ximian.com>
+ *
+ */
+
+#ifndef CAJA_PYTHON_OBJECT_H
+#define CAJA_PYTHON_OBJECT_H
+
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _CajaPythonObject       CajaPythonObject;
+typedef struct _CajaPythonObjectClass  CajaPythonObjectClass;
+
+struct _CajaPythonObject {
+  GObject parent_slot;
+  PyObject *instance;
+};
+
+struct _CajaPythonObjectClass {
+    GObjectClass parent_slot;
+    PyObject *type;
+};
+
+GType caja_python_object_get_type (GTypeModule *module, PyObject *type);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/2.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/2.html new file mode 100644 index 0000000..5041ecf --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/2.html @@ -0,0 +1,399 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
 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
/*
+ *  caja-python.c - Caja Python extension
+ *
+ *  Copyright (C) 2004 Johan Dahlin
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library 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
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef CAJA_PYTHON_H
+#define CAJA_PYTHON_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gprintf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if defined(NO_IMPORT)
+#define CAJA_PYTHON_VAR_DECL extern
+#else
+#define CAJA_PYTHON_VAR_DECL
+#endif
+
+typedef enum {
+    CAJA_PYTHON_DEBUG_MISC = 1 << 0,
+} CajaPythonDebug;
+
+extern CajaPythonDebug caja_python_debug;
+
+#define debug(x) { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                       g_printf( "caja-python:" x "\n"); }
+#define debug_enter()  { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                             g_printf("%s: entered\n", __FUNCTION__); }
+#define debug_enter_args(x, y) { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                                     g_printf("%s: entered " x "\n", __FUNCTION__, y); }
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyGtkWidget_Type;
+#define PyGtkWidget_Type (*_PyGtkWidget_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaColumn_Type;
+#define PyCajaColumn_Type (*_PyCajaColumn_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaColumnProvider_Type;
+#define PyCajaColumnProvider_Type (*_PyCajaColumnProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaInfoProvider_Type;
+#define PyCajaInfoProvider_Type (*_PyCajaInfoProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaLocationWidgetProvider_Type;
+#define PyCajaLocationWidgetProvider_Type (*_PyCajaLocationWidgetProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenu_Type;
+#define PyCajaMenu_Type (*_PyCajaMenu_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenuItem_Type;
+#define PyCajaMenuItem_Type (*_PyCajaMenuItem_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenuProvider_Type;
+#define PyCajaMenuProvider_Type (*_PyCajaMenuProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaPropertyPage_Type;
+#define PyCajaPropertyPage_Type (*_PyCajaPropertyPage_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaPropertyPageProvider_Type;
+#define PyCajaPropertyPageProvider_Type (*_PyCajaPropertyPageProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaOperationHandle_Type;
+#define PyCajaOperationHandle_Type (*_PyCajaOperationHandle_Type)
+
+#endif /* CAJA_PYTHON_H */
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/3.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/3.html new file mode 100644 index 0000000..2ff0401 --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/3.html @@ -0,0 +1,935 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
  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
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ *  Copyright (C) 2004,2005 Johan Dahlin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <structmember.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <pygobject.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gmodule.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-python.h"
+#include "caja-python-object.h"
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static const GDebugKey caja_python_debug_keys[] = {
+	{"misc", CAJA_PYTHON_DEBUG_MISC},
+};
+static const guint caja_python_ndebug_keys = sizeof (caja_python_debug_keys) / sizeof (GDebugKey);
+CajaPythonDebug caja_python_debug;
+
+static gboolean caja_python_init_python(void);
+
+static GArray *all_types = NULL;
+static GList *all_pyfiles = NULL;
+
+/* Caja.OperationHandle value access. */
+static PyObject *
+caja_operationhandle_get_handle(PyGBoxed *self, void *closure)
+{
+	return PyLong_FromSsize_t((Py_ssize_t) (size_t) self->boxed);
+}
+
+static int
+caja_operationhandle_set_handle(PyGBoxed *self, PyObject *value, void *closure)
+{
+	Py_ssize_t val = PyLong_AsSsize_t(value);
+
+	if (!PyErr_Occurred()) {
+		if (val) {
+			self->boxed = (void *) val;
+			return 0;
+		}
+		PyErr_SetString(PyExc_ValueError, "invalid operation handle value");
+	}
+	return -1;
+}
+
+static PyGetSetDef caja_operationhandle_handle = {
+	"handle",
+	(getter) caja_operationhandle_get_handle,
+	(setter) caja_operationhandle_set_handle,
+	"Operation handle value",
+	NULL
+};
+
+static inline gboolean
+np_init_pygobject(void)
+{
+    PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION);
+
+    if (gobject == NULL) {
+        PyErr_Print ();
+        return FALSE;
+    }
+
+	return TRUE;
+}
+
+static void
+caja_python_load_file(GTypeModule *type_module,
+						  const gchar *filename)
+{
+	PyObject *main_module, *main_locals, *locals, *key, *value;
+	PyObject *module;
+	GType gtype;
+	Py_ssize_t pos = 0;
+
+	debug_enter_args("filename=%s", filename);
+
+	main_module = PyImport_AddModule("__main__");
+	if (main_module == NULL)
+	{
+		g_warning("Could not get __main__.");
+		return;
+	}
+
+	main_locals = PyModule_GetDict(main_module);
+	module = PyImport_ImportModuleEx(filename, main_locals, main_locals, NULL);
+	if (!module)
+	{
+		PyErr_Print();
+		return;
+	}
+
+	locals = PyModule_GetDict(module);
+
+	while (PyDict_Next(locals, &pos, &key, &value))
+	{
+		if (!PyType_Check(value))
+			continue;
+
+		if (PyObject_IsSubclass(value, (PyObject*)&PyCajaColumnProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaInfoProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaLocationWidgetProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaMenuProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaPropertyPageProvider_Type))
+		{
+			gtype = caja_python_object_get_type(type_module, value);
+			g_array_append_val(all_types, gtype);
+
+			all_pyfiles = g_list_append(all_pyfiles, g_strdup(filename));
+		}
+	}
+
+	debug("Loaded python modules");
+}
+
+static void
+caja_python_load_dir (GTypeModule *module,
+						  const char  *dirname)
+{
+	GDir *dir;
+	const char *name;
+	gboolean initialized = FALSE;
+
+	debug_enter_args("dirname=%s", dirname);
+
+	dir = g_dir_open(dirname, 0, NULL);
+	if (!dir)
+		return;
+
+	while ((name = g_dir_read_name(dir)))
+	{
+		if (g_str_has_suffix(name, ".py"))
+		{
+			char *modulename;
+			size_t len;
+
+			len = strlen(name) - 3;
+			modulename = g_new0(char, len + 1 );
+			strncpy(modulename, name, len);
+
+			if (!initialized)
+			{
+				PyObject *sys_path, *py_path;
+
+				/* n-p python part is initialized on demand (or not
+				* at all if no extensions are found) */
+				if (!caja_python_init_python())
+				{
+					g_warning("caja_python_init_python failed");
+					g_dir_close(dir);
+					g_free(modulename);
+					break;
+				}
+
+				/* sys.path.insert(0, dirname) */
+				sys_path = PySys_GetObject("path");
+				py_path = PyUnicode_FromString(dirname);
+				PyList_Insert(sys_path, 0, py_path);
+				Py_DECREF(py_path);
+			}
+			caja_python_load_file(module, modulename);
+			g_free(modulename);
+		}
+	}
+}
+
+static gboolean
+caja_python_init_python (void)
+{
+	PyObject *gi, *require_version, *args, *caja, *descr;
+	GModule *libpython;
+
+	if (Py_IsInitialized())
+		return TRUE;
+
+  	debug("g_module_open " PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0");<--- There is an unknown macro here somewhere. Configuration is required. If PY_LIB_LOC is a macro then please configure it.
+	libpython = g_module_open(PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0", 0);
+	if (!libpython)
+		g_warning("g_module_open libpython failed: %s", g_module_error());
+
+	debug("Py_Initialize");
+	Py_Initialize();
+	if (PyErr_Occurred())
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	debug("Sanitize the python search path and set sys.argv");
+	PyRun_SimpleString("import sys; "
+			   "sys.path = list(filter(None, sys.path)); "
+			   "sys.argv = ['caja']");
+	if (PyErr_Occurred())
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	/* import gobject */
+  	debug("init_pygobject");
+	if (!np_init_pygobject())
+	{
+		g_warning("pygobject initialization failed");
+		return FALSE;
+	}
+
+	/* import caja */
+	g_setenv("INSIDE_CAJA_PYTHON", "", FALSE);
+	debug("import caja");
+	gi = PyImport_ImportModule ("gi");
+	if (!gi) {
+		PyErr_Print();
+		return FALSE;
+	}
+
+	require_version = PyObject_GetAttrString (gi, (char *) "require_version");
+	args = PyTuple_Pack (2, PyUnicode_FromString ("Caja"),
+	PyUnicode_FromString ("2.0"));
+	PyObject_CallObject (require_version, args);
+	Py_DECREF (require_version);
+	Py_DECREF (args);
+	Py_DECREF (gi);
+	caja = PyImport_ImportModule("gi.repository.Caja");
+	if (!caja)
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	_PyGtkWidget_Type = pygobject_lookup_class(GTK_TYPE_WIDGET);
+	g_assert(_PyGtkWidget_Type != NULL);
+
+#define IMPORT(x, y) \
+    _PyCaja##x##_Type = (PyTypeObject *)PyObject_GetAttrString(caja, y); \
+	if (_PyCaja##x##_Type == NULL) { \
+		PyErr_Print(); \
+		return FALSE; \
+	}
+
+	IMPORT(Column, "Column");
+	IMPORT(ColumnProvider, "ColumnProvider");
+	IMPORT(InfoProvider, "InfoProvider");
+	IMPORT(LocationWidgetProvider, "LocationWidgetProvider");
+	IMPORT(Menu, "Menu");
+	IMPORT(MenuItem, "MenuItem");
+	IMPORT(MenuProvider, "MenuProvider");
+	IMPORT(PropertyPage, "PropertyPage");
+	IMPORT(PropertyPageProvider, "PropertyPageProvider");
+	IMPORT(OperationHandle, "OperationHandle");
+
+#undef IMPORT
+
+	/* Add the "handle" member to the OperationHandle type. */
+	descr = PyDescr_NewGetSet(_PyCajaOperationHandle_Type,
+							  &caja_operationhandle_handle);
+    if (!descr) {
+		PyErr_Print();
+		return FALSE;
+	}
+	if (PyDict_SetItemString(_PyCajaOperationHandle_Type->tp_dict,
+						     caja_operationhandle_handle.name, descr)) {
+		Py_DECREF(descr);
+		PyErr_Print();
+		return FALSE;
+	}
+	Py_DECREF(descr);
+
+	return TRUE;
+}
+
+void
+caja_module_initialize(GTypeModule *module)
+{
+	gchar *user_extensions_dir;
+	const gchar *env_string;
+
+	env_string = g_getenv("CAJA_PYTHON_DEBUG");
+	if (env_string != NULL)
+	{
+		caja_python_debug = g_parse_debug_string(env_string,
+													 caja_python_debug_keys,
+													 caja_python_ndebug_keys);
+		env_string = NULL;
+    }
+
+	debug_enter();
+
+	all_types = g_array_new(FALSE, FALSE, sizeof(GType));
+
+	// Look in the new global path, $DATADIR/caja-python/extensions
+	caja_python_load_dir(module, DATADIR "/caja-python/extensions");
+
+	// Look in XDG_DATA_DIR, ~/.local/share/caja-python/extensions
+	user_extensions_dir = g_build_filename(g_get_user_data_dir(),
+		"caja-python", "extensions", NULL);
+	caja_python_load_dir(module, user_extensions_dir);
+}
+
+void
+caja_module_shutdown(void)
+{
+	debug_enter();
+
+	if (Py_IsInitialized())
+		Py_Finalize();
+
+	g_array_free(all_types, TRUE);
+	g_list_free_full(all_pyfiles, g_free);
+}
+
+void
+caja_module_list_types(const GType **types,
+                       int          *num_types)
+{
+	debug_enter();
+
+	*types = (GType*)all_types->data;
+	*num_types = (int) all_types->len;
+}
+
+void
+caja_module_list_pyfiles(GList **pyfiles)
+{
+	debug_enter();
+
+	*pyfiles = all_pyfiles;
+}
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/index.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/index.html new file mode 100644 index 0000000..45369c2 --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/index.html @@ -0,0 +1,227 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineIdCWESeverityMessage
checkersReportinformationActive checkers: There was critical errors (use --checkers-report=<filename> to see details)
src/caja-python-object.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <pygobject.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <libcaja-extension/caja-info-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <libcaja-extension/caja-column-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <libcaja-extension/caja-location-widget-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <libcaja-extension/caja-property-page-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/caja-python-object.h
28missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/caja-python.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <structmember.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <pygobject.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gmodule.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
198unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If PY_LIB_LOC is a macro then please configure it.
src/caja-python.h
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gprintf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/stats.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/stats.html new file mode 100644 index 0000000..29374af --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/stats.html @@ -0,0 +1,173 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+

Top 10 files for error severity, total findings: 1
+   1  src/caja-python.c
+

+

Top 10 files for information severity, total findings: 23
+   11  src/caja-python-object.c
+   7   src/caja-python.c
+   3   src/caja-python.h
+   2   src/caja-python-object.h
+

+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/style.css b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} -- cgit v1.2.1