Branch: refs/heads/1.22_release Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 08 Jul 2012 10:38:51 Commit: a0c0b7186ee4704c83008b19a3d40ae69ca4b9ff https://github.com/geany/geany-plugins/commit/a0c0b7186ee4704c83008b19a3d40a...
Log Message: ----------- GeanyPG: Don't use C++ style comments
Modified Paths: -------------- geanypg/src/decrypt_cb.c geanypg/src/encrypt_cb.c geanypg/src/geanypg.c geanypg/src/geanypg.h geanypg/src/helper_functions.c geanypg/src/key_selection_dialog.c geanypg/src/pinentry.c geanypg/src/sign_cb.c geanypg/src/verify_aux.c geanypg/src/verify_cb.c
Modified: geanypg/src/decrypt_cb.c 43 files changed, 22 insertions(+), 21 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// decrypt_cb.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* decrypt_cb.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h" @@ -37,9 +38,9 @@ void geanypg_decrypt_verify(encrypt_data * ed) geanypg_load_buffer(&cipher);
err = gpgme_op_decrypt_verify(ed->ctx, cipher, plain); - if (gpgme_err_code(err) == GPG_ERR_NO_DATA) // no encription, but maybe signatures + if (gpgme_err_code(err) == GPG_ERR_NO_DATA) /* no encription, but maybe signatures */ { - // maybe reaload cipher + /* maybe reaload cipher */ gpgme_data_release(cipher); geanypg_load_buffer(&cipher); rewind(tempfile); @@ -55,7 +56,7 @@ void geanypg_decrypt_verify(encrypt_data * ed) }
fclose(tempfile); - // release buffers + /* release buffers */ gpgme_data_release(cipher); gpgme_data_release(plain); }
Modified: geanypg/src/encrypt_cb.c 43 files changed, 22 insertions(+), 21 deletions(-) =================================================================== @@ -1,27 +1,28 @@ -// encrypt_cb.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* encrypt_cb.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h"
void geanypg_encrypt(encrypt_data * ed, gpgme_key_t * recp, int sign, int flags) -{ // FACTORIZE +{ /* FACTORIZE */ gpgme_data_t plain, cipher; gpgme_error_t err; FILE * tempfile; @@ -36,7 +37,7 @@ void geanypg_encrypt(encrypt_data * ed, gpgme_key_t * recp, int sign, int flags)
geanypg_load_buffer(&plain);
- // do the actual encryption + /* do the actual encryption */ if (sign) err = gpgme_op_encrypt_sign(ed->ctx, recp, flags, plain, cipher); else @@ -50,7 +51,7 @@ void geanypg_encrypt(encrypt_data * ed, gpgme_key_t * recp, int sign, int flags) }
fclose(tempfile); - // release buffers + /* release buffers */ gpgme_data_release(plain); gpgme_data_release(cipher); }
Modified: geanypg/src/geanypg.c 49 files changed, 25 insertions(+), 24 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// geanypg.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* geanypg.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h"
@@ -41,12 +42,12 @@
static gpgme_error_t geanypg_init_gpgme(void) { - // Initialize the locale environment. + /* Initialize the locale environment. */ setlocale(LC_ALL, ""); fprintf(stderr, "GeanyPG: %s %s\n", _("Using libgpgme version:"), gpgme_check_version("1.1.0")); gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL)); -#ifdef LC_MESSAGES // only necessary for portability to W32 systems +#ifdef LC_MESSAGES /* only necessary for portability to W32 systems */ gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES, NULL)); #endif return gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP); @@ -69,7 +70,7 @@ void plugin_init(GeanyData *data) geanypg_show_err_msg(err); return; } - // Create a new menu item and show it + /* Create a new menu item and show it */ main_menu_item = gtk_menu_item_new_with_mnemonic("GeanyPG"); gtk_widget_show(main_menu_item);
@@ -92,12 +93,12 @@ void plugin_init(GeanyData *data)
gtk_menu_item_set_submenu(GTK_MENU_ITEM(main_menu_item), submenu);
- // Attach the new menu item to the Tools menu + /* Attach the new menu item to the Tools menu */ gtk_container_add(GTK_CONTAINER(geany->main_widgets->tools_menu), main_menu_item);
- // Connect the menu item with a callback function - // which is called when the item is clicked + /* Connect the menu item with a callback function + * which is called when the item is clicked */ g_signal_connect(encrypt, "activate", G_CALLBACK(geanypg_encrypt_cb), NULL); g_signal_connect(sign, "activate", G_CALLBACK(geanypg_sign_cb), NULL); g_signal_connect(decrypt, "activate", G_CALLBACK(geanypg_decrypt_cb), NULL);
Modified: geanypg/src/geanypg.h 47 files changed, 24 insertions(+), 23 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// geanypg.h -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* geanypg.h + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include <stdio.h> @@ -53,7 +54,7 @@ enum extern GeanyData *geany_data; extern GeanyFunctions *geany_functions;
-// auxiliary functions (helper_functions.c) +/* auxiliary functions (helper_functions.c) */ void geanypg_init_ed(encrypt_data * ed); int geanypg_get_keys(encrypt_data * ed); int geanypg_get_secret_keys(encrypt_data * ed); @@ -61,23 +62,23 @@ enum void geanypg_load_buffer(gpgme_data_t * buffer); void geanypg_write_file(FILE * file);
-// some more auxiliary functions (verify_aux.c) +/* some more auxiliary functions (verify_aux.c) */ void geanypg_handle_signatures(encrypt_data * ed, int need_error); void geanypg_check_sig(encrypt_data * ed, gpgme_signature_t sig); const char * geanypg_validity(gpgme_validity_t validity);
-// dialogs +/* dialogs */ int geanypg_encrypt_selection_dialog(encrypt_data * ed, gpgme_key_t ** selected, int * sign); int geanypg_sign_selection_dialog(encrypt_data * ed); gpgme_error_t geanypg_show_err_msg(gpgme_error_t err);
-// callback functions +/* callback functions */ void geanypg_encrypt_cb(GtkMenuItem * menuitem, gpointer user_data); void geanypg_sign_cb(GtkMenuItem * menuitem, gpointer user_data); void geanypg_decrypt_cb(GtkMenuItem * menuitem, gpointer user_data); void geanypg_verify_cb(GtkMenuItem * menuitem, gpointer user_data);
-// pinentry callback +/* pinentry callback */ gpgme_error_t geanypg_passphrase_cb(void *hook, const char *uid_hint, const char *passphrase_info,
Modified: geanypg/src/helper_functions.c 67 files changed, 34 insertions(+), 33 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// helper_functions.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* helper_functions.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h" @@ -32,9 +33,9 @@ int geanypg_get_keys(encrypt_data * ed) { gpgme_error_t err; unsigned long size = SIZE; - //initialize idx to 0 + /* initialize idx to 0 */ unsigned long idx = 0; - //allocate array of size 1N + /* allocate array of size 1N */ gpgme_key_t * key; ed->key_array = (gpgme_key_t*) malloc(SIZE * sizeof(gpgme_key_t)); err = gpgme_op_keylist_start(ed->ctx, NULL, 0); @@ -44,12 +45,12 @@ int geanypg_get_keys(encrypt_data * ed) err = gpgme_op_keylist_next(ed->ctx, key); if (err) break; - if ((*key)->revoked || // key cannot be used + if ((*key)->revoked || /* key cannot be used */ (*key)->expired || (*key)->disabled || (*key)->invalid) gpgme_key_unref(*key); - else // key is valid + else /* key is valid */ ++idx; if (idx >= size) { @@ -70,9 +71,9 @@ int geanypg_get_secret_keys(encrypt_data * ed) { gpgme_error_t err; unsigned long size = SIZE; - //initialize idx to 0 + /* initialize idx to 0 */ unsigned long idx = 0; - //allocate array of size 1N + /* allocate array of size 1N */ gpgme_key_t * key; ed->skey_array = (gpgme_key_t*) malloc(SIZE * sizeof(gpgme_key_t)); err = gpgme_op_keylist_start(ed->ctx, NULL, 1); @@ -82,12 +83,12 @@ int geanypg_get_secret_keys(encrypt_data * ed) err = gpgme_op_keylist_next(ed->ctx, key); if (err) break; - if ((*key)->revoked || // key cannot be used + if ((*key)->revoked || /* key cannot be used */ (*key)->expired || (*key)->disabled || (*key)->invalid) gpgme_key_unref(*key); - else // key is valid + else /* key is valid */ ++idx; if (idx >= size) { @@ -130,9 +131,9 @@ void geanypg_release_keys(encrypt_data * ed)
void geanypg_load_buffer(gpgme_data_t * buffer) { - //gpgme_data_new_from_mem(buffer, text, size, 0); + /* gpgme_data_new_from_mem(buffer, text, size, 0); */ GeanyDocument * doc = document_get_current(); - //SCI_GETSELECTIONSTART-SCI_GETSELECTIONEND + /* SCI_GETSELECTIONSTART-SCI_GETSELECTIONEND */ char * data = NULL; unsigned long sstart = scintilla_send_message(doc->editor->sci, SCI_GETSELECTIONSTART, 0, 0); unsigned long send = scintilla_send_message(doc->editor->sci, SCI_GETSELECTIONEND, 0, 0); @@ -151,7 +152,7 @@ void geanypg_load_buffer(gpgme_data_t * buffer) scintilla_send_message(doc->editor->sci, SCI_GETTEXT, (uptr_t)(size + 1), (sptr_t)data); gpgme_data_new_from_mem(buffer, data, size, 1); } - if (data) // if there is no text data may still be NULL + if (data) /* if there is no text data may still be NULL */ free(data); gpgme_data_set_encoding(*buffer, GPGME_DATA_ENCODING_BINARY); } @@ -163,15 +164,15 @@ void geanypg_write_file(FILE * file) char buffer[bufsize]; GeanyDocument * doc = document_get_current(); if (abs(sci_get_selection_start(doc->editor->sci) - sci_get_selection_end(doc->editor->sci))) - { // replace selected text - // clear selection, cursor should be at the end or beginneng of the selection + { /* replace selected text + * clear selection, cursor should be at the end or beginneng of the selection */ scintilla_send_message(doc->editor->sci, SCI_REPLACESEL, 0, (sptr_t)""); while ((size = fread(buffer, 1, bufsize, file))) - // add at the cursor + /* add at the cursor */ scintilla_send_message(doc->editor->sci, SCI_ADDTEXT, (uptr_t) size, (sptr_t) buffer); } else - { //replace complete document + { /* replace complete document */ scintilla_send_message(doc->editor->sci, SCI_CLEARALL, 0, 0); while ((size = fread(buffer, 1, bufsize, file))) scintilla_send_message(doc->editor->sci, SCI_APPENDTEXT, (uptr_t) size, (sptr_t) buffer);
Modified: geanypg/src/key_selection_dialog.c 65 files changed, 33 insertions(+), 32 deletions(-) =================================================================== @@ -1,23 +1,24 @@ -// key_selection_dialog.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. - -// something about premature optimization, it still needs to be done +/* key_selection_dialog.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* something about premature optimization, it still needs to be done */
#include "geanypg.h"
@@ -96,7 +97,7 @@ static GtkWidget * geanypg_listview(GtkListStore * list, listdata * data) GtkTreeViewColumn * column; GtkCellRenderer * togglerenderer, * textrenderer; GtkWidget * listview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list)); - // checkbox column + /* checkbox column */ togglerenderer = gtk_cell_renderer_toggle_new(); g_signal_connect(G_OBJECT(togglerenderer), "toggled", G_CALLBACK(geanypg_toggled_cb), NULL); column = gtk_tree_view_column_new_with_attributes("?", @@ -107,7 +108,7 @@ static GtkWidget * geanypg_listview(GtkListStore * list, listdata * data) data->store = list; data->column = TOGGLE_COLUMN; g_signal_connect(G_OBJECT(togglerenderer), "toggled", G_CALLBACK(geanypg_toggled_cb), (gpointer) data); - // recipient column + /* recipient column */ textrenderer = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes("recipient", textrenderer, @@ -115,7 +116,7 @@ static GtkWidget * geanypg_listview(GtkListStore * list, listdata * data) NULL); gtk_tree_view_column_set_resizable(column, TRUE); gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); - // keyid column + /* keyid column */ column = gtk_tree_view_column_new_with_attributes("keyid", textrenderer, "text", KEYID_COLUMN, @@ -153,13 +154,13 @@ int geanypg_encrypt_selection_dialog(encrypt_data * ed, gpgme_key_t ** selected, gtk_box_pack_start(GTK_BOX(contentarea), combobox, FALSE, FALSE, 0);
- // add ok and cancel buttons + /* add ok and cancel buttons */ gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_window_set_title(GTK_WINDOW(dialog), _("Select recipients")); gtk_widget_show_all(dialog); - // make sure dialog is destroyed when user responds + /* make sure dialog is destroyed when user responds */ response = gtk_dialog_run(GTK_DIALOG(dialog)); if (response == GTK_RESPONSE_CANCEL) { @@ -170,12 +171,12 @@ int geanypg_encrypt_selection_dialog(encrypt_data * ed, gpgme_key_t ** selected, if (idx && idx <= ed->nskeys) { *sign = 1; - gpgme_signers_add(ed->ctx, ed->skey_array[idx - 1]); // -1 because the first option is `None' + gpgme_signers_add(ed->ctx, ed->skey_array[idx - 1]); /* -1 because the first option is `None' */ } - // try to loop all the keys in the list - // if they are active (the user checked the checkbox in front of the key) - // add it to the selected array, finaly make sure that the array - // is NULL terminated + /* try to loop all the keys in the list + * if they are active (the user checked the checkbox in front of the key) + * add it to the selected array, finaly make sure that the array + * is NULL terminated */ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list), &iter)) { capacity = SIZE; @@ -222,13 +223,13 @@ int geanypg_sign_selection_dialog(encrypt_data * ed) gtk_box_pack_start(GTK_BOX(contentarea), gtk_label_new(_("Choose a key to sign with:")), FALSE, FALSE, 5); gtk_box_pack_start(GTK_BOX(contentarea), combobox, TRUE, TRUE, 0);
- // add ok and cancel buttons + /* add ok and cancel buttons */ gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_widget_show_all(dialog); gtk_window_set_title(GTK_WINDOW(dialog), _("Select signer")); - // make sure dialog is destroyed when user responds + /* make sure dialog is destroyed when user responds */ response = gtk_dialog_run(GTK_DIALOG(dialog)); if (response == GTK_RESPONSE_CANCEL) {
Modified: geanypg/src/pinentry.c 51 files changed, 26 insertions(+), 25 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// pinentry.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* pinentry.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h"
@@ -72,7 +73,7 @@ gpgme_error_t geanypg_passphrase_cb(void * hook, int inpipe[2]; int childpid; int status; - char readbuffer[2080]; // pinentry should at least support passphrases of up to 2048 characters + char readbuffer[2080]; /* pinentry should at least support passphrases of up to 2048 characters */ FILE * childin;
if (pipe(outpipe)) @@ -88,7 +89,7 @@ gpgme_error_t geanypg_passphrase_cb(void * hook,
childpid = fork(); if (!childpid) - { // pinentry + { /* pinentry */ char arg1[] = "pinentry"; char * argv[] = {arg1, NULL};
@@ -99,16 +100,16 @@ gpgme_error_t geanypg_passphrase_cb(void * hook, dup2(inpipe[READ], STDIN_FILENO);
execvp(*argv, argv); - // shouldn't get here + /* shouldn't get here */ fprintf(stderr, "GeanyPG: %s\n%s\n", _("Could not use pinentry."), strerror(errno)); - exit(1); // kill the child + exit(1); /* kill the child */ } - // GeanpyPG + /* GeanpyPG */ close(outpipe[WRITE]); close(inpipe[READ]); childin = fdopen(inpipe[WRITE], "w");
- // To understand what's happening here, read the pinentry documentation + /* To understand what's happening here, read the pinentry documentation */ geanypg_read(outpipe[READ], ' ', 2049, readbuffer); if (strncmp(readbuffer, "OK", 3)) { @@ -119,7 +120,7 @@ gpgme_error_t geanypg_passphrase_cb(void * hook, close(fd); return gpgme_err_make(GPG_ERR_SOURCE_PINENTRY, GPG_ERR_GENERAL); } - geanypg_read_till(outpipe[READ], '\n'); // read the rest of the first line after OK + geanypg_read_till(outpipe[READ], '\n'); /* read the rest of the first line after OK */ fprintf(childin, "SETTITLE GeanyPG %s\n", _("Passphrase entry")); fflush(childin); geanypg_read_till(outpipe[READ], '\n');
Modified: geanypg/src/sign_cb.c 41 files changed, 21 insertions(+), 20 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// sign_cb.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* sign_cb.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h" @@ -47,7 +48,7 @@ void geanypg_sign(encrypt_data * ed) }
fclose(tempfile); - // release buffers + /* release buffers */ gpgme_data_release(plain); gpgme_data_release(cipher); } @@ -61,7 +62,7 @@ void geanypg_sign_cb(GtkMenuItem * menuitem, gpointer user_data) return; ed.key_array = NULL; ed.nkeys = 0; - //gpgme_set_armor(ed.ctx, 1); + /*gpgme_set_armor(ed.ctx, 1);*/ gpgme_set_passphrase_cb(ed.ctx, geanypg_passphrase_cb, NULL); if (geanypg_get_secret_keys(&ed)) {
Modified: geanypg/src/verify_aux.c 41 files changed, 21 insertions(+), 20 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// verify_aux.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* verify_aux.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h" @@ -74,7 +75,7 @@ const char * geanypg_validity(gpgme_validity_t validity) }
static char * geanypg_summary(gpgme_sigsum_t summary, char * buffer) -{ // buffer should be more than 105 bytes long +{ /* buffer should be more than 105 bytes long */ if (summary & GPGME_SIGSUM_VALID) strcat(buffer, _(" valid")); if (summary & GPGME_SIGSUM_GREEN) strcat(buffer, _(" green")); if (summary & GPGME_SIGSUM_RED) strcat(buffer, _(" red")); @@ -136,7 +137,7 @@ static char * geanypg_result(gpgme_signature_t sig) strlen(sig->pka_trust == 0 ? _("n/a") : sig->pka_trust == 1 ? _("bad") : sig->pka_trust == 2 ? _("okay"): _("RFU")) + strlen(sig->wrong_key_usage ? _(" wrong-key-usage") : "") + strlen(sig->chain_model ? _(" chain-model") : "") + - strlen(sig->notations ? _("yes") : _("no")) + 1; // and a trailing \0 + strlen(sig->notations ? _("yes") : _("no")) + 1; /* and a trailing \0 */
buffer = (char *)calloc(buffer_size, 1); memset(summary, 0, 128);
Modified: geanypg/src/verify_cb.c 37 files changed, 19 insertions(+), 18 deletions(-) =================================================================== @@ -1,21 +1,22 @@ -// verify_cb.c -// -// Copyright 2011 Hans Alves alves.h88@gmail.com -// -// 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 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., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301, USA. +/* verify_cb.c + * + * Copyright 2011 Hans Alves alves.h88@gmail.com + * + * 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 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., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */
#include "geanypg.h"
@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).