2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) INRIA - Allan CORNET
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
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.
16 /*--------------------------------------------------------------------------*/
25 #include "api_scilab.h"
28 #include "localization.h"
29 /*--------------------------------------------------------------------------*/
30 int sci_xpause(char *fname, void* pvApiCtx)
34 int m1 = 0, n1 = 0, sec = 0;
35 int * p1_in_address = NULL;
36 double * pDblReal = NULL;
38 sciprint(_("%s: Feature %s is obsolete and will be permanently removed in Scilab %s\n"), _("Warning"), fname, "6.1");
39 sciprint(_("%s: Please use %s instead.\n"), _("Warning"), "sleep()");
46 sciErr = getVarAddressFromPosition(pvApiCtx, 1, &p1_in_address);
49 printError(&sciErr, 0);
52 sciErr = getMatrixOfDouble(pvApiCtx, p1_in_address, &m1, &n1, &pDblReal);
55 printError(&sciErr, 0);
59 if (isScalar(pvApiCtx, p1_in_address) == 0)
61 Scierror(999, _("%s: Wrong type for input argument #%d: A real scalar expected.\n"), fname, 1);
65 sec = (int) * pDblReal;
69 Scierror(999, _("%s: Wrong values for input argument #%d: Non-negative integers expected.\n"), fname, 1);
74 int ms = (sec) / 1000; /** time is specified in milliseconds in scilab**/
77 Sleep(ms); /* Number of milliseconds to sleep. */
83 useconds = (unsigned) sec;
105 /*--------------------------------------------------------------------------*/