2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2004-2006 - INRIA - Fabrice Leray
4 * Copyright (C) 2006 - INRIA - Allan Cornet
5 * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
6 * Copyright (C) 2010 - DIGITEO - Manuel Juliachs
7 * Copyright (C) 2011 - DIGITEO - Vincent Couvert
9 * This file must be used under the terms of the CeCILL.
10 * This source file is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at
13 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
17 /*------------------------------------------------------------------------*/
18 /* file: get_user_data_property.c */
19 /* desc : function to retrieve in Scilab the user_data field of */
21 /*------------------------------------------------------------------------*/
23 #include "getHandleProperty.h"
24 #include "GetProperty.h"
25 #include "returnProperty.h"
28 #include "getGraphicObjectProperty.h"
29 #include "graphicObjectProperties.h"
31 /*------------------------------------------------------------------------*/
32 int get_user_data_property(void* _pvCtx, int iObjUID)
34 int iUserDataSize = 0;
35 int *piUserDataSize = &iUserDataSize;
36 int *piUserData = NULL;
40 getGraphicObjectProperty(iObjUID, __GO_USER_DATA_SIZE__, jni_int, (void **)&piUserDataSize);
42 getGraphicObjectProperty(iObjUID, __GO_USER_DATA__, jni_int_vector, (void **)&piUserData);
44 if ((piUserData == NULL) || (piUserDataSize == NULL))
46 status = sciReturnEmptyMatrix(_pvCtx);
50 status = sciReturnUserData(_pvCtx, piUserData, iUserDataSize);
57 /*------------------------------------------------------------------------*/