X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fecoli_vec.h;h=5fdaa9986c9e171bf054e4e32c0064c858a137fd;hb=d8c60a316b5c2a8b959f6191274504d433cf64f0;hp=defd6527b40f19665a92b150e414ee8961286daf;hpb=d3f82a7571b394d8e9b6f2791219eb7ad67d6597;p=protos%2Flibecoli.git diff --git a/lib/ecoli_vec.h b/lib/ecoli_vec.h index defd652..5fdaa99 100644 --- a/lib/ecoli_vec.h +++ b/lib/ecoli_vec.h @@ -1,28 +1,5 @@ -/* - * Copyright (c) 2016, Olivier MATZ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University of California, Berkeley nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2016, Olivier MATZ */ /** @@ -41,6 +18,7 @@ /* if NULL, default does nothing */ typedef void (*ec_vec_elt_free_t)(void *ptr); + /* if NULL, default is: * memcpy(dst, src, vec->elt_size) */ @@ -62,6 +40,8 @@ struct ec_vec *ec_vec_dup(const struct ec_vec *vec); struct ec_vec *ec_vec_ndup(const struct ec_vec *vec, size_t off, size_t len); void ec_vec_free(struct ec_vec *vec); + +__attribute__((pure)) size_t ec_vec_len(const struct ec_vec *vec); #endif