File: string.go

package info (click to toggle)
c2go 0.26.11-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,052 kB
  • sloc: ansic: 6,037; sh: 82; makefile: 5
file content (42 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package darwin

import (
	"github.com/elliotchance/c2go/noarch"
	"unsafe"
)

// BuiltinStrcpy is for __builtin___strcpy_chk.
// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func BuiltinStrcpy(dest, src *byte, size int32) *byte {
	return noarch.Strcpy(dest, src)
}

// BuiltinObjectSize is for __builtin_object_size.
// https://github.com/elliotchance/c2go/issues/359
func BuiltinObjectSize(ptr *byte, theType int32) int32 {
	return 5
}

// BuiltinStrncpy is for __builtin___strncpy_chk.
// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func BuiltinStrncpy(dest, src *byte, len, size int32) *byte {
	return noarch.Strncpy(dest, src, len)
}

// BuiltinStrcat is for __builtin___strcat_chk
// https://opensource.apple.com/source/Libc/Libc-763.12/include/secure/_string.h.auto.html
func BuiltinStrcat(dest, src *byte, _ int32) *byte {
	return noarch.Strcat(dest, src)
}

// Memset is for __builtin___memset_chk
// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func Memset(dst unsafe.Pointer, val int32, size int32, _ int32) unsafe.Pointer {
	return noarch.Memset(dst, val, size)
}

// Memcpy  is for __builtin___memcpy_chk and __builtin___memmove_chk
//// https://opensource.apple.com/source/Libc/Libc-498/include/secure/_string.h
func Memcpy(dst, src unsafe.Pointer, size int32, _ int32) unsafe.Pointer {
	return noarch.Memcpy(dst, src, size)
}