<|start_filename|>vcbuild/vcbuild64.bat<|end_filename|>
@ECHO off

if not exist dist64 mkdir dist64
if exist dist64\* del /q dist64\*

cd ..\libxnd
copy /y Makefile.vc Makefile

nmake /nologo clean
nmake /nologo

copy /y libxnd-0.2.0dev3.lib ..\vcbuild\dist64
copy /y libxnd-0.2.0dev3.dll ..\vcbuild\dist64
copy /y libxnd-0.2.0dev3.dll.lib ..\vcbuild\dist64
copy /y libxnd-0.2.0dev3.dll.exp ..\vcbuild\dist64
copy /y xnd.h ..\vcbuild\dist64

cd tests
copy /y Makefile.vc Makefile
nmake /nologo clean
nmake /nologo

copy /y runtest.exe ..\..\vcbuild\dist64
copy /y runtest_shared.exe ..\..\vcbuild\dist64

cd ..\..\vcbuild





<|start_filename|>.conda/xnd/bld.bat<|end_filename|>
cd "%RECIPE_DIR%\..\..\" || exit 1
"%PYTHON%" setup.py conda_install || exit 1
if not exist "%SP_DIR%\xnd\contrib" mkdir "%SP_DIR%\xnd\contrib"
copy /y python\xnd\contrib\*.py "%SP_DIR%\xnd\contrib"
if not exist "%RECIPE_DIR%\test" mkdir "%RECIPE_DIR%\test"
copy /y python\*.py "%RECIPE_DIR%\test"


<|start_filename|>python/xnd/docstrings.h<|end_filename|>
/*
 * BSD 3-Clause License
 *
 * Copyright (c) 2017-2018, plures
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 *
 * 2. 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.
 *
 * 3. Neither the name of the copyright holder 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER OR 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.
 */


#include "pymacro.h"


/******************************************************************************/
/*                                Module                                      */
/******************************************************************************/


PyDoc_STRVAR(doc_module, "xnd module");



/******************************************************************************/
/*                             xnd properties                                 */
/******************************************************************************/

PyDoc_STRVAR(doc_value,
"\n\
Convert the in-memory value to a Python value.\n\
\n\
   >>> x = xnd([1, 2, 3, 4, 5])\n\
   >>> x.value\n\
   [1, 2, 3, 4, 5]\n\
\n");

PyDoc_STRVAR(doc_type,
"\n\
Return the type of the in-memory value.\n\
\n\
   >>> x = xnd([[1, 2, 3], [4, 5]])\n\
   >>> x.type\n\
   ndt(\"var * var * int64\")\n\
\n");

PyDoc_STRVAR(doc_ndim,
"\n\
Return the number of dimensions of the in-memory value.\n\
\n\
   >>> x = xnd([[(1, \"a\"), (2, \"b\")], [(3, \"x\"), (4, \"y\")]])\n\
   >>> x.ndim\n\
   2\n\
\n");

PyDoc_STRVAR(doc_align,
"\n\
Return the alignment of the memory block.\n\
\n\
   >>> t = \"2 * {a: uint8, b: float64, align=512}\"\n\
   >>> x = xnd([{'a': 1, 'b': 2.0}, {'a': 2, 'b': 3.0}], type=t)\n\
   >>> x.align\n\
   512\n\
\n");


/******************************************************************************/
/*                                xnd methods                                 */
/******************************************************************************/

PyDoc_STRVAR(doc_short_value,
"short_value($self, /, maxshape=None)\n--\n\n\
Convert the in-memory value to an abbreviated Python value.  Container types\n\
are converted to maxshape-1 actual values followed by an Ellipsis.  If maxshape\n\
is None, the representation is not abbreviated.\n\
\n\
    >>> x = xnd([1, 2, 3, 4, 5])\n\
    >>> x.short_value(maxshape=3)\n\
    [1, 2, ...]\n\
\n");

PyDoc_STRVAR(doc_empty,
"empty($type, type, /)\n--\n\n\
Class method that constructs a new xnd container according to the type\n\
argument.  All values are initialized to zero.\n\
\n\
    >>> xnd.empty(\"10 * 2 * (int64, string, complex128)\")\n\
    xnd([[(0, '', 0j), (0, '', 0j)], [(0, '', 0j), (0, '', 0j)],\n\
         [(0, '', 0j), (0, '', 0j)], [(0, '', 0j), (0, '', 0j)],\n\
         [(0, '', 0j), (0, '', 0j)], [(0, '', 0j), (0, '', 0j)],\n\
         [(0, '', 0j), (0, '', 0j)], [(0, '', 0j), (0, '', 0j)],\n\
         [(0, '', 0j), (0, '', 0j)], ...], type=\"10 * 2 * (int64, string, complex128)\")\n\
\n");

PyDoc_STRVAR(doc_from_buffer,
"from_buffer($type, obj, /)\n--\n\n\
Class method that constructs a new xnd container from an object that supports\n\
the buffer protocol.\n\
\n\
    >>> xnd.from_buffer(b\"123\")\n\
    xnd([49, 50, 51], type=\"3 * uint8\")\n\
\n\
    >>> import numpy as np\n\
    >>> a = np.array([[1, 2, 3], [4, 5, 6]])\n\
    >>> xnd.from_buffer(a)\n\
    xnd([[1, 2, 3], [4, 5, 6]], type=\"2 * 3 * int64\")\n\
\n\
\n");


<|start_filename|>vcbuild/runtest64.bat<|end_filename|>
@ECHO OFF
echo.
<nul (set /p x="Running static library tests ... ")
echo.
echo.
dist64\runtest.exe
IF ERRORLEVEL 1 echo FAIL
echo.
<nul (set /p x="Running shared library tests ... ")
echo.
echo.
copy /y ..\ndtypes\libndtypes\libndtypes-0.2.0dev3.dll dist64
dist64\runtest_shared.exe
IF ERRORLEVEL 1 echo FAIL


<|start_filename|>vcbuild/vcbuild32.bat<|end_filename|>
@ECHO off

if not exist dist32 mkdir dist32
if exist dist32\* del /q dist32\*

cd ..\libxnd
copy /y Makefile.vc Makefile

nmake /nologo clean
nmake /nologo

copy /y libxnd-0.2.0dev3.lib ..\vcbuild\dist32
copy /y libxnd-0.2.0dev3.dll ..\vcbuild\dist32
copy /y libxnd-0.2.0dev3.dll.lib ..\vcbuild\dist32
copy /y libxnd-0.2.0dev3.dll.exp ..\vcbuild\dist32
copy /y xnd.h ..\vcbuild\dist32

cd tests
copy /y Makefile.vc Makefile
nmake /nologo clean
nmake /nologo

copy /y runtest.exe ..\..\vcbuild\dist32
copy /y runtest_shared.exe ..\..\vcbuild\dist32

cd ..\..\vcbuild



