2005-10-01 Marcus Brinkmann <marcus@g10code.de>

* engine.h (_gpgme_set_engine_info): Add prototype.
	* engine-backend.h (struct engine_ops): Change return type of
	get_file_name() to const char * to silence gcc warning.
	* engine.c (engine_get_file_name): Change return type to const
	char * to silence gcc warning.
	(gpgme_get_engine_info): Use transitional variable to go from
	const char * to char * to silence gcc warning.
	(_gpgme_set_engine_info): Likewise.
	* engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
	char * to silence gcc warning.
	(gpgsm_new): Make ARGV a pointer to const char.
	(status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
	to char * to silence gcc warning.
This commit is contained in:
Marcus Brinkmann 2005-10-01 20:42:34 +00:00
parent bda9541b51
commit 19043016ed
5 changed files with 38 additions and 17 deletions

View File

@ -1,5 +1,19 @@
2005-10-01 Marcus Brinkmann <marcus@g10code.de>
* engine.h (_gpgme_set_engine_info): Add prototype.
* engine-backend.h (struct engine_ops): Change return type of
get_file_name() to const char * to silence gcc warning.
* engine.c (engine_get_file_name): Change return type to const
char * to silence gcc warning.
(gpgme_get_engine_info): Use transitional variable to go from
const char * to char * to silence gcc warning.
(_gpgme_set_engine_info): Likewise.
* engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
char * to silence gcc warning.
(gpgsm_new): Make ARGV a pointer to const char.
(status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
to char * to silence gcc warning.
* gpgme.def: Add gpgme_data_set_file_name,
gpgme_data_get_file_name, gpgme_sig_notation_clear,
gpgme_sig_notation_add and gpgme_sig_notation_get.

View File

@ -33,7 +33,7 @@ struct engine_ops
/* Static functions. */
/* Return the default file name for the binary of this engine. */
char *(*get_file_name) (void);
const char *(*get_file_name) (void);
/* Returns a malloced string containing the version of the engine
with the given binary file name (or the default if FILE_NAME is

View File

@ -85,7 +85,7 @@ struct engine_gpgsm
void *fnc_value;
struct
{
unsigned char *line;
char *line;
int linesize;
int linelen;
} attic;
@ -320,7 +320,7 @@ gpgsm_new (void **engine, const char *file_name, const char *home_dir,
{
gpgme_error_t err = 0;
engine_gpgsm_t gpgsm;
char *argv[5];
const char *argv[5];
int argc;
int fds[2];
int child_fds[4];
@ -749,17 +749,16 @@ status_handler (void *opaque, int fd)
/* FIXME We can't use this for binary data because we
assume this is a string. For the current usage of colon
output it is correct. */
unsigned char *src = line + 2;
unsigned char *end = line + linelen;
unsigned char *dst;
unsigned char **aline = &gpgsm->colon.attic.line;
char *src = line + 2;
char *end = line + linelen;
char *dst;
char **aline = &gpgsm->colon.attic.line;
int *alinelen = &gpgsm->colon.attic.linelen;
if (gpgsm->colon.attic.linesize
< *alinelen + linelen + 1)
{
unsigned char *newline = realloc (*aline,
*alinelen + linelen + 1);
char *newline = realloc (*aline, *alinelen + linelen + 1);
if (!newline)
err = gpg_error_from_errno (errno);
else
@ -778,7 +777,7 @@ status_handler (void *opaque, int fd)
{
/* Handle escaped characters. */
++src;
*dst = (unsigned char) _gpgme_hextobyte (src);
*dst = _gpgme_hextobyte (src);
(*alinelen)++;
src += 2;
}

View File

@ -60,7 +60,7 @@ DEFINE_STATIC_LOCK (engine_info_lock);
/* Get the file name of the engine for PROTOCOL. */
static char *
static const char *
engine_get_file_name (gpgme_protocol_t proto)
{
if (proto > DIM (engine_ops))
@ -155,12 +155,13 @@ gpgme_get_engine_info (gpgme_engine_info_t *info)
for (proto = 0; proto < DIM (proto_list); proto++)
{
char *file_name = engine_get_file_name (proto_list[proto]);
const char *ofile_name = engine_get_file_name (proto_list[proto]);
char *file_name;
if (!file_name)
if (!ofile_name)
continue;
file_name = strdup (file_name);
file_name = strdup (ofile_name);
*lastp = malloc (sizeof (*engine_info));
if (!*lastp || !file_name)
@ -304,9 +305,9 @@ _gpgme_set_engine_info (gpgme_engine_info_t info, gpgme_protocol_t proto,
new_file_name = strdup (file_name);
else
{
new_file_name = engine_get_file_name (proto);
assert (new_file_name);
new_file_name = strdup (new_file_name);
const char *ofile_name = engine_get_file_name (proto);
assert (ofile_name);
new_file_name = strdup (ofile_name);
}
if (!new_file_name)
return gpg_error_from_errno (errno);

View File

@ -42,6 +42,13 @@ gpgme_error_t _gpgme_engine_info_copy (gpgme_engine_info_t *r_info);
/* Release the engine info INFO. */
void _gpgme_engine_info_release (gpgme_engine_info_t info);
/* Set the engine info for the info list INFO, protocol PROTO, to the
file name FILE_NAME and the home directory HOME_DIR. */
gpgme_error_t _gpgme_set_engine_info (gpgme_engine_info_t info,
gpgme_protocol_t praoto,
const char *file_name,
const char *home_dir);
gpgme_error_t _gpgme_engine_new (gpgme_engine_info_t info,
engine_t *r_engine,