Move all include/* to include/urjtag/; start lifting command implementations into their library modules
git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1539 b68d4a1b-bc3d-0410-92ed-d4ac073336b7master
parent
6fb6e82dbd
commit
08e72f4335
@ -0,0 +1,92 @@
|
||||
/*
|
||||
* $Id: error.h 1519 2009-04-22 23:12:44Z rfhh $
|
||||
*
|
||||
* Copyright (C) 2009, Rutger Hofman, VU Amsterdam
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_ERROR_H
|
||||
#define URJ_ERROR_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/**
|
||||
* Error types
|
||||
*/
|
||||
typedef enum urj_error {
|
||||
URJ_ERROR_OK = 0,
|
||||
URJ_ERROR_ALREADY,
|
||||
URJ_ERROR_OUT_OF_MEMORY,
|
||||
URJ_ERROR_NO_ACTIVE_PART,
|
||||
URJ_ERROR_INVALID,
|
||||
URJ_ERROR_NOTFOUND,
|
||||
} urj_error_t;
|
||||
|
||||
/** Max length of message string that can be recorded. */
|
||||
#define URJ_ERROR_MSG_LEN 256
|
||||
|
||||
/**
|
||||
* Error state.
|
||||
*/
|
||||
typedef struct urj_error_state {
|
||||
urj_error_t errnum; /**< error number */
|
||||
const char *file; /**< file where error is set */
|
||||
const char *function; /**< function --,,-- */
|
||||
int line; /**< line no --,,-- */
|
||||
char msg[URJ_ERROR_MSG_LEN]; /**< printf-style message */
|
||||
} urj_error_state_t;
|
||||
|
||||
extern urj_error_state_t urj_error_state;
|
||||
|
||||
/**
|
||||
* Set error state. The macro interface allows for a stack of errors, where
|
||||
* this macro would push an error. The implementation is free to maintain
|
||||
* a stack of depth one.
|
||||
*
|
||||
* @param e urj_error_t value
|
||||
* @param ... consists of a printf argument set. It needs to start with a
|
||||
* const char *fmt, followed by arguments used by fmt.
|
||||
*/
|
||||
#define urj_error_set(e, ...) \
|
||||
do { \
|
||||
urj_error_state.errnum = e; \
|
||||
urj_error_state.file = __FILE__; \
|
||||
urj_error_state.function = __func__; \
|
||||
urj_error_state.line = __LINE__; \
|
||||
snprintf(urj_error_state.msg, sizeof urj_error_state.msg, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* The top of the error stack. The caller must not modify the returned struct.
|
||||
*/
|
||||
const urj_error_state_t *urj_error_get(void);
|
||||
/**
|
||||
* Pop the top off the error stack.
|
||||
* @return #URJ_ERROR_OK if the bottom of the error stack is reached
|
||||
*/
|
||||
urj_error_t urj_error_get_reset(void);
|
||||
/**
|
||||
* The top of the error state in human-readable form.
|
||||
*
|
||||
* This function is not reentrant.
|
||||
*
|
||||
* @return a pointer to a static area.
|
||||
*/
|
||||
const char *urj_error_describe(void);
|
||||
|
||||
#endif /* URJ_ERROR_H */
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* $Id: urjtag.h 1525 2009-04-23 15:56:49Z rfhh $
|
||||
*
|
||||
* Global opaque types that had better be predefined
|
||||
* Copyright (C) 2009, Rutger Hofman
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Rutger Hofman, VU Amsterdam
|
||||
*
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
||||
#define URJ_STATUS_OK 0
|
||||
#define URJ_STATUS_FAIL 1
|
||||
#define URJ_STATUS_SYNTAX_ERROR (-1)
|
||||
|
||||
#endif /* URJ_URJ_TYPES_H */
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* $Id: urjtag.h 1525 2009-04-23 15:56:49Z rfhh $
|
||||
*
|
||||
* Public include file for the UrJTAG library.
|
||||
* Copyright (C) 2009, Rutger Hofman
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Author: Rutger Hofman, VU Amsterdam
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef URJ_URJTAG_H
|
||||
#define URJ_URJTAG_H
|
||||
|
||||
#include "types.h"
|
||||
#include "bitmask.h"
|
||||
#include "bsbit.h"
|
||||
#include "bsdl.h"
|
||||
#include "bsdl_mode.h"
|
||||
#include "bssignal.h"
|
||||
#include "bus.h"
|
||||
#include "bus_driver.h"
|
||||
#include "cable.h"
|
||||
#include "chain.h"
|
||||
#include "cmd.h"
|
||||
#include "data_register.h"
|
||||
#include "fclock.h"
|
||||
#include "flash.h"
|
||||
#include "gettext.h"
|
||||
#include "jim.h"
|
||||
#include "jtag.h"
|
||||
#include "parport.h"
|
||||
#include "part.h"
|
||||
#include "part_instruction.h"
|
||||
#include "pod.h"
|
||||
#include "svf.h"
|
||||
#include "tap.h"
|
||||
#include "tap_register.h"
|
||||
#include "tap_state.h"
|
||||
#include "urjtag.h"
|
||||
#include "usbconn.h"
|
||||
#include "xpcu.h"
|
||||
|
||||
#endif /* URJ_URJTAG_H */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue