From ae5ea8e4950bdd98b5ccce19c3855a2bfae5789d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 20 Dec 2023 09:44:29 -0500 Subject: [PATCH] printing: Convert headers to #pragma once That is our current coding style. --- modules/printbackends/gtkcupssecretsutils.h | 6 +- modules/printbackends/gtkcupsutils.h | 69 ++++++++++---------- modules/printbackends/gtkprintbackendcpdb.h | 7 +- modules/printbackends/gtkprintbackendcups.h | 7 +- modules/printbackends/gtkprintbackendfile.h | 7 +- modules/printbackends/gtkprintbackendutils.h | 5 +- modules/printbackends/gtkprintercpdb.h | 6 +- modules/printbackends/gtkprintercups.h | 13 ++-- 8 files changed, 47 insertions(+), 73 deletions(-) diff --git a/modules/printbackends/gtkcupssecretsutils.h b/modules/printbackends/gtkcupssecretsutils.h index e8fb07b143..aeddfd76d7 100644 --- a/modules/printbackends/gtkcupssecretsutils.h +++ b/modules/printbackends/gtkcupssecretsutils.h @@ -14,8 +14,8 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __GTK_SECRETS_UTILS_H__ -#define __GTK_SECRETS_UTILS_H__ + +#pragma once #include @@ -37,5 +37,3 @@ void gtk_cups_secrets_service_store (char **auth_info, const char *printer_uri); G_END_DECLS - -#endif /* __GTK_SECRETS_UTILS_H__ */ diff --git a/modules/printbackends/gtkcupsutils.h b/modules/printbackends/gtkcupsutils.h index 7859427ea0..33ea58b3f9 100644 --- a/modules/printbackends/gtkcupsutils.h +++ b/modules/printbackends/gtkcupsutils.h @@ -1,4 +1,4 @@ -/* gtkcupsutils.h +/* gtkcupsutils.h * Copyright (C) 2006 John (J5) Palmieri * * This library is free software; you can redistribute it and/or @@ -8,15 +8,14 @@ * * 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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ - -#ifndef __GTK_CUPS_UTILS_H__ -#define __GTK_CUPS_UTILS_H__ + +#pragma once #include #include @@ -46,7 +45,7 @@ typedef enum } GtkCupsRequestType; -/** +/* * Direction we should be polling the http socket on. * We are either reading or writing at each state. * This makes it easy for mainloops to connect to poll. @@ -141,34 +140,34 @@ enum }; GtkCupsRequest * gtk_cups_request_new_with_username (http_t *connection, - GtkCupsRequestType req_type, - int operation_id, - GIOChannel *data_io, - const char *server, - const char *resource, - const char *username); + GtkCupsRequestType req_type, + int operation_id, + GIOChannel *data_io, + const char *server, + const char *resource, + const char *username); GtkCupsRequest * gtk_cups_request_new (http_t *connection, - GtkCupsRequestType req_type, - int operation_id, - GIOChannel *data_io, - const char *server, - const char *resource); + GtkCupsRequestType req_type, + int operation_id, + GIOChannel *data_io, + const char *server, + const char *resource); void gtk_cups_request_ipp_add_string (GtkCupsRequest *request, - ipp_tag_t group, - ipp_tag_t tag, - const char *name, - const char *charset, - const char *value); + ipp_tag_t group, + ipp_tag_t tag, + const char *name, + const char *charset, + const char *value); void gtk_cups_request_ipp_add_strings (GtkCupsRequest *request, - ipp_tag_t group, - ipp_tag_t tag, - const char *name, - int num_values, - const char *charset, - const char * const *values); + ipp_tag_t group, + ipp_tag_t tag, + const char *name, + int num_values, + const char *charset, + const char * const *values); const char * gtk_cups_request_ipp_get_string (GtkCupsRequest *request, - ipp_tag_t tag, - const char *name); + ipp_tag_t tag, + const char *name); gboolean gtk_cups_request_read_write (GtkCupsRequest *request, gboolean connect_only); GtkCupsPollState gtk_cups_request_get_poll_state (GtkCupsRequest *request); @@ -176,11 +175,11 @@ void gtk_cups_request_free (GtkCupsRequest * GtkCupsResult * gtk_cups_request_get_result (GtkCupsRequest *request); gboolean gtk_cups_request_is_done (GtkCupsRequest *request); void gtk_cups_request_encode_option (GtkCupsRequest *request, - const char *option, - const char *value); + const char *option, + const char *value); void gtk_cups_request_set_ipp_version (GtkCupsRequest *request, - int major, - int minor); + int major, + int minor); gboolean gtk_cups_result_is_error (GtkCupsResult *result); ipp_t * gtk_cups_result_get_response (GtkCupsResult *result); GtkCupsErrorType gtk_cups_result_get_error_type (GtkCupsResult *result); @@ -193,4 +192,4 @@ GtkCupsConnectionState gtk_cups_connection_test_get_state (GtkCupsConnectionTes void gtk_cups_connection_test_free (GtkCupsConnectionTest *test); G_END_DECLS -#endif + diff --git a/modules/printbackends/gtkprintbackendcpdb.h b/modules/printbackends/gtkprintbackendcpdb.h index f7e87efa5f..9b4e28f84e 100644 --- a/modules/printbackends/gtkprintbackendcpdb.h +++ b/modules/printbackends/gtkprintbackendcpdb.h @@ -17,9 +17,7 @@ * License along with this library. If not, see . */ - -#ifndef __GTK_PRINT_BACKEND_CPDB_H__ -#define __GTK_PRINT_BACKEND_CPDB_H__ +#pragma once #include #include @@ -38,6 +36,3 @@ GtkPrintBackend *gtk_print_backend_cpdb_new (void); GType gtk_print_backend_cpdb_get_type (void) G_GNUC_CONST; G_END_DECLS - -#endif /* __GTK_PRINT_BACKEND_CPDB_H__ */ - diff --git a/modules/printbackends/gtkprintbackendcups.h b/modules/printbackends/gtkprintbackendcups.h index b5ac6d3980..528ff3d83f 100644 --- a/modules/printbackends/gtkprintbackendcups.h +++ b/modules/printbackends/gtkprintbackendcups.h @@ -16,8 +16,7 @@ * License along with this library. If not, see . */ -#ifndef __GTK_PRINT_BACKEND_CUPS_H__ -#define __GTK_PRINT_BACKEND_CUPS_H__ +#pragma once #include #include "gtk/print/gtkprintbackendprivate.h" @@ -34,7 +33,3 @@ GtkPrintBackend *gtk_print_backend_cups_new (void); GType gtk_print_backend_cups_get_type (void) G_GNUC_CONST; G_END_DECLS - -#endif /* __GTK_PRINT_BACKEND_CUPS_H__ */ - - diff --git a/modules/printbackends/gtkprintbackendfile.h b/modules/printbackends/gtkprintbackendfile.h index 280b901d00..4e77ce4e43 100644 --- a/modules/printbackends/gtkprintbackendfile.h +++ b/modules/printbackends/gtkprintbackendfile.h @@ -1,5 +1,5 @@ /* GTK - The GIMP Toolkit - * gtkprintbackendpdf.h: Default implementation of GtkPrintBackend + * gtkprintbackendpdf.h: Default implementation of GtkPrintBackend * for printing to a file * Copyright (C) 2003, Red Hat, Inc. * @@ -17,8 +17,7 @@ * License along with this library. If not, see . */ -#ifndef __GTK_PRINT_BACKEND_FILE_H__ -#define __GTK_PRINT_BACKEND_FILE_H__ +#pragma once #include #include "gtk/print/gtkprintbackendprivate.h" @@ -35,5 +34,3 @@ GtkPrintBackend *gtk_print_backend_file_new (void); GType gtk_print_backend_file_get_type (void) G_GNUC_CONST; G_END_DECLS - -#endif /* __GTK_PRINT_BACKEND_FILE_H__ */ diff --git a/modules/printbackends/gtkprintbackendutils.h b/modules/printbackends/gtkprintbackendutils.h index 8c8a4f8415..dfbdd5910d 100644 --- a/modules/printbackends/gtkprintbackendutils.h +++ b/modules/printbackends/gtkprintbackendutils.h @@ -17,11 +17,8 @@ * License along with this library. If not, see . */ -#ifndef __GTK_PRINT_BACKEND_UTILS_H__ -#define __GTK_PRINT_BACKEND_UTILS_H__ +#pragma once char *random_string (int size); char *localtime_to_utctime (const char *local_time); gboolean supports_am_pm (void); - -#endif /* __GTK_PRINT_BACKEND_UTILS_H__ */ \ No newline at end of file diff --git a/modules/printbackends/gtkprintercpdb.h b/modules/printbackends/gtkprintercpdb.h index 7c4d6bbb64..5a5dac233d 100644 --- a/modules/printbackends/gtkprintercpdb.h +++ b/modules/printbackends/gtkprintercpdb.h @@ -15,9 +15,7 @@ * License along with this library. If not, see . */ - -#ifndef __GTK_PRINTER_CPDB_H__ -#define __GTK_PRINTER_CPDB_H__ +#pragma once #include #include @@ -42,5 +40,3 @@ void gtk_printer_cpdb_set_printer_obj (GtkPrinterCpdb cpdb_printer_obj_t *printer_obj); G_END_DECLS - -#endif /* __GTK_PRINTER_CPDB_H__ */ diff --git a/modules/printbackends/gtkprintercups.h b/modules/printbackends/gtkprintercups.h index 30edcece27..7e75f84caa 100644 --- a/modules/printbackends/gtkprintercups.h +++ b/modules/printbackends/gtkprintercups.h @@ -8,15 +8,14 @@ * * 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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __GTK_PRINTER_CUPS_H__ -#define __GTK_PRINTER_CUPS_H__ +#pragma once #include #include @@ -39,7 +38,7 @@ G_BEGIN_DECLS #define GTK_IS_PRINTER_CUPS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINTER_CUPS)) #define GTK_PRINTER_CUPS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINTER_CUPS, GtkPrinterCupsClass)) -typedef struct _GtkPrinterCups GtkPrinterCups; +typedef struct _GtkPrinterCups GtkPrinterCups; typedef struct _GtkPrinterCupsClass GtkPrinterCupsClass; typedef struct _GtkPrinterCupsPrivate GtkPrinterCupsPrivate; @@ -123,8 +122,8 @@ void gtk_printer_cups_register_type (GTypeModule *module GtkPrinterCups *gtk_printer_cups_new (const char *name, GtkPrintBackend *backend, gpointer colord_client); -ppd_file_t *gtk_printer_cups_get_ppd (GtkPrinterCups *printer); -const char *gtk_printer_cups_get_ppd_name (GtkPrinterCups *printer); +ppd_file_t *gtk_printer_cups_get_ppd (GtkPrinterCups *printer); +const char *gtk_printer_cups_get_ppd_name (GtkPrinterCups *printer); #ifdef HAVE_COLORD void gtk_printer_cups_update_settings (GtkPrinterCups *printer, @@ -133,5 +132,3 @@ void gtk_printer_cups_update_settings (GtkPrinterCups *print #endif G_END_DECLS - -#endif /* __GTK_PRINTER_CUPS_H__ */