github.com/llvm-mirror/llgo@v0.0.0-20190322182713-bf6f0a60fce1/third_party/gofrontend/libgo/runtime/go-print.c (about)

     1  /* go-print.c -- support for the go print statement.
     2  
     3     Copyright 2009 The Go Authors. All rights reserved.
     4     Use of this source code is governed by a BSD-style
     5     license that can be found in the LICENSE file.  */
     6  
     7  #include <math.h>
     8  #include <stdint.h>
     9  #include <stdio.h>
    10  
    11  #include "runtime.h"
    12  #include "array.h"
    13  #include "go-panic.h"
    14  #include "interface.h"
    15  
    16  /* This implements the various little functions which are called by
    17     the predeclared functions print/println/panic/panicln.  */
    18  
    19  void
    20  __go_print_empty_interface (struct __go_empty_interface e)
    21  {
    22    runtime_printf ("(%p,%p)", e.__type_descriptor, e.__object);
    23  }
    24  
    25  void
    26  __go_print_interface (struct __go_interface i)
    27  {
    28    runtime_printf ("(%p,%p)", i.__methods, i.__object);
    29  }
    30  
    31  void
    32  __go_print_slice (struct __go_open_array val)
    33  {
    34    runtime_printf ("[%d/%d]", val.__count, val.__capacity);
    35    runtime_printpointer (val.__values);
    36  }