1 /* 2 * $Id$ 3 * 4 * Copyright (C) 2002 ETC s.r.o. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19 * 02111-1307, USA. 20 * 21 * Written by Marcel Telka <marcel@telka.sk>, 2002. 22 * 23 */ 24 25 #ifndef URJ_DATA_REGISTER_H 26 #define URJ_DATA_REGISTER_H 27 28 #include "types.h" 29 30 #define URJ_DATA_REGISTER_MAXLEN 32 31 32 struct URJ_DATA_REGISTER 33 { 34 char name[URJ_DATA_REGISTER_MAXLEN + 1]; /* (public) register name */ 35 urj_tap_register_t *in; /* (public) register value clocked in */ 36 urj_tap_register_t *out; /* (public) register value clocked out */ 37 urj_data_register_t *next; 38 }; 39 40 urj_data_register_t *urj_part_data_register_alloc (const char *name, int len); 41 void urj_part_data_register_free (urj_data_register_t *dr); 42 43 /** 44 * change the length of a data_register while preserving its contents 45 * 46 * @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error 47 */ 48 int urj_part_data_register_realloc (urj_data_register_t *dr, int len); 49 50 /** 51 * allocate a data register and initialize the relevant <code>part</code> parts 52 * 53 * @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error 54 */ 55 int urj_part_data_register_define (urj_part_t *part, const char *name, int len); 56 57 #endif /* URJ_DATA_REGISTER_H */ 58