code: def buf_lookup_full_code(proto, defin, name, nd):
      """
      Generates a buffer lookup function for the right number
      of dimensions. The function gives back a void* at the right location.
      """
      # _i_ndex, _s_tride, sub_o_ffset
      macroargs = ", ".join(
          ["i%d, s%d, o%d" % (i, i, i) for i in range(nd)]
      )
      proto.putln(
          "#define %s(type, buf, %s) (type)(%s_imp(buf, %s))"
          % (name, macroargs, name, macroargs)
      )
  
      funcargs = ", ".join(
          [
              "Py_ssize_t i%d, Py_ssize_t s%d, Py_ssize_t o%d"
              % (i, i, i)
              for i in range(nd)
          ]
      )
      proto.putln(
          "static CYTHON_INLINE void* %s_imp(void* buf, %s);"
          % (name, funcargs)
      )
      defin.putln(
          dedent(
              """
          static CYTHON_INLINE void* %s_imp(void* buf, %s) {
            char* ptr = (char*)buf;
          """
          )
          % (name, funcargs)
          + "".join(
              [
                  dedent(
                      """\
            ptr += s%d * i%d;
            if (o%d >= 0) ptr = *((char**)ptr) + o%d;
          """
                  )
                  % (i, i, i, i)
                  for i in range(nd)
              ]
          )
          + "\nreturn ptr;\n}"
      )
  
imports: from __future__ import absolute_import
  from .Visitor import CythonTransform
  from .ModuleNode import ModuleNode
  from .Errors import CompileError
  from .UtilityCode import CythonUtilityCode
  from .Code import UtilityCode, TempitaUtilityCode
  from .None import Options
  from .None import Interpreter
  from .None import PyrexTypes
  from .None import Naming
  from .None import Symtab
label_desc: Use image node_id 13 for calling a global function with example usage: buf_lookup_full_code(proto, defin, name, nd) without return types