diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index c8523ebd..50a17cb8 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,12 @@ +2009-06-13 Rutger Hofman + + * include/urjtag/*.h: change all struct/enum definitions from + typedef struct urj_bla urj_bla_t into typedef struct URJ_BLA urj_bla_t + because swig otherwise generates name collisions + * Makefile.am, urjtag.i: add the dumbest possible swig target that generates + swig for everything referenced include/urjtag/urjtag.h. This might even + turn out to be useful once the API has been cleaned up. + 2009-06-11 Arnim Laeuger * src/bus/bf533_stamp.c: [ 2804509 ] bf533_stamp bus driver enchancement diff --git a/urjtag/Makefile.am b/urjtag/Makefile.am index 79633116..29a459f5 100644 --- a/urjtag/Makefile.am +++ b/urjtag/Makefile.am @@ -45,3 +45,10 @@ EXTRA_DIST = \ tools/config.rpath ACLOCAL_AMFLAGS = -I m4 + +swig: + swig \ + -python \ + -includeall -ignoremissing -Iinclude/urjtag \ + -module urjtag \ + urjtag.i diff --git a/urjtag/include/urjtag/bsbit.h b/urjtag/include/urjtag/bsbit.h index 37cee116..b3d82a66 100644 --- a/urjtag/include/urjtag/bsbit.h +++ b/urjtag/include/urjtag/bsbit.h @@ -37,7 +37,7 @@ #define URJ_BSBIT_DONTCARE '?' -struct urj_bsbit +struct URJ_BSBIT { int bit; char *name; diff --git a/urjtag/include/urjtag/bssignal.h b/urjtag/include/urjtag/bssignal.h index 2cbfb77d..8d25b8d1 100644 --- a/urjtag/include/urjtag/bssignal.h +++ b/urjtag/include/urjtag/bssignal.h @@ -28,7 +28,7 @@ #include "types.h" -struct urj_part_signal +struct URJ_PART_SIGNAL { char *name; char *pin; /* djf hack pin number from bsdl */ @@ -37,7 +37,7 @@ struct urj_part_signal urj_bsbit_t *output; }; -struct urj_part_salias +struct URJ_PART_SALIAS { char *name; urj_part_salias_t *next; diff --git a/urjtag/include/urjtag/bus_driver.h b/urjtag/include/urjtag/bus_driver.h index b71942a0..f0cb6f95 100644 --- a/urjtag/include/urjtag/bus_driver.h +++ b/urjtag/include/urjtag/bus_driver.h @@ -83,7 +83,7 @@ typedef enum URJ_BUS_PARAM_KEY } urj_bus_param_key_t; -struct urj_bus_driver +struct URJ_BUS_DRIVER { const char *name; const char *description; @@ -108,7 +108,7 @@ struct urj_bus_driver int (*init) (urj_bus_t *bus); }; -struct urj_bus +struct URJ_BUS { urj_chain_t *chain; urj_part_t *part; diff --git a/urjtag/include/urjtag/cable.h b/urjtag/include/urjtag/cable.h index bf03f251..bd11fcc5 100644 --- a/urjtag/include/urjtag/cable.h +++ b/urjtag/include/urjtag/cable.h @@ -34,9 +34,9 @@ #include "parport.h" #include "pod.h" -typedef struct urj_cable_driver urj_cable_driver_t; +typedef struct URJ_CABLE_DRIVER urj_cable_driver_t; -typedef enum urj_cable_flush_amount +typedef enum URJ_CABLE_FLUSH_AMOUNT { URJ_TAP_CABLE_OPTIONALLY, URJ_TAP_CABLE_TO_OUTPUT, @@ -62,7 +62,7 @@ typedef enum URJ_CABLE_PARAM_KEY } urj_cable_param_key_t; -struct urj_cable_driver +struct URJ_CABLE_DRIVER { const char *name; const char *description; @@ -95,9 +95,9 @@ struct urj_cable_driver void (*help) (urj_log_level_t ll, const char *); }; -typedef struct urj_cable_queue urj_cable_queue_t; +typedef struct URJ_CABLE_QUEUE urj_cable_queue_t; -struct urj_cable_queue +struct URJ_CABLE_QUEUE { enum { @@ -136,9 +136,9 @@ struct urj_cable_queue } arg; }; -typedef struct urj_cable_queue_info urj_cable_queue_info_t; +typedef struct URJ_CABLE_QUEUE_INFO urj_cable_queue_info_t; -struct urj_cable_queue_info +struct URJ_CABLE_QUEUE_INFO { urj_cable_queue_t *data; int max_items; @@ -147,7 +147,7 @@ struct urj_cable_queue_info int next_free; }; -struct urj_cable +struct URJ_CABLE { urj_cable_driver_t *driver; union diff --git a/urjtag/include/urjtag/chain.h b/urjtag/include/urjtag/chain.h index 71a53dc0..8f91d4a7 100644 --- a/urjtag/include/urjtag/chain.h +++ b/urjtag/include/urjtag/chain.h @@ -36,7 +36,7 @@ #define URJ_CHAIN_EXITMODE_EXIT1 2 #define URJ_CHAIN_EXITMODE_UPDATE 3 -struct urj_chain +struct URJ_CHAIN { int state; urj_parts_t *parts; diff --git a/urjtag/include/urjtag/data_register.h b/urjtag/include/urjtag/data_register.h index a148439d..e9323a4b 100644 --- a/urjtag/include/urjtag/data_register.h +++ b/urjtag/include/urjtag/data_register.h @@ -29,7 +29,7 @@ #define URJ_DATA_REGISTER_MAXLEN 32 -struct urj_data_register +struct URJ_DATA_REGISTER { char name[URJ_DATA_REGISTER_MAXLEN + 1]; /* (public) register name */ urj_tap_register_t *in; /* (public) register value clocked in */ diff --git a/urjtag/include/urjtag/error.h b/urjtag/include/urjtag/error.h index c8c5bcfb..843a964a 100644 --- a/urjtag/include/urjtag/error.h +++ b/urjtag/include/urjtag/error.h @@ -31,7 +31,7 @@ /** * Error types */ -typedef enum urj_error +typedef enum URJ_ERROR { URJ_ERROR_OK = 0, URJ_ERROR_ALREADY, @@ -78,7 +78,7 @@ urj_error_t; /** * Error state. */ -typedef struct urj_error_state +typedef struct URJ_ERROR_STATE { urj_error_t errnum; /**< error number */ int sys_errno; /**< errno if URJ_ERROR_IO */ diff --git a/urjtag/include/urjtag/flash.h b/urjtag/include/urjtag/flash.h index fcb22e1a..0a7ea551 100644 --- a/urjtag/include/urjtag/flash.h +++ b/urjtag/include/urjtag/flash.h @@ -39,7 +39,7 @@ #include "types.h" -typedef struct urj_flash_cfi_array urj_flash_cfi_array_t; +typedef struct URJ_FLASH_CFI_ARRAY urj_flash_cfi_array_t; typedef struct { diff --git a/urjtag/include/urjtag/jim.h b/urjtag/include/urjtag/jim.h index 90c4e066..3a5ce2fe 100644 --- a/urjtag/include/urjtag/jim.h +++ b/urjtag/include/urjtag/jim.h @@ -65,9 +65,9 @@ typedef struct } urj_jim_shift_reg_t; -typedef struct urj_jim_device urj_jim_device_t; +typedef struct URJ_JIM_DEVICE urj_jim_device_t; -struct urj_jim_device +struct URJ_JIM_DEVICE { urj_jim_device_t *prev; @@ -85,7 +85,7 @@ struct urj_jim_device int tdo_buffer; }; -typedef struct urj_jim_state +typedef struct URJ_JIM_STATE { int trst; uint8_t *shmem; @@ -94,9 +94,9 @@ typedef struct urj_jim_state } urj_jim_state_t; -typedef struct urj_jim_bus_device urj_jim_bus_device_t; +typedef struct URJ_JIM_BUS_DEVICE urj_jim_bus_device_t; -struct urj_jim_bus_device +struct URJ_JIM_BUS_DEVICE { int width; /* bytes */ int size; /* words (each bytes) */ diff --git a/urjtag/include/urjtag/log.h b/urjtag/include/urjtag/log.h index 8aaf4185..69a91a61 100644 --- a/urjtag/include/urjtag/log.h +++ b/urjtag/include/urjtag/log.h @@ -30,7 +30,7 @@ /** * Log state. */ -typedef struct urj_log_state +typedef struct URJ_LOG_STATE { urj_log_level_t level; /**< logging level */ int (*out_vprintf) (const char *fmt, va_list ap); diff --git a/urjtag/include/urjtag/parport.h b/urjtag/include/urjtag/parport.h index eb9c29ce..75edc572 100644 --- a/urjtag/include/urjtag/parport.h +++ b/urjtag/include/urjtag/parport.h @@ -60,7 +60,7 @@ typedef struct } urj_parport_driver_t; -struct urj_parport +struct URJ_PARPORT { urj_parport_driver_t *driver; void *params; diff --git a/urjtag/include/urjtag/part.h b/urjtag/include/urjtag/part.h index bb4aa328..7d2709f1 100644 --- a/urjtag/include/urjtag/part.h +++ b/urjtag/include/urjtag/part.h @@ -31,7 +31,7 @@ #define URJ_PART_PART_MAXLEN 20 #define URJ_PART_STEPPING_MAXLEN 8 -struct urj_part +struct URJ_PART { urj_tap_register_t *id; char *alias; /* djf refdes */ @@ -91,7 +91,7 @@ urj_part_instruction_t *urj_part_instruction_define (urj_part_t *part, * parts */ -struct urj_parts +struct URJ_PARTS { int len; urj_part_t **parts; diff --git a/urjtag/include/urjtag/part_instruction.h b/urjtag/include/urjtag/part_instruction.h index b99743ec..addb95eb 100644 --- a/urjtag/include/urjtag/part_instruction.h +++ b/urjtag/include/urjtag/part_instruction.h @@ -29,7 +29,7 @@ #define URJ_INSTRUCTION_MAXLEN_INSTRUCTION 20 -struct urj_part_instruction +struct URJ_PART_INSTRUCTION { char name[URJ_INSTRUCTION_MAXLEN_INSTRUCTION + 1]; urj_tap_register_t *value; diff --git a/urjtag/include/urjtag/pod.h b/urjtag/include/urjtag/pod.h index eda3f73d..70d9d052 100644 --- a/urjtag/include/urjtag/pod.h +++ b/urjtag/include/urjtag/pod.h @@ -24,7 +24,7 @@ #ifndef URJ_POD_H #define URJ_POD_H -typedef enum urj_pod_sigsel +typedef enum URJ_POD_SIGSEL { URJ_POD_CS_NONE = 0, /* no/invalid signal */ URJ_POD_CS_TDI = (1 << 0), /* out: JTAG/SPI data in */ diff --git a/urjtag/include/urjtag/tap_register.h b/urjtag/include/urjtag/tap_register.h index aa0bb0af..610cb5e3 100644 --- a/urjtag/include/urjtag/tap_register.h +++ b/urjtag/include/urjtag/tap_register.h @@ -28,7 +28,7 @@ #include "types.h" #include -struct urj_tap_register +struct URJ_TAP_REGISTER { char *data; /* (public, r/w) register data */ int len; /* (public, r/o) register length */ diff --git a/urjtag/include/urjtag/types.h b/urjtag/include/urjtag/types.h index 5d609586..c0c385ac 100644 --- a/urjtag/include/urjtag/types.h +++ b/urjtag/include/urjtag/types.h @@ -26,25 +26,25 @@ #ifndef URJ_URJ_TYPES_H #define URJ_URJ_TYPES_H -typedef struct urj_bus urj_bus_t; -typedef struct urj_bus_driver urj_bus_driver_t; -typedef struct urj_chain urj_chain_t; -typedef struct urj_cable urj_cable_t; -typedef struct urj_usbconn urj_usbconn_t; -typedef struct urj_parport urj_parport_t; -typedef struct urj_part urj_part_t; -typedef struct urj_parts urj_parts_t; -typedef struct urj_part_signal urj_part_signal_t; -typedef struct urj_part_salias urj_part_salias_t; -typedef struct urj_part_instruction urj_part_instruction_t; -typedef struct urj_data_register urj_data_register_t; -typedef struct urj_bsbit urj_bsbit_t; -typedef struct urj_tap_register urj_tap_register_t; +typedef struct URJ_BUS urj_bus_t; +typedef struct URJ_BUS_DRIVER urj_bus_driver_t; +typedef struct URJ_CHAIN urj_chain_t; +typedef struct URJ_CABLE urj_cable_t; +typedef struct URJ_USBCONN urj_usbconn_t; +typedef struct URJ_PARPORT urj_parport_t; +typedef struct URJ_PART urj_part_t; +typedef struct URJ_PARTS urj_parts_t; +typedef struct URJ_PART_SIGNAL urj_part_signal_t; +typedef struct URJ_PART_SALIAS urj_part_salias_t; +typedef struct URJ_PART_INSTRUCTION urj_part_instruction_t; +typedef struct URJ_DATA_REGISTER urj_data_register_t; +typedef struct URJ_BSBIT urj_bsbit_t; +typedef struct URJ_TAP_REGISTER urj_tap_register_t; /** * Log levels */ -typedef enum urj_log_level +typedef enum URJ_LOG_LEVEL { URJ_LOG_LEVEL_ALL, /**< every single bit as it is transmitted */ URJ_LOG_LEVEL_COMM, /**< low level communication details */ diff --git a/urjtag/include/urjtag/usbconn.h b/urjtag/include/urjtag/usbconn.h index b6dfc2fb..9292f3f8 100644 --- a/urjtag/include/urjtag/usbconn.h +++ b/urjtag/include/urjtag/usbconn.h @@ -58,7 +58,7 @@ typedef struct } urj_usbconn_driver_t; -struct urj_usbconn +struct URJ_USBCONN { urj_usbconn_driver_t *driver; void *params; diff --git a/urjtag/src/flash/cfi.h b/urjtag/src/flash/cfi.h index 7ef26ce0..b4a80719 100644 --- a/urjtag/src/flash/cfi.h +++ b/urjtag/src/flash/cfi.h @@ -166,7 +166,7 @@ typedef struct cfi_query_structure urj_flash_cfi_device_geometry_t device_geometry; } urj_flash_cfi_query_structure_t; -struct urj_flash_cfi_chip +struct URJ_FLASH_CFI_CHIP { int width; /* 1 for 8 bits, 2 for 16 bits, 4 for 32 bits, etc. */ urj_flash_cfi_query_structure_t cfi; diff --git a/urjtag/src/flash/flash.h b/urjtag/src/flash/flash.h index 08670f78..3cf8f493 100644 --- a/urjtag/src/flash/flash.h +++ b/urjtag/src/flash/flash.h @@ -42,9 +42,9 @@ #include #include -typedef struct urj_flash_cfi_chip urj_flash_cfi_chip_t; +typedef struct URJ_FLASH_CFI_CHIP urj_flash_cfi_chip_t; -struct urj_flash_cfi_array +struct URJ_FLASH_CFI_ARRAY { urj_bus_t *bus; uint32_t address; diff --git a/urjtag/src/tap/cable/cmd_xfer.h b/urjtag/src/tap/cable/cmd_xfer.h index 3def18ae..0be84ca3 100644 --- a/urjtag/src/tap/cable/cmd_xfer.h +++ b/urjtag/src/tap/cable/cmd_xfer.h @@ -32,8 +32,8 @@ /* description of a command the buffer can contain one or more commands if receive count is zero for all of them */ -typedef struct urj_tap_cable_cx_cmd urj_tap_cable_cx_cmd_t; -struct urj_tap_cable_cx_cmd +typedef struct URJ_TAP_CABLE_CX_CMD urj_tap_cable_cx_cmd_t; +struct URJ_TAP_CABLE_CX_CMD { urj_tap_cable_cx_cmd_t *next; uint32_t buf_len; @@ -42,12 +42,12 @@ struct urj_tap_cable_cx_cmd uint32_t to_recv; }; -struct urj_tap_cable_cx_cmd_root +struct URJ_TAP_CABLE_CX_CMD_ROOT { urj_tap_cable_cx_cmd_t *first; urj_tap_cable_cx_cmd_t *last; }; -typedef struct urj_tap_cable_cx_cmd_root urj_tap_cable_cx_cmd_root_t; +typedef struct URJ_TAP_CABLE_CX_CMD_ROOT urj_tap_cable_cx_cmd_root_t; int urj_tap_cable_cx_cmd_space (urj_tap_cable_cx_cmd_root_t *cmd_root, int max_len); diff --git a/urjtag/urjtag.i b/urjtag/urjtag.i new file mode 100644 index 00000000..f0620c8b --- /dev/null +++ b/urjtag/urjtag.i @@ -0,0 +1 @@ +#include