/* See frb_types.h */ /* Last edited on 2005-01-16 14:20:35 by stolfi */ /* Copyright © 2005 Universidade Estadual de Campinas. See note at end of file. */ #include #include #include /* INTEGER PAIRS */ i2_vec_t i2_vec_new(nat nel) { /* This is not a macro only because gcc does not allow cast of struct: */ vec_t v = vec_new(nel, sizeof(i2_t)); i2_vec_t r; r.nel = v.nel; r.el = (i2_t*)v.el; return r; } /* REAL TRIPLES */ r3_vec_t r3_vec_new(nat nel) { /* This is not a macro only because gcc does not allow cast of struct: */ vec_t v = vec_new(nel, sizeof(r3_t)); r3_vec_t r; r.nel = v.nel; r.el = (r3_t*)v.el; return r; } /* SIGNED BYTES */ sbyte_vec_t sbyte_vec_new(nat nel) { /* This is not a macro only because gcc does not allow cast of struct: */ vec_t v = vec_new(nel, sizeof(sbyte)); sbyte_vec_t r; r.nel = v.nel; r.el = (sbyte*)v.el; return r; } /* COPYRIGHT AND AUTHORSHIP NOTICE Copyright © 2005 Universidade Estadual de Campinas (UNICAMP). Created by Helena C. G. Leitão and Jorge Stolfi in 1995--2005. This source file can be freely distributed, used, and modified, provided that this copyright and authorship notice is preserved in all copies, and that any modified versions of this file are clearly marked as such. This software has NO WARRANTY of correctness or applicability for any purpose. Neither the authors nor their employers shall be held responsible for any losses or damages that may result from its use. END OF NOTICE */