struct trans {
long value; /* The numeric value */
- char *name; /* The equivalent symbolic value */
- char *desc; /* Short description of value */
+ const char *name; /* The equivalent symbolic value */
+ const char *desc; /* Short description of value */
};
static int procfs_trace = 0;
static FILE *procfs_file = NULL;
-static char *procfs_filename = "procfs_trace";
+static char *procfs_filename;
static void
prepare_to_trace (void)
{
if (procfs_trace) /* if procfs tracing turned on */
if (procfs_file == NULL) /* if output file not yet open */
- if (procfs_filename != NULL) /* if output filename known */
- procfs_file = fopen (procfs_filename, "a"); /* open output file */
+ procfs_file = fopen (procfs_filename, "a"); /* open output file */
}
static void
-set_procfs_trace_cmd (char *args, int from_tty, struct cmd_list_element *c)
+set_procfs_trace_cmd (const char *args,
+ int from_tty, struct cmd_list_element *c)
{
#if 0 /* not sure what I might actually need to do here, if anything */
if (procfs_file)
}
static void
-set_procfs_file_cmd (char *args, int from_tty, struct cmd_list_element *c)
+set_procfs_file_cmd (const char *args,
+ int from_tty, struct cmd_list_element *c)
{
/* Just changed the filename for procfs tracing.
If a file was already open, close it. */
}
void
-procfs_note (char *msg, char *file, int line)
+procfs_note (const char *msg, const char *file, int line)
{
prepare_to_trace ();
if (procfs_trace)
}
}
-
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern void _initialize_proc_api (void);
-
void
_initialize_proc_api (void)
{
NULL, /* FIXME: i18n: */
&setlist, &showlist);
+ procfs_filename = xstrdup ("procfs_trace");
add_setshow_filename_cmd ("procfs-file", no_class, &procfs_filename, _("\
Set filename for /proc tracefile."), _("\
Show filename for /proc tracefile."), NULL,