Line data Source code
1 : //------------------------------------------------------------------------------ 2 : // LAGraph_SizeOfType: return the sizeof(...) of a GraphBLAS GrB_Type 3 : //------------------------------------------------------------------------------ 4 : 5 : // LAGraph, (c) 2019-2023 by The LAGraph Contributors, All Rights Reserved. 6 : // SPDX-License-Identifier: BSD-2-Clause 7 : // 8 : // For additional details (including references to third party source code and 9 : // other files) see the LICENSE file or contact permission@sei.cmu.edu. See 10 : // Contributors.txt for a full list of contributors. Created, in part, with 11 : // funding and support from the U.S. Government (see Acknowledgments.txt file). 12 : // DM22-0790 13 : 14 : // Contributed by Timothy A. Davis, Texas A&M University 15 : 16 : //------------------------------------------------------------------------------ 17 : 18 : #include "LG_internal.h" 19 : 20 19 : int LAGraph_SizeOfType 21 : ( 22 : // output: 23 : size_t *size, // size of the type 24 : // input: 25 : GrB_Type type, // GraphBLAS type 26 : char *msg 27 : ) 28 : { 29 : 30 : //-------------------------------------------------------------------------- 31 : // check inputs 32 : //-------------------------------------------------------------------------- 33 : 34 19 : LG_CLEAR_MSG ; 35 19 : LG_ASSERT (type != NULL, GrB_NULL_POINTER) ; 36 17 : LG_ASSERT (size != NULL, GrB_NULL_POINTER) ; 37 16 : (*size) = 0 ; 38 : 39 : //-------------------------------------------------------------------------- 40 : // determine the size of the type 41 : //-------------------------------------------------------------------------- 42 : 43 16 : GRB_TRY (GrB_Type_get_SIZE (type, size, GrB_SIZE)) ; 44 16 : return (GrB_SUCCESS) ; 45 : } 46 :