mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 17:34:56 +00:00
Parser does not need to know all programmer types now, new programmers
will update only the table in pgm_type.c.
* config_gram.y, lexer.l: removed programmer type keywords,
use now locate_programmer_type() function
* pgm_type.[ch]: added new files for table of programmer types
* main.c: allow list of programmer types by -c ?type
* avrdude.conf.in: changed all type keywords to quoted strings
* doc/avrdude.texi: changed description of type definition, list
of valid types is now included from generated file
* doc/Makefile.am: generate list of programmer types for doc
* all programmers [hc]: add xxx_desc string for description of programmer
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@1051 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
#include "term.h"
|
||||
#include "safemode.h"
|
||||
#include "update.h"
|
||||
#include "pgm_type.h"
|
||||
|
||||
|
||||
/* Get VERSION from ac_cfg.h */
|
||||
@@ -221,6 +222,24 @@ static void list_programmers(FILE * f, const char *prefix, LISTID programmers)
|
||||
walk_programmers(programmers, list_programmers_callback, &c);
|
||||
}
|
||||
|
||||
static void list_programmer_types_callback(const char *name, const char *desc,
|
||||
void *cookie)
|
||||
{
|
||||
struct list_walk_cookie *c = (struct list_walk_cookie *)cookie;
|
||||
fprintf(c->f, "%s%-16s = %-s\n",
|
||||
c->prefix, name, desc);
|
||||
}
|
||||
|
||||
static void list_programmer_types(FILE * f, const char *prefix)
|
||||
{
|
||||
struct list_walk_cookie c;
|
||||
|
||||
c.f = f;
|
||||
c.prefix = prefix;
|
||||
|
||||
walk_programmer_types(list_programmer_types_callback, &c);
|
||||
}
|
||||
|
||||
static void list_avrparts_callback(const char *name, const char *desc,
|
||||
const char *cfgname, int cfglineno,
|
||||
void *cookie)
|
||||
@@ -261,7 +280,7 @@ static void exithook(void)
|
||||
static void cleanup_main(void)
|
||||
{
|
||||
if (updates) {
|
||||
ldestroy_cb(updates,free_update);
|
||||
ldestroy_cb(updates, (void(*)(void*))free_update);
|
||||
updates = NULL;
|
||||
}
|
||||
if (extended_params) {
|
||||
@@ -705,6 +724,13 @@ int main(int argc, char * argv [])
|
||||
fprintf(stderr,"\n");
|
||||
exit(1);
|
||||
}
|
||||
if (strcmp(programmer, "?type") == 0) {
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr,"Valid programmer types are:\n");
|
||||
list_programmer_types(stderr, " ");
|
||||
fprintf(stderr,"\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user