1 /* 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET 4 * 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * 7 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * This file was originally licensed under the terms of the CeCILL v2.1, 10 * and continues to be available under such terms. 11 * For more information, see the COPYING file which you should have received 12 * along with this program. 13 * 14 */ 15 16 #ifndef __XCOS_UTILITIES_HXX__ 17 #define __XCOS_UTILITIES_HXX__ 18 19 /** 20 * Read a single boolean on the stack. 21 * 22 * @param _pvCtx private api context (opaque structure) 23 * @param rhsPosition the position on the stack. 24 * @param[out] out the read value. 25 * @param fname the function name used for the call. 26 * @return status of the operation (<> 0 on error) 27 */ 28 int readSingleBoolean(void* pvApiCtx, int rhsPosition, bool* out, const char* fname); 29 30 /** 31 * Read a single string on the stack. 32 * 33 * @param _pvCtx private api context (opaque structure) 34 * @param rhsPosition the position on the stack. 35 * @param[out] out the read value. 36 * @param fname the function name used for the call. 37 * @return status of the operation (<> 0 on error) 38 */ 39 int readSingleString(void* pvApiCtx, int rhsPosition, char** out, const char* fname); 40 41 /** 42 * Read a vector of string on the stack. 43 * 44 * @param _pvCtx private api context (opaque structure) 45 * @param rhsPosition the position on the stack. 46 * @param[out] out the read value. 47 * @param[out] vectorLength the length of the vector. 48 * @param fname the function name used for the call. 49 * @return status of the operation (<> 0 on error) 50 */ 51 int readVectorString(void* pvApiCtx, int rhsPosition, char*** out, int* vectorLength, char* fname); 52 53 /** 54 * Free the allocated vector of strings after the readVectorString call 55 * 56 * @param str the vector of strings 57 * @param len the length of the vector 58 */ 59 void releaseVectorString(char** str, int len); 60 61 #endif /* !__XCOS_UTILITIES_HXX__ */ 62