1 /* pinentry-emacs.c - A secure emacs dialog for PIN entry, library version 2 * Copyright (C) 2015 Daiki Ueno 3 * 4 * This file is part of PINENTRY. 5 * 6 * PINENTRY is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * PINENTRY is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, see <https://www.gnu.org/licenses/>. 18 * SPDX-License-Identifier: GPL-2.0+ 19 */ 20 21 #ifndef PINENTRY_EMACS_H 22 #define PINENTRY_EMACS_H 23 24 #include "pinentry.h" 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 /* Enable pinentry command handler which interacts with Emacs, if 31 INSIDE_EMACS envvar is set. This function shall be called upon 32 receiving an Assuan request "OPTION allow-emacs-prompt". */ 33 void pinentry_enable_emacs_cmd_handler (void); 34 35 /* Return info on whether emacs support is enabled. */ 36 int pinentry_emacs_status (void); 37 38 /* Initialize the Emacs interface, return true if success. */ 39 int pinentry_emacs_init (void); 40 41 int emacs_cmd_handler (pinentry_t pinentry); 42 43 #ifdef __cplusplus 44 } 45 #endif 46 47 #endif /* PINENTRY_EMACS_H */ 48