id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
28,600 | ceph/go-ceph | cephfs/cephfs.go | IsMounted | func (mount *MountInfo) IsMounted() bool {
ret := C.ceph_is_mounted(mount.mount)
return ret == 1
} | go | func (mount *MountInfo) IsMounted() bool {
ret := C.ceph_is_mounted(mount.mount)
return ret == 1
} | [
"func",
"(",
"mount",
"*",
"MountInfo",
")",
"IsMounted",
"(",
")",
"bool",
"{",
"ret",
":=",
"C",
".",
"ceph_is_mounted",
"(",
"mount",
".",
"mount",
")",
"\n",
"return",
"ret",
"==",
"1",
"\n",
"}"
] | // IsMounted checks mount status. | [
"IsMounted",
"checks",
"mount",
"status",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/cephfs/cephfs.go#L167-L170 |
28,601 | ceph/go-ceph | rados/conn.go | PingMonitor | func (c *Conn) PingMonitor(id string) (string, error) {
c_id := C.CString(id)
defer C.free(unsafe.Pointer(c_id))
var strlen C.size_t
var strout *C.char
ret := C.rados_ping_monitor(c.cluster, c_id, &strout, &strlen)
defer C.rados_buffer_free(strout)
if ret == 0 {
reply := C.GoStringN(strout, (C.int)(strlen))... | go | func (c *Conn) PingMonitor(id string) (string, error) {
c_id := C.CString(id)
defer C.free(unsafe.Pointer(c_id))
var strlen C.size_t
var strout *C.char
ret := C.rados_ping_monitor(c.cluster, c_id, &strout, &strlen)
defer C.rados_buffer_free(strout)
if ret == 0 {
reply := C.GoStringN(strout, (C.int)(strlen))... | [
"func",
"(",
"c",
"*",
"Conn",
")",
"PingMonitor",
"(",
"id",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"c_id",
":=",
"C",
".",
"CString",
"(",
"id",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"c_id",
... | // PingMonitor sends a ping to a monitor and returns the reply. | [
"PingMonitor",
"sends",
"a",
"ping",
"to",
"a",
"monitor",
"and",
"returns",
"the",
"reply",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L27-L43 |
28,602 | ceph/go-ceph | rados/conn.go | Connect | func (c *Conn) Connect() error {
ret := C.rados_connect(c.cluster)
if ret != 0 {
return RadosError(int(ret))
}
c.connected = true
return nil
} | go | func (c *Conn) Connect() error {
ret := C.rados_connect(c.cluster)
if ret != 0 {
return RadosError(int(ret))
}
c.connected = true
return nil
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"Connect",
"(",
")",
"error",
"{",
"ret",
":=",
"C",
".",
"rados_connect",
"(",
"c",
".",
"cluster",
")",
"\n",
"if",
"ret",
"!=",
"0",
"{",
"return",
"RadosError",
"(",
"int",
"(",
"ret",
")",
")",
"\n",
"}"... | // Connect establishes a connection to a RADOS cluster. It returns an error,
// if any. | [
"Connect",
"establishes",
"a",
"connection",
"to",
"a",
"RADOS",
"cluster",
".",
"It",
"returns",
"an",
"error",
"if",
"any",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L47-L54 |
28,603 | ceph/go-ceph | rados/conn.go | Shutdown | func (c *Conn) Shutdown() {
if err := c.ensure_connected(); err != nil {
return
}
C.rados_shutdown(c.cluster)
} | go | func (c *Conn) Shutdown() {
if err := c.ensure_connected(); err != nil {
return
}
C.rados_shutdown(c.cluster)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"Shutdown",
"(",
")",
"{",
"if",
"err",
":=",
"c",
".",
"ensure_connected",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"C",
".",
"rados_shutdown",
"(",
"c",
".",
"cluster",
")",
"\n",
... | // Shutdown disconnects from the cluster. | [
"Shutdown",
"disconnects",
"from",
"the",
"cluster",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L57-L62 |
28,604 | ceph/go-ceph | rados/conn.go | ReadConfigFile | func (c *Conn) ReadConfigFile(path string) error {
c_path := C.CString(path)
defer C.free(unsafe.Pointer(c_path))
ret := C.rados_conf_read_file(c.cluster, c_path)
if ret == 0 {
return nil
} else {
return RadosError(int(ret))
}
} | go | func (c *Conn) ReadConfigFile(path string) error {
c_path := C.CString(path)
defer C.free(unsafe.Pointer(c_path))
ret := C.rados_conf_read_file(c.cluster, c_path)
if ret == 0 {
return nil
} else {
return RadosError(int(ret))
}
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"ReadConfigFile",
"(",
"path",
"string",
")",
"error",
"{",
"c_path",
":=",
"C",
".",
"CString",
"(",
"path",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"c_path",
")",
")",
"\n",
... | // ReadConfigFile configures the connection using a Ceph configuration file. | [
"ReadConfigFile",
"configures",
"the",
"connection",
"using",
"a",
"Ceph",
"configuration",
"file",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L65-L74 |
28,605 | ceph/go-ceph | rados/conn.go | ReadDefaultConfigFile | func (c *Conn) ReadDefaultConfigFile() error {
ret := C.rados_conf_read_file(c.cluster, nil)
if ret == 0 {
return nil
} else {
return RadosError(int(ret))
}
} | go | func (c *Conn) ReadDefaultConfigFile() error {
ret := C.rados_conf_read_file(c.cluster, nil)
if ret == 0 {
return nil
} else {
return RadosError(int(ret))
}
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"ReadDefaultConfigFile",
"(",
")",
"error",
"{",
"ret",
":=",
"C",
".",
"rados_conf_read_file",
"(",
"c",
".",
"cluster",
",",
"nil",
")",
"\n",
"if",
"ret",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"else",
"{... | // ReadDefaultConfigFile configures the connection using a Ceph configuration
// file located at default locations. | [
"ReadDefaultConfigFile",
"configures",
"the",
"connection",
"using",
"a",
"Ceph",
"configuration",
"file",
"located",
"at",
"default",
"locations",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L78-L85 |
28,606 | ceph/go-ceph | rados/conn.go | ListPools | func (c *Conn) ListPools() (names []string, err error) {
buf := make([]byte, 4096)
for {
ret := int(C.rados_pool_list(c.cluster,
(*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
if ret < 0 {
return nil, RadosError(int(ret))
}
if ret > len(buf) {
buf = make([]byte, ret)
continue
}
tmp... | go | func (c *Conn) ListPools() (names []string, err error) {
buf := make([]byte, 4096)
for {
ret := int(C.rados_pool_list(c.cluster,
(*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
if ret < 0 {
return nil, RadosError(int(ret))
}
if ret > len(buf) {
buf = make([]byte, ret)
continue
}
tmp... | [
"func",
"(",
"c",
"*",
"Conn",
")",
"ListPools",
"(",
")",
"(",
"names",
"[",
"]",
"string",
",",
"err",
"error",
")",
"{",
"buf",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"4096",
")",
"\n",
"for",
"{",
"ret",
":=",
"int",
"(",
"C",
".",
"... | // ListPools returns the names of all existing pools. | [
"ListPools",
"returns",
"the",
"names",
"of",
"all",
"existing",
"pools",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L100-L124 |
28,607 | ceph/go-ceph | rados/conn.go | SetConfigOption | func (c *Conn) SetConfigOption(option, value string) error {
c_opt, c_val := C.CString(option), C.CString(value)
defer C.free(unsafe.Pointer(c_opt))
defer C.free(unsafe.Pointer(c_val))
ret := C.rados_conf_set(c.cluster, c_opt, c_val)
if ret < 0 {
return RadosError(int(ret))
} else {
return nil
}
} | go | func (c *Conn) SetConfigOption(option, value string) error {
c_opt, c_val := C.CString(option), C.CString(value)
defer C.free(unsafe.Pointer(c_opt))
defer C.free(unsafe.Pointer(c_val))
ret := C.rados_conf_set(c.cluster, c_opt, c_val)
if ret < 0 {
return RadosError(int(ret))
} else {
return nil
}
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"SetConfigOption",
"(",
"option",
",",
"value",
"string",
")",
"error",
"{",
"c_opt",
",",
"c_val",
":=",
"C",
".",
"CString",
"(",
"option",
")",
",",
"C",
".",
"CString",
"(",
"value",
")",
"\n",
"defer",
"C",
... | // SetConfigOption sets the value of the configuration option identified by
// the given name. | [
"SetConfigOption",
"sets",
"the",
"value",
"of",
"the",
"configuration",
"option",
"identified",
"by",
"the",
"given",
"name",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L128-L138 |
28,608 | ceph/go-ceph | rados/conn.go | GetConfigOption | func (c *Conn) GetConfigOption(name string) (value string, err error) {
buf := make([]byte, 4096)
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
ret := int(C.rados_conf_get(c.cluster, c_name,
(*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
// FIXME: ret may be -ENAMETOOLONG if the buffer... | go | func (c *Conn) GetConfigOption(name string) (value string, err error) {
buf := make([]byte, 4096)
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
ret := int(C.rados_conf_get(c.cluster, c_name,
(*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
// FIXME: ret may be -ENAMETOOLONG if the buffer... | [
"func",
"(",
"c",
"*",
"Conn",
")",
"GetConfigOption",
"(",
"name",
"string",
")",
"(",
"value",
"string",
",",
"err",
"error",
")",
"{",
"buf",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"4096",
")",
"\n",
"c_name",
":=",
"C",
".",
"CString",
"("... | // GetConfigOption returns the value of the Ceph configuration option
// identified by the given name. | [
"GetConfigOption",
"returns",
"the",
"value",
"of",
"the",
"Ceph",
"configuration",
"option",
"identified",
"by",
"the",
"given",
"name",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L142-L157 |
28,609 | ceph/go-ceph | rados/conn.go | GetClusterStats | func (c *Conn) GetClusterStats() (stat ClusterStat, err error) {
if err := c.ensure_connected(); err != nil {
return ClusterStat{}, err
}
c_stat := C.struct_rados_cluster_stat_t{}
ret := C.rados_cluster_stat(c.cluster, &c_stat)
if ret < 0 {
return ClusterStat{}, RadosError(int(ret))
} else {
return ClusterS... | go | func (c *Conn) GetClusterStats() (stat ClusterStat, err error) {
if err := c.ensure_connected(); err != nil {
return ClusterStat{}, err
}
c_stat := C.struct_rados_cluster_stat_t{}
ret := C.rados_cluster_stat(c.cluster, &c_stat)
if ret < 0 {
return ClusterStat{}, RadosError(int(ret))
} else {
return ClusterS... | [
"func",
"(",
"c",
"*",
"Conn",
")",
"GetClusterStats",
"(",
")",
"(",
"stat",
"ClusterStat",
",",
"err",
"error",
")",
"{",
"if",
"err",
":=",
"c",
".",
"ensure_connected",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"ClusterStat",
"{",
"}",
... | // GetClusterStat returns statistics about the cluster associated with the
// connection. | [
"GetClusterStat",
"returns",
"statistics",
"about",
"the",
"cluster",
"associated",
"with",
"the",
"connection",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L180-L196 |
28,610 | ceph/go-ceph | rados/conn.go | ParseCmdLineArgs | func (c *Conn) ParseCmdLineArgs(args []string) error {
// add an empty element 0 -- Ceph treats the array as the actual contents
// of argv and skips the first element (the executable name)
argc := C.int(len(args) + 1)
argv := make([]*C.char, argc)
// make the first element a string just in case it is ever examin... | go | func (c *Conn) ParseCmdLineArgs(args []string) error {
// add an empty element 0 -- Ceph treats the array as the actual contents
// of argv and skips the first element (the executable name)
argc := C.int(len(args) + 1)
argv := make([]*C.char, argc)
// make the first element a string just in case it is ever examin... | [
"func",
"(",
"c",
"*",
"Conn",
")",
"ParseCmdLineArgs",
"(",
"args",
"[",
"]",
"string",
")",
"error",
"{",
"// add an empty element 0 -- Ceph treats the array as the actual contents",
"// of argv and skips the first element (the executable name)",
"argc",
":=",
"C",
".",
"... | // ParseCmdLineArgs configures the connection from command line arguments. | [
"ParseCmdLineArgs",
"configures",
"the",
"connection",
"from",
"command",
"line",
"arguments",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L199-L220 |
28,611 | ceph/go-ceph | rados/conn.go | GetFSID | func (c *Conn) GetFSID() (fsid string, err error) {
buf := make([]byte, 37)
ret := int(C.rados_cluster_fsid(c.cluster,
(*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
// FIXME: the success case isn't documented correctly in librados.h
if ret == 36 {
fsid = C.GoString((*C.char)(unsafe.Pointer(&buf[0])))... | go | func (c *Conn) GetFSID() (fsid string, err error) {
buf := make([]byte, 37)
ret := int(C.rados_cluster_fsid(c.cluster,
(*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
// FIXME: the success case isn't documented correctly in librados.h
if ret == 36 {
fsid = C.GoString((*C.char)(unsafe.Pointer(&buf[0])))... | [
"func",
"(",
"c",
"*",
"Conn",
")",
"GetFSID",
"(",
")",
"(",
"fsid",
"string",
",",
"err",
"error",
")",
"{",
"buf",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"37",
")",
"\n",
"ret",
":=",
"int",
"(",
"C",
".",
"rados_cluster_fsid",
"(",
"c",
... | // GetFSID returns the fsid of the cluster as a hexadecimal string. The fsid
// is a unique identifier of an entire Ceph cluster. | [
"GetFSID",
"returns",
"the",
"fsid",
"of",
"the",
"cluster",
"as",
"a",
"hexadecimal",
"string",
".",
"The",
"fsid",
"is",
"a",
"unique",
"identifier",
"of",
"an",
"entire",
"Ceph",
"cluster",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L235-L246 |
28,612 | ceph/go-ceph | rados/conn.go | MakePool | func (c *Conn) MakePool(name string) error {
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
ret := int(C.rados_pool_create(c.cluster, c_name))
if ret == 0 {
return nil
} else {
return RadosError(ret)
}
} | go | func (c *Conn) MakePool(name string) error {
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
ret := int(C.rados_pool_create(c.cluster, c_name))
if ret == 0 {
return nil
} else {
return RadosError(ret)
}
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"MakePool",
"(",
"name",
"string",
")",
"error",
"{",
"c_name",
":=",
"C",
".",
"CString",
"(",
"name",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"c_name",
")",
")",
"\n",
"ret",... | // MakePool creates a new pool with default settings. | [
"MakePool",
"creates",
"a",
"new",
"pool",
"with",
"default",
"settings",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L256-L265 |
28,613 | ceph/go-ceph | rados/conn.go | DeletePool | func (c *Conn) DeletePool(name string) error {
if err := c.ensure_connected(); err != nil {
fmt.Println("NOT CONNECTED WHOOPS")
return err
}
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
ret := int(C.rados_pool_delete(c.cluster, c_name))
if ret == 0 {
return nil
} else {
return RadosErro... | go | func (c *Conn) DeletePool(name string) error {
if err := c.ensure_connected(); err != nil {
fmt.Println("NOT CONNECTED WHOOPS")
return err
}
c_name := C.CString(name)
defer C.free(unsafe.Pointer(c_name))
ret := int(C.rados_pool_delete(c.cluster, c_name))
if ret == 0 {
return nil
} else {
return RadosErro... | [
"func",
"(",
"c",
"*",
"Conn",
")",
"DeletePool",
"(",
"name",
"string",
")",
"error",
"{",
"if",
"err",
":=",
"c",
".",
"ensure_connected",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"fmt",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n",
"return",
"err... | // DeletePool deletes a pool and all the data inside the pool. | [
"DeletePool",
"deletes",
"a",
"pool",
"and",
"all",
"the",
"data",
"inside",
"the",
"pool",
"."
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L268-L281 |
28,614 | ceph/go-ceph | rados/conn.go | MonCommand | func (c *Conn) MonCommand(args []byte) (buffer []byte, info string, err error) {
return c.monCommand(args, nil)
} | go | func (c *Conn) MonCommand(args []byte) (buffer []byte, info string, err error) {
return c.monCommand(args, nil)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"MonCommand",
"(",
"args",
"[",
"]",
"byte",
")",
"(",
"buffer",
"[",
"]",
"byte",
",",
"info",
"string",
",",
"err",
"error",
")",
"{",
"return",
"c",
".",
"monCommand",
"(",
"args",
",",
"nil",
")",
"\n",
"... | // MonCommand sends a command to one of the monitors | [
"MonCommand",
"sends",
"a",
"command",
"to",
"one",
"of",
"the",
"monitors"
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L284-L286 |
28,615 | ceph/go-ceph | rados/conn.go | MonCommandWithInputBuffer | func (c *Conn) MonCommandWithInputBuffer(args, inputBuffer []byte) (buffer []byte, info string, err error) {
return c.monCommand(args, inputBuffer)
} | go | func (c *Conn) MonCommandWithInputBuffer(args, inputBuffer []byte) (buffer []byte, info string, err error) {
return c.monCommand(args, inputBuffer)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"MonCommandWithInputBuffer",
"(",
"args",
",",
"inputBuffer",
"[",
"]",
"byte",
")",
"(",
"buffer",
"[",
"]",
"byte",
",",
"info",
"string",
",",
"err",
"error",
")",
"{",
"return",
"c",
".",
"monCommand",
"(",
"ar... | // MonCommand sends a command to one of the monitors, with an input buffer | [
"MonCommand",
"sends",
"a",
"command",
"to",
"one",
"of",
"the",
"monitors",
"with",
"an",
"input",
"buffer"
] | e32f9f0f2e941422937c0a6c4f0a61b8f0c82995 | https://github.com/ceph/go-ceph/blob/e32f9f0f2e941422937c0a6c4f0a61b8f0c82995/rados/conn.go#L289-L291 |
28,616 | Microsoft/go-winio | hvsock.go | VsockServiceID | func VsockServiceID(port uint32) guid.GUID {
g, _ := guid.FromString("00000000-facb-11e6-bd58-64006a7986d3")
g.Data1 = port
return *g
} | go | func VsockServiceID(port uint32) guid.GUID {
g, _ := guid.FromString("00000000-facb-11e6-bd58-64006a7986d3")
g.Data1 = port
return *g
} | [
"func",
"VsockServiceID",
"(",
"port",
"uint32",
")",
"guid",
".",
"GUID",
"{",
"g",
",",
"_",
":=",
"guid",
".",
"FromString",
"(",
"\"",
"\"",
")",
"\n",
"g",
".",
"Data1",
"=",
"port",
"\n",
"return",
"*",
"g",
"\n",
"}"
] | // VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port. | [
"VsockServiceID",
"returns",
"an",
"hvsock",
"service",
"ID",
"corresponding",
"to",
"the",
"specified",
"AF_VSOCK",
"port",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/hvsock.go#L46-L50 |
28,617 | Microsoft/go-winio | hvsock.go | ListenHvsock | func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) {
l := &HvsockListener{addr: *addr}
sock, err := newHvSocket()
if err != nil {
return nil, l.opErr("listen", err)
}
sa := addr.raw()
err = bind(sock.handle, unsafe.Pointer(&sa), int32(unsafe.Sizeof(sa)))
if err != nil {
return nil, l.opErr("l... | go | func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) {
l := &HvsockListener{addr: *addr}
sock, err := newHvSocket()
if err != nil {
return nil, l.opErr("listen", err)
}
sa := addr.raw()
err = bind(sock.handle, unsafe.Pointer(&sa), int32(unsafe.Sizeof(sa)))
if err != nil {
return nil, l.opErr("l... | [
"func",
"ListenHvsock",
"(",
"addr",
"*",
"HvsockAddr",
")",
"(",
"_",
"*",
"HvsockListener",
",",
"err",
"error",
")",
"{",
"l",
":=",
"&",
"HvsockListener",
"{",
"addr",
":",
"*",
"addr",
"}",
"\n",
"sock",
",",
"err",
":=",
"newHvSocket",
"(",
")"... | // ListenHvsock listens for connections on the specified hvsock address. | [
"ListenHvsock",
"listens",
"for",
"connections",
"on",
"the",
"specified",
"hvsock",
"address",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/hvsock.go#L92-L108 |
28,618 | Microsoft/go-winio | hvsock.go | Accept | func (l *HvsockListener) Accept() (_ net.Conn, err error) {
sock, err := newHvSocket()
if err != nil {
return nil, l.opErr("accept", err)
}
defer func() {
if sock != nil {
sock.Close()
}
}()
c, err := l.sock.prepareIo()
if err != nil {
return nil, l.opErr("accept", err)
}
defer l.sock.wg.Done()
//... | go | func (l *HvsockListener) Accept() (_ net.Conn, err error) {
sock, err := newHvSocket()
if err != nil {
return nil, l.opErr("accept", err)
}
defer func() {
if sock != nil {
sock.Close()
}
}()
c, err := l.sock.prepareIo()
if err != nil {
return nil, l.opErr("accept", err)
}
defer l.sock.wg.Done()
//... | [
"func",
"(",
"l",
"*",
"HvsockListener",
")",
"Accept",
"(",
")",
"(",
"_",
"net",
".",
"Conn",
",",
"err",
"error",
")",
"{",
"sock",
",",
"err",
":=",
"newHvSocket",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"l",
".... | // Accept waits for the next connection and returns it. | [
"Accept",
"waits",
"for",
"the",
"next",
"connection",
"and",
"returns",
"it",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/hvsock.go#L120-L153 |
28,619 | Microsoft/go-winio | hvsock.go | CloseRead | func (conn *HvsockConn) CloseRead() error {
err := conn.shutdown(syscall.SHUT_RD)
if err != nil {
return conn.opErr("close", err)
}
return nil
} | go | func (conn *HvsockConn) CloseRead() error {
err := conn.shutdown(syscall.SHUT_RD)
if err != nil {
return conn.opErr("close", err)
}
return nil
} | [
"func",
"(",
"conn",
"*",
"HvsockConn",
")",
"CloseRead",
"(",
")",
"error",
"{",
"err",
":=",
"conn",
".",
"shutdown",
"(",
"syscall",
".",
"SHUT_RD",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"conn",
".",
"opErr",
"(",
"\"",
"\"",
",",
... | // CloseRead shuts down the read end of the socket. | [
"CloseRead",
"shuts",
"down",
"the",
"read",
"end",
"of",
"the",
"socket",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/hvsock.go#L262-L268 |
28,620 | Microsoft/go-winio | hvsock.go | CloseWrite | func (conn *HvsockConn) CloseWrite() error {
err := conn.shutdown(syscall.SHUT_WR)
if err != nil {
return conn.opErr("close", err)
}
return nil
} | go | func (conn *HvsockConn) CloseWrite() error {
err := conn.shutdown(syscall.SHUT_WR)
if err != nil {
return conn.opErr("close", err)
}
return nil
} | [
"func",
"(",
"conn",
"*",
"HvsockConn",
")",
"CloseWrite",
"(",
")",
"error",
"{",
"err",
":=",
"conn",
".",
"shutdown",
"(",
"syscall",
".",
"SHUT_WR",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"conn",
".",
"opErr",
"(",
"\"",
"\"",
",",... | // CloseWrite shuts down the write end of the socket, notifying the other endpoint that
// no more data will be written. | [
"CloseWrite",
"shuts",
"down",
"the",
"write",
"end",
"of",
"the",
"socket",
"notifying",
"the",
"other",
"endpoint",
"that",
"no",
"more",
"data",
"will",
"be",
"written",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/hvsock.go#L272-L278 |
28,621 | Microsoft/go-winio | ea.go | DecodeExtendedAttributes | func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) {
for len(b) != 0 {
ea, nb, err := parseEa(b)
if err != nil {
return nil, err
}
eas = append(eas, ea)
b = nb
}
return
} | go | func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) {
for len(b) != 0 {
ea, nb, err := parseEa(b)
if err != nil {
return nil, err
}
eas = append(eas, ea)
b = nb
}
return
} | [
"func",
"DecodeExtendedAttributes",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"eas",
"[",
"]",
"ExtendedAttribute",
",",
"err",
"error",
")",
"{",
"for",
"len",
"(",
"b",
")",
"!=",
"0",
"{",
"ea",
",",
"nb",
",",
"err",
":=",
"parseEa",
"(",
"b",
")... | // DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION
// buffer retrieved from BackupRead, ZwQueryEaFile, etc. | [
"DecodeExtendedAttributes",
"decodes",
"a",
"list",
"of",
"EAs",
"from",
"a",
"FILE_FULL_EA_INFORMATION",
"buffer",
"retrieved",
"from",
"BackupRead",
"ZwQueryEaFile",
"etc",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/ea.go#L60-L71 |
28,622 | Microsoft/go-winio | ea.go | EncodeExtendedAttributes | func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) {
var buf bytes.Buffer
for i := range eas {
last := false
if i == len(eas)-1 {
last = true
}
err := writeEa(&buf, &eas[i], last)
if err != nil {
return nil, err
}
}
return buf.Bytes(), nil
} | go | func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) {
var buf bytes.Buffer
for i := range eas {
last := false
if i == len(eas)-1 {
last = true
}
err := writeEa(&buf, &eas[i], last)
if err != nil {
return nil, err
}
}
return buf.Bytes(), nil
} | [
"func",
"EncodeExtendedAttributes",
"(",
"eas",
"[",
"]",
"ExtendedAttribute",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"for",
"i",
":=",
"range",
"eas",
"{",
"last",
":=",
"false",
"\n",
"if",
"... | // EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION
// buffer for use with BackupWrite, ZwSetEaFile, etc. | [
"EncodeExtendedAttributes",
"encodes",
"a",
"list",
"of",
"EAs",
"into",
"a",
"FILE_FULL_EA_INFORMATION",
"buffer",
"for",
"use",
"with",
"BackupWrite",
"ZwSetEaFile",
"etc",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/ea.go#L123-L137 |
28,623 | Microsoft/go-winio | reparse.go | DecodeReparsePoint | func DecodeReparsePoint(b []byte) (*ReparsePoint, error) {
tag := binary.LittleEndian.Uint32(b[0:4])
return DecodeReparsePointData(tag, b[8:])
} | go | func DecodeReparsePoint(b []byte) (*ReparsePoint, error) {
tag := binary.LittleEndian.Uint32(b[0:4])
return DecodeReparsePointData(tag, b[8:])
} | [
"func",
"DecodeReparsePoint",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"*",
"ReparsePoint",
",",
"error",
")",
"{",
"tag",
":=",
"binary",
".",
"LittleEndian",
".",
"Uint32",
"(",
"b",
"[",
"0",
":",
"4",
"]",
")",
"\n",
"return",
"DecodeReparsePointData"... | // DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink
// or a mount point. | [
"DecodeReparsePoint",
"decodes",
"a",
"Win32",
"REPARSE_DATA_BUFFER",
"structure",
"containing",
"either",
"a",
"symlink",
"or",
"a",
"mount",
"point",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/reparse.go#L45-L48 |
28,624 | Microsoft/go-winio | reparse.go | EncodeReparsePoint | func EncodeReparsePoint(rp *ReparsePoint) []byte {
// Generate an NT path and determine if this is a relative path.
var ntTarget string
relative := false
if strings.HasPrefix(rp.Target, `\\?\`) {
ntTarget = `\??\` + rp.Target[4:]
} else if strings.HasPrefix(rp.Target, `\\`) {
ntTarget = `\??\UNC\` + rp.Target[... | go | func EncodeReparsePoint(rp *ReparsePoint) []byte {
// Generate an NT path and determine if this is a relative path.
var ntTarget string
relative := false
if strings.HasPrefix(rp.Target, `\\?\`) {
ntTarget = `\??\` + rp.Target[4:]
} else if strings.HasPrefix(rp.Target, `\\`) {
ntTarget = `\??\UNC\` + rp.Target[... | [
"func",
"EncodeReparsePoint",
"(",
"rp",
"*",
"ReparsePoint",
")",
"[",
"]",
"byte",
"{",
"// Generate an NT path and determine if this is a relative path.",
"var",
"ntTarget",
"string",
"\n",
"relative",
":=",
"false",
"\n",
"if",
"strings",
".",
"HasPrefix",
"(",
... | // EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or
// mount point. | [
"EncodeReparsePoint",
"encodes",
"a",
"Win32",
"REPARSE_DATA_BUFFER",
"structure",
"describing",
"a",
"symlink",
"or",
"mount",
"point",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/reparse.go#L78-L128 |
28,625 | Microsoft/go-winio | pkg/etw/fieldopt.go | BoolField | func BoolField(name string, value bool) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint8, outTypeBoolean, 0)
bool8 := uint8(0)
if value {
bool8 = uint8(1)
}
ed.writeUint8(bool8)
}
} | go | func BoolField(name string, value bool) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint8, outTypeBoolean, 0)
bool8 := uint8(0)
if value {
bool8 = uint8(1)
}
ed.writeUint8(bool8)
}
} | [
"func",
"BoolField",
"(",
"name",
"string",
",",
"value",
"bool",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeUint8",
",",
"outTypeBoole... | // BoolField adds a single bool field to the event. | [
"BoolField",
"adds",
"a",
"single",
"bool",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L20-L29 |
28,626 | Microsoft/go-winio | pkg/etw/fieldopt.go | BoolArray | func BoolArray(name string, values []bool) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint8, outTypeBoolean, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
bool8 := uint8(0)
if v {
bool8 = uint8(1)
}
ed.writeUint8(bool8)
}
}
} | go | func BoolArray(name string, values []bool) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint8, outTypeBoolean, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
bool8 := uint8(0)
if v {
bool8 = uint8(1)
}
ed.writeUint8(bool8)
}
}
} | [
"func",
"BoolArray",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"bool",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeUint8",
",",
... | // BoolArray adds an array of bool to the event. | [
"BoolArray",
"adds",
"an",
"array",
"of",
"bool",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L32-L44 |
28,627 | Microsoft/go-winio | pkg/etw/fieldopt.go | StringField | func StringField(name string, value string) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeANSIString, outTypeUTF8, 0)
ed.writeString(value)
}
} | go | func StringField(name string, value string) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeANSIString, outTypeUTF8, 0)
ed.writeString(value)
}
} | [
"func",
"StringField",
"(",
"name",
"string",
",",
"value",
"string",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeANSIString",
",",
"out... | // StringField adds a single string field to the event. | [
"StringField",
"adds",
"a",
"single",
"string",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L47-L52 |
28,628 | Microsoft/go-winio | pkg/etw/fieldopt.go | StringArray | func StringArray(name string, values []string) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeANSIString, outTypeUTF8, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeString(v)
}
}
} | go | func StringArray(name string, values []string) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeANSIString, outTypeUTF8, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeString(v)
}
}
} | [
"func",
"StringArray",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"string",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeANSIString"... | // StringArray adds an array of string to the event. | [
"StringArray",
"adds",
"an",
"array",
"of",
"string",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L55-L63 |
28,629 | Microsoft/go-winio | pkg/etw/fieldopt.go | IntField | func IntField(name string, value int) FieldOpt {
switch unsafe.Sizeof(value) {
case 4:
return Int32Field(name, int32(value))
case 8:
return Int64Field(name, int64(value))
default:
panic("Unsupported int size")
}
} | go | func IntField(name string, value int) FieldOpt {
switch unsafe.Sizeof(value) {
case 4:
return Int32Field(name, int32(value))
case 8:
return Int64Field(name, int64(value))
default:
panic("Unsupported int size")
}
} | [
"func",
"IntField",
"(",
"name",
"string",
",",
"value",
"int",
")",
"FieldOpt",
"{",
"switch",
"unsafe",
".",
"Sizeof",
"(",
"value",
")",
"{",
"case",
"4",
":",
"return",
"Int32Field",
"(",
"name",
",",
"int32",
"(",
"value",
")",
")",
"\n",
"case"... | // IntField adds a single int field to the event. | [
"IntField",
"adds",
"a",
"single",
"int",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L66-L75 |
28,630 | Microsoft/go-winio | pkg/etw/fieldopt.go | IntArray | func IntArray(name string, values []int) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, int)
switch unsafe.Sizeof(values[0]) {
case 4:
inType = inTypeInt32
writeItem = func(ed *eventData, item int) { ed.writeInt32(int32(item)) }
case 8:
inType = inTypeInt64
writeItem = func(ed *eventData, i... | go | func IntArray(name string, values []int) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, int)
switch unsafe.Sizeof(values[0]) {
case 4:
inType = inTypeInt32
writeItem = func(ed *eventData, item int) { ed.writeInt32(int32(item)) }
case 8:
inType = inTypeInt64
writeItem = func(ed *eventData, i... | [
"func",
"IntArray",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"int",
")",
"FieldOpt",
"{",
"inType",
":=",
"inTypeNull",
"\n",
"var",
"writeItem",
"func",
"(",
"*",
"eventData",
",",
"int",
")",
"\n",
"switch",
"unsafe",
".",
"Sizeof",
"(",
"valu... | // IntArray adds an array of int to the event. | [
"IntArray",
"adds",
"an",
"array",
"of",
"int",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L78-L99 |
28,631 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int8Field | func Int8Field(name string, value int8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt8, outTypeDefault, 0)
ed.writeInt8(value)
}
} | go | func Int8Field(name string, value int8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt8, outTypeDefault, 0)
ed.writeInt8(value)
}
} | [
"func",
"Int8Field",
"(",
"name",
"string",
",",
"value",
"int8",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeInt8",
",",
"outTypeDefaul... | // Int8Field adds a single int8 field to the event. | [
"Int8Field",
"adds",
"a",
"single",
"int8",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L102-L107 |
28,632 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int8Array | func Int8Array(name string, values []int8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt8, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt8(v)
}
}
} | go | func Int8Array(name string, values []int8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt8, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt8(v)
}
}
} | [
"func",
"Int8Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"int8",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeInt8",
",",
... | // Int8Array adds an array of int8 to the event. | [
"Int8Array",
"adds",
"an",
"array",
"of",
"int8",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L110-L118 |
28,633 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int16Field | func Int16Field(name string, value int16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt16, outTypeDefault, 0)
ed.writeInt16(value)
}
} | go | func Int16Field(name string, value int16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt16, outTypeDefault, 0)
ed.writeInt16(value)
}
} | [
"func",
"Int16Field",
"(",
"name",
"string",
",",
"value",
"int16",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeInt16",
",",
"outTypeDef... | // Int16Field adds a single int16 field to the event. | [
"Int16Field",
"adds",
"a",
"single",
"int16",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L121-L126 |
28,634 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int16Array | func Int16Array(name string, values []int16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt16, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt16(v)
}
}
} | go | func Int16Array(name string, values []int16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt16, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt16(v)
}
}
} | [
"func",
"Int16Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"int16",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeInt16",
","... | // Int16Array adds an array of int16 to the event. | [
"Int16Array",
"adds",
"an",
"array",
"of",
"int16",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L129-L137 |
28,635 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int32Field | func Int32Field(name string, value int32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt32, outTypeDefault, 0)
ed.writeInt32(value)
}
} | go | func Int32Field(name string, value int32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt32, outTypeDefault, 0)
ed.writeInt32(value)
}
} | [
"func",
"Int32Field",
"(",
"name",
"string",
",",
"value",
"int32",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeInt32",
",",
"outTypeDef... | // Int32Field adds a single int32 field to the event. | [
"Int32Field",
"adds",
"a",
"single",
"int32",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L140-L145 |
28,636 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int32Array | func Int32Array(name string, values []int32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt32, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt32(v)
}
}
} | go | func Int32Array(name string, values []int32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt32, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt32(v)
}
}
} | [
"func",
"Int32Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"int32",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeInt32",
","... | // Int32Array adds an array of int32 to the event. | [
"Int32Array",
"adds",
"an",
"array",
"of",
"int32",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L148-L156 |
28,637 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int64Field | func Int64Field(name string, value int64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt64, outTypeDefault, 0)
ed.writeInt64(value)
}
} | go | func Int64Field(name string, value int64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeInt64, outTypeDefault, 0)
ed.writeInt64(value)
}
} | [
"func",
"Int64Field",
"(",
"name",
"string",
",",
"value",
"int64",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeInt64",
",",
"outTypeDef... | // Int64Field adds a single int64 field to the event. | [
"Int64Field",
"adds",
"a",
"single",
"int64",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L159-L164 |
28,638 | Microsoft/go-winio | pkg/etw/fieldopt.go | Int64Array | func Int64Array(name string, values []int64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt64, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt64(v)
}
}
} | go | func Int64Array(name string, values []int64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeInt64, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeInt64(v)
}
}
} | [
"func",
"Int64Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"int64",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeInt64",
","... | // Int64Array adds an array of int64 to the event. | [
"Int64Array",
"adds",
"an",
"array",
"of",
"int64",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L167-L175 |
28,639 | Microsoft/go-winio | pkg/etw/fieldopt.go | UintField | func UintField(name string, value uint) FieldOpt {
switch unsafe.Sizeof(value) {
case 4:
return Uint32Field(name, uint32(value))
case 8:
return Uint64Field(name, uint64(value))
default:
panic("Unsupported uint size")
}
} | go | func UintField(name string, value uint) FieldOpt {
switch unsafe.Sizeof(value) {
case 4:
return Uint32Field(name, uint32(value))
case 8:
return Uint64Field(name, uint64(value))
default:
panic("Unsupported uint size")
}
} | [
"func",
"UintField",
"(",
"name",
"string",
",",
"value",
"uint",
")",
"FieldOpt",
"{",
"switch",
"unsafe",
".",
"Sizeof",
"(",
"value",
")",
"{",
"case",
"4",
":",
"return",
"Uint32Field",
"(",
"name",
",",
"uint32",
"(",
"value",
")",
")",
"\n",
"c... | // UintField adds a single uint field to the event. | [
"UintField",
"adds",
"a",
"single",
"uint",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L178-L187 |
28,640 | Microsoft/go-winio | pkg/etw/fieldopt.go | UintArray | func UintArray(name string, values []uint) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, uint)
switch unsafe.Sizeof(values[0]) {
case 4:
inType = inTypeUint32
writeItem = func(ed *eventData, item uint) { ed.writeUint32(uint32(item)) }
case 8:
inType = inTypeUint64
writeItem = func(ed *even... | go | func UintArray(name string, values []uint) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, uint)
switch unsafe.Sizeof(values[0]) {
case 4:
inType = inTypeUint32
writeItem = func(ed *eventData, item uint) { ed.writeUint32(uint32(item)) }
case 8:
inType = inTypeUint64
writeItem = func(ed *even... | [
"func",
"UintArray",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"uint",
")",
"FieldOpt",
"{",
"inType",
":=",
"inTypeNull",
"\n",
"var",
"writeItem",
"func",
"(",
"*",
"eventData",
",",
"uint",
")",
"\n",
"switch",
"unsafe",
".",
"Sizeof",
"(",
"v... | // UintArray adds an array of uint to the event. | [
"UintArray",
"adds",
"an",
"array",
"of",
"uint",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L190-L211 |
28,641 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint8Field | func Uint8Field(name string, value uint8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint8, outTypeDefault, 0)
ed.writeUint8(value)
}
} | go | func Uint8Field(name string, value uint8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint8, outTypeDefault, 0)
ed.writeUint8(value)
}
} | [
"func",
"Uint8Field",
"(",
"name",
"string",
",",
"value",
"uint8",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeUint8",
",",
"outTypeDef... | // Uint8Field adds a single uint8 field to the event. | [
"Uint8Field",
"adds",
"a",
"single",
"uint8",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L214-L219 |
28,642 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint8Array | func Uint8Array(name string, values []uint8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint8, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint8(v)
}
}
} | go | func Uint8Array(name string, values []uint8) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint8, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint8(v)
}
}
} | [
"func",
"Uint8Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"uint8",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeUint8",
","... | // Uint8Array adds an array of uint8 to the event. | [
"Uint8Array",
"adds",
"an",
"array",
"of",
"uint8",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L222-L230 |
28,643 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint16Field | func Uint16Field(name string, value uint16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint16, outTypeDefault, 0)
ed.writeUint16(value)
}
} | go | func Uint16Field(name string, value uint16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint16, outTypeDefault, 0)
ed.writeUint16(value)
}
} | [
"func",
"Uint16Field",
"(",
"name",
"string",
",",
"value",
"uint16",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeUint16",
",",
"outType... | // Uint16Field adds a single uint16 field to the event. | [
"Uint16Field",
"adds",
"a",
"single",
"uint16",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L233-L238 |
28,644 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint16Array | func Uint16Array(name string, values []uint16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint16, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint16(v)
}
}
} | go | func Uint16Array(name string, values []uint16) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint16, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint16(v)
}
}
} | [
"func",
"Uint16Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"uint16",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeUint16",
... | // Uint16Array adds an array of uint16 to the event. | [
"Uint16Array",
"adds",
"an",
"array",
"of",
"uint16",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L241-L249 |
28,645 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint32Field | func Uint32Field(name string, value uint32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint32, outTypeDefault, 0)
ed.writeUint32(value)
}
} | go | func Uint32Field(name string, value uint32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint32, outTypeDefault, 0)
ed.writeUint32(value)
}
} | [
"func",
"Uint32Field",
"(",
"name",
"string",
",",
"value",
"uint32",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeUint32",
",",
"outType... | // Uint32Field adds a single uint32 field to the event. | [
"Uint32Field",
"adds",
"a",
"single",
"uint32",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L252-L257 |
28,646 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint32Array | func Uint32Array(name string, values []uint32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint32, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint32(v)
}
}
} | go | func Uint32Array(name string, values []uint32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint32, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint32(v)
}
}
} | [
"func",
"Uint32Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"uint32",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeUint32",
... | // Uint32Array adds an array of uint32 to the event. | [
"Uint32Array",
"adds",
"an",
"array",
"of",
"uint32",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L260-L268 |
28,647 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint64Field | func Uint64Field(name string, value uint64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint64, outTypeDefault, 0)
ed.writeUint64(value)
}
} | go | func Uint64Field(name string, value uint64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeUint64, outTypeDefault, 0)
ed.writeUint64(value)
}
} | [
"func",
"Uint64Field",
"(",
"name",
"string",
",",
"value",
"uint64",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeUint64",
",",
"outType... | // Uint64Field adds a single uint64 field to the event. | [
"Uint64Field",
"adds",
"a",
"single",
"uint64",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L271-L276 |
28,648 | Microsoft/go-winio | pkg/etw/fieldopt.go | Uint64Array | func Uint64Array(name string, values []uint64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint64, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint64(v)
}
}
} | go | func Uint64Array(name string, values []uint64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeUint64, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint64(v)
}
}
} | [
"func",
"Uint64Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"uint64",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeUint64",
... | // Uint64Array adds an array of uint64 to the event. | [
"Uint64Array",
"adds",
"an",
"array",
"of",
"uint64",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L279-L287 |
28,649 | Microsoft/go-winio | pkg/etw/fieldopt.go | UintptrField | func UintptrField(name string, value uintptr) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, uintptr)
switch unsafe.Sizeof(value) {
case 4:
inType = inTypeHexInt32
writeItem = func(ed *eventData, item uintptr) { ed.writeUint32(uint32(item)) }
case 8:
inType = inTypeHexInt64
writeItem = func... | go | func UintptrField(name string, value uintptr) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, uintptr)
switch unsafe.Sizeof(value) {
case 4:
inType = inTypeHexInt32
writeItem = func(ed *eventData, item uintptr) { ed.writeUint32(uint32(item)) }
case 8:
inType = inTypeHexInt64
writeItem = func... | [
"func",
"UintptrField",
"(",
"name",
"string",
",",
"value",
"uintptr",
")",
"FieldOpt",
"{",
"inType",
":=",
"inTypeNull",
"\n",
"var",
"writeItem",
"func",
"(",
"*",
"eventData",
",",
"uintptr",
")",
"\n",
"switch",
"unsafe",
".",
"Sizeof",
"(",
"value",... | // UintptrField adds a single uintptr field to the event. | [
"UintptrField",
"adds",
"a",
"single",
"uintptr",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L290-L308 |
28,650 | Microsoft/go-winio | pkg/etw/fieldopt.go | UintptrArray | func UintptrArray(name string, values []uintptr) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, uintptr)
switch unsafe.Sizeof(values[0]) {
case 4:
inType = inTypeHexInt32
writeItem = func(ed *eventData, item uintptr) { ed.writeUint32(uint32(item)) }
case 8:
inType = inTypeHexInt64
writeItem... | go | func UintptrArray(name string, values []uintptr) FieldOpt {
inType := inTypeNull
var writeItem func(*eventData, uintptr)
switch unsafe.Sizeof(values[0]) {
case 4:
inType = inTypeHexInt32
writeItem = func(ed *eventData, item uintptr) { ed.writeUint32(uint32(item)) }
case 8:
inType = inTypeHexInt64
writeItem... | [
"func",
"UintptrArray",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"uintptr",
")",
"FieldOpt",
"{",
"inType",
":=",
"inTypeNull",
"\n",
"var",
"writeItem",
"func",
"(",
"*",
"eventData",
",",
"uintptr",
")",
"\n",
"switch",
"unsafe",
".",
"Sizeof",
... | // UintptrArray adds an array of uintptr to the event. | [
"UintptrArray",
"adds",
"an",
"array",
"of",
"uintptr",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L311-L332 |
28,651 | Microsoft/go-winio | pkg/etw/fieldopt.go | Float32Field | func Float32Field(name string, value float32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeFloat, outTypeDefault, 0)
ed.writeUint32(math.Float32bits(value))
}
} | go | func Float32Field(name string, value float32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeFloat, outTypeDefault, 0)
ed.writeUint32(math.Float32bits(value))
}
} | [
"func",
"Float32Field",
"(",
"name",
"string",
",",
"value",
"float32",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeFloat",
",",
"outTyp... | // Float32Field adds a single float32 field to the event. | [
"Float32Field",
"adds",
"a",
"single",
"float32",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L335-L340 |
28,652 | Microsoft/go-winio | pkg/etw/fieldopt.go | Float32Array | func Float32Array(name string, values []float32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeFloat, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint32(math.Float32bits(v))
}
}
} | go | func Float32Array(name string, values []float32) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeFloat, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint32(math.Float32bits(v))
}
}
} | [
"func",
"Float32Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"float32",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeFloat",
... | // Float32Array adds an array of float32 to the event. | [
"Float32Array",
"adds",
"an",
"array",
"of",
"float32",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L343-L351 |
28,653 | Microsoft/go-winio | pkg/etw/fieldopt.go | Float64Field | func Float64Field(name string, value float64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeDouble, outTypeDefault, 0)
ed.writeUint64(math.Float64bits(value))
}
} | go | func Float64Field(name string, value float64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeField(name, inTypeDouble, outTypeDefault, 0)
ed.writeUint64(math.Float64bits(value))
}
} | [
"func",
"Float64Field",
"(",
"name",
"string",
",",
"value",
"float64",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeField",
"(",
"name",
",",
"inTypeDouble",
",",
"outTy... | // Float64Field adds a single float64 field to the event. | [
"Float64Field",
"adds",
"a",
"single",
"float64",
"field",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L354-L359 |
28,654 | Microsoft/go-winio | pkg/etw/fieldopt.go | Float64Array | func Float64Array(name string, values []float64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeDouble, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint64(math.Float64bits(v))
}
}
} | go | func Float64Array(name string, values []float64) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeArray(name, inTypeDouble, outTypeDefault, 0)
ed.writeUint16(uint16(len(values)))
for _, v := range values {
ed.writeUint64(math.Float64bits(v))
}
}
} | [
"func",
"Float64Array",
"(",
"name",
"string",
",",
"values",
"[",
"]",
"float64",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeArray",
"(",
"name",
",",
"inTypeDouble",
... | // Float64Array adds an array of float64 to the event. | [
"Float64Array",
"adds",
"an",
"array",
"of",
"float64",
"to",
"the",
"event",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L362-L370 |
28,655 | Microsoft/go-winio | pkg/etw/fieldopt.go | Struct | func Struct(name string, opts ...FieldOpt) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeStruct(name, uint8(len(opts)), 0)
for _, opt := range opts {
opt(em, ed)
}
}
} | go | func Struct(name string, opts ...FieldOpt) FieldOpt {
return func(em *eventMetadata, ed *eventData) {
em.writeStruct(name, uint8(len(opts)), 0)
for _, opt := range opts {
opt(em, ed)
}
}
} | [
"func",
"Struct",
"(",
"name",
"string",
",",
"opts",
"...",
"FieldOpt",
")",
"FieldOpt",
"{",
"return",
"func",
"(",
"em",
"*",
"eventMetadata",
",",
"ed",
"*",
"eventData",
")",
"{",
"em",
".",
"writeStruct",
"(",
"name",
",",
"uint8",
"(",
"len",
... | // Struct adds a nested struct to the event, the FieldOpts in the opts argument
// are used to specify the fields of the struct. | [
"Struct",
"adds",
"a",
"nested",
"struct",
"to",
"the",
"event",
"the",
"FieldOpts",
"in",
"the",
"opts",
"argument",
"are",
"used",
"to",
"specify",
"the",
"fields",
"of",
"the",
"struct",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/fieldopt.go#L374-L381 |
28,656 | Microsoft/go-winio | backuptar/tar.go | BasicInfoHeader | func BasicInfoHeader(name string, size int64, fileInfo *winio.FileBasicInfo) *tar.Header {
hdr := &tar.Header{
Name: filepath.ToSlash(name),
Size: size,
Typeflag: tar.TypeReg,
ModTime: time.Unix(0, fileInfo.LastWriteTime.Nanoseconds()),
ChangeTime: time.Unix(0, fileInfo.ChangeTime.... | go | func BasicInfoHeader(name string, size int64, fileInfo *winio.FileBasicInfo) *tar.Header {
hdr := &tar.Header{
Name: filepath.ToSlash(name),
Size: size,
Typeflag: tar.TypeReg,
ModTime: time.Unix(0, fileInfo.LastWriteTime.Nanoseconds()),
ChangeTime: time.Unix(0, fileInfo.ChangeTime.... | [
"func",
"BasicInfoHeader",
"(",
"name",
"string",
",",
"size",
"int64",
",",
"fileInfo",
"*",
"winio",
".",
"FileBasicInfo",
")",
"*",
"tar",
".",
"Header",
"{",
"hdr",
":=",
"&",
"tar",
".",
"Header",
"{",
"Name",
":",
"filepath",
".",
"ToSlash",
"(",... | // BasicInfoHeader creates a tar header from basic file information. | [
"BasicInfoHeader",
"creates",
"a",
"tar",
"header",
"from",
"basic",
"file",
"information",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/backuptar/tar.go#L87-L106 |
28,657 | Microsoft/go-winio | pipe.go | CloseWrite | func (f *win32MessageBytePipe) CloseWrite() error {
if f.writeClosed {
return errPipeWriteClosed
}
err := f.win32File.Flush()
if err != nil {
return err
}
_, err = f.win32File.Write(nil)
if err != nil {
return err
}
f.writeClosed = true
return nil
} | go | func (f *win32MessageBytePipe) CloseWrite() error {
if f.writeClosed {
return errPipeWriteClosed
}
err := f.win32File.Flush()
if err != nil {
return err
}
_, err = f.win32File.Write(nil)
if err != nil {
return err
}
f.writeClosed = true
return nil
} | [
"func",
"(",
"f",
"*",
"win32MessageBytePipe",
")",
"CloseWrite",
"(",
")",
"error",
"{",
"if",
"f",
".",
"writeClosed",
"{",
"return",
"errPipeWriteClosed",
"\n",
"}",
"\n",
"err",
":=",
"f",
".",
"win32File",
".",
"Flush",
"(",
")",
"\n",
"if",
"err"... | // CloseWrite closes the write side of a message pipe in byte mode. | [
"CloseWrite",
"closes",
"the",
"write",
"side",
"of",
"a",
"message",
"pipe",
"in",
"byte",
"mode",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pipe.go#L125-L139 |
28,658 | Microsoft/go-winio | pipe.go | Read | func (f *win32MessageBytePipe) Read(b []byte) (int, error) {
if f.readEOF {
return 0, io.EOF
}
n, err := f.win32File.Read(b)
if err == io.EOF {
// If this was the result of a zero-byte read, then
// it is possible that the read was due to a zero-size
// message. Since we are simulating CloseWrite with a
/... | go | func (f *win32MessageBytePipe) Read(b []byte) (int, error) {
if f.readEOF {
return 0, io.EOF
}
n, err := f.win32File.Read(b)
if err == io.EOF {
// If this was the result of a zero-byte read, then
// it is possible that the read was due to a zero-size
// message. Since we are simulating CloseWrite with a
/... | [
"func",
"(",
"f",
"*",
"win32MessageBytePipe",
")",
"Read",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"if",
"f",
".",
"readEOF",
"{",
"return",
"0",
",",
"io",
".",
"EOF",
"\n",
"}",
"\n",
"n",
",",
"err",
":=",
"f"... | // Read reads bytes from a message pipe in byte mode. A read of a zero-byte message on a message
// mode pipe will return io.EOF, as will all subsequent reads. | [
"Read",
"reads",
"bytes",
"from",
"a",
"message",
"pipe",
"in",
"byte",
"mode",
".",
"A",
"read",
"of",
"a",
"zero",
"-",
"byte",
"message",
"on",
"a",
"message",
"mode",
"pipe",
"will",
"return",
"io",
".",
"EOF",
"as",
"will",
"all",
"subsequent",
... | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pipe.go#L155-L174 |
28,659 | Microsoft/go-winio | pipe.go | tryDialPipe | func tryDialPipe(ctx context.Context, path *string) (syscall.Handle, error) {
for {
select {
case <-ctx.Done():
return syscall.Handle(0), ctx.Err()
default:
h, err := createFile(*path, syscall.GENERIC_READ|syscall.GENERIC_WRITE, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_OVERLAPPED|cSECURITY_SQOS_PRE... | go | func tryDialPipe(ctx context.Context, path *string) (syscall.Handle, error) {
for {
select {
case <-ctx.Done():
return syscall.Handle(0), ctx.Err()
default:
h, err := createFile(*path, syscall.GENERIC_READ|syscall.GENERIC_WRITE, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_OVERLAPPED|cSECURITY_SQOS_PRE... | [
"func",
"tryDialPipe",
"(",
"ctx",
"context",
".",
"Context",
",",
"path",
"*",
"string",
")",
"(",
"syscall",
".",
"Handle",
",",
"error",
")",
"{",
"for",
"{",
"select",
"{",
"case",
"<-",
"ctx",
".",
"Done",
"(",
")",
":",
"return",
"syscall",
"... | // tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. | [
"tryDialPipe",
"attempts",
"to",
"dial",
"the",
"pipe",
"at",
"path",
"until",
"ctx",
"cancellation",
"or",
"timeout",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pipe.go#L185-L203 |
28,660 | Microsoft/go-winio | pipe.go | DialPipeContext | func DialPipeContext(ctx context.Context, path string) (net.Conn, error) {
var err error
var h syscall.Handle
h, err = tryDialPipe(ctx, &path)
if err != nil {
return nil, err
}
var flags uint32
err = getNamedPipeInfo(h, &flags, nil, nil, nil)
if err != nil {
return nil, err
}
f, err := makeWin32File(h)
... | go | func DialPipeContext(ctx context.Context, path string) (net.Conn, error) {
var err error
var h syscall.Handle
h, err = tryDialPipe(ctx, &path)
if err != nil {
return nil, err
}
var flags uint32
err = getNamedPipeInfo(h, &flags, nil, nil, nil)
if err != nil {
return nil, err
}
f, err := makeWin32File(h)
... | [
"func",
"DialPipeContext",
"(",
"ctx",
"context",
".",
"Context",
",",
"path",
"string",
")",
"(",
"net",
".",
"Conn",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"var",
"h",
"syscall",
".",
"Handle",
"\n",
"h",
",",
"err",
"=",
"tryDialPipe... | // DialPipeContext attempts to connect to a named pipe by `path` until `ctx`
// cancellation or timeout. | [
"DialPipeContext",
"attempts",
"to",
"connect",
"to",
"a",
"named",
"pipe",
"by",
"path",
"until",
"ctx",
"cancellation",
"or",
"timeout",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pipe.go#L225-L253 |
28,661 | Microsoft/go-winio | backup.go | Read | func (r *BackupStreamReader) Read(b []byte) (int, error) {
if r.bytesLeft == 0 {
return 0, io.EOF
}
if int64(len(b)) > r.bytesLeft {
b = b[:r.bytesLeft]
}
n, err := r.r.Read(b)
r.bytesLeft -= int64(n)
if err == io.EOF {
err = io.ErrUnexpectedEOF
} else if r.bytesLeft == 0 && err == nil {
err = io.EOF
}... | go | func (r *BackupStreamReader) Read(b []byte) (int, error) {
if r.bytesLeft == 0 {
return 0, io.EOF
}
if int64(len(b)) > r.bytesLeft {
b = b[:r.bytesLeft]
}
n, err := r.r.Read(b)
r.bytesLeft -= int64(n)
if err == io.EOF {
err = io.ErrUnexpectedEOF
} else if r.bytesLeft == 0 && err == nil {
err = io.EOF
}... | [
"func",
"(",
"r",
"*",
"BackupStreamReader",
")",
"Read",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"if",
"r",
".",
"bytesLeft",
"==",
"0",
"{",
"return",
"0",
",",
"io",
".",
"EOF",
"\n",
"}",
"\n",
"if",
"int64",
... | // Read reads from the current backup stream. | [
"Read",
"reads",
"from",
"the",
"current",
"backup",
"stream",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/backup.go#L116-L131 |
28,662 | Microsoft/go-winio | backup.go | Write | func (w *BackupStreamWriter) Write(b []byte) (int, error) {
if w.bytesLeft < int64(len(b)) {
return 0, fmt.Errorf("too many bytes by %d", int64(len(b))-w.bytesLeft)
}
n, err := w.w.Write(b)
w.bytesLeft -= int64(n)
return n, err
} | go | func (w *BackupStreamWriter) Write(b []byte) (int, error) {
if w.bytesLeft < int64(len(b)) {
return 0, fmt.Errorf("too many bytes by %d", int64(len(b))-w.bytesLeft)
}
n, err := w.w.Write(b)
w.bytesLeft -= int64(n)
return n, err
} | [
"func",
"(",
"w",
"*",
"BackupStreamWriter",
")",
"Write",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"if",
"w",
".",
"bytesLeft",
"<",
"int64",
"(",
"len",
"(",
"b",
")",
")",
"{",
"return",
"0",
",",
"fmt",
".",
"E... | // Write writes to the current backup stream. | [
"Write",
"writes",
"to",
"the",
"current",
"backup",
"stream",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/backup.go#L178-L185 |
28,663 | Microsoft/go-winio | backup.go | NewBackupFileReader | func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader {
r := &BackupFileReader{f, includeSecurity, 0}
return r
} | go | func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader {
r := &BackupFileReader{f, includeSecurity, 0}
return r
} | [
"func",
"NewBackupFileReader",
"(",
"f",
"*",
"os",
".",
"File",
",",
"includeSecurity",
"bool",
")",
"*",
"BackupFileReader",
"{",
"r",
":=",
"&",
"BackupFileReader",
"{",
"f",
",",
"includeSecurity",
",",
"0",
"}",
"\n",
"return",
"r",
"\n",
"}"
] | // NewBackupFileReader returns a new BackupFileReader from a file handle. If includeSecurity is true,
// Read will attempt to read the security descriptor of the file. | [
"NewBackupFileReader",
"returns",
"a",
"new",
"BackupFileReader",
"from",
"a",
"file",
"handle",
".",
"If",
"includeSecurity",
"is",
"true",
"Read",
"will",
"attempt",
"to",
"read",
"the",
"security",
"descriptor",
"of",
"the",
"file",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/backup.go#L196-L199 |
28,664 | Microsoft/go-winio | backup.go | Close | func (r *BackupFileReader) Close() error {
if r.ctx != 0 {
backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx)
runtime.KeepAlive(r.f)
r.ctx = 0
}
return nil
} | go | func (r *BackupFileReader) Close() error {
if r.ctx != 0 {
backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx)
runtime.KeepAlive(r.f)
r.ctx = 0
}
return nil
} | [
"func",
"(",
"r",
"*",
"BackupFileReader",
")",
"Close",
"(",
")",
"error",
"{",
"if",
"r",
".",
"ctx",
"!=",
"0",
"{",
"backupRead",
"(",
"syscall",
".",
"Handle",
"(",
"r",
".",
"f",
".",
"Fd",
"(",
")",
")",
",",
"nil",
",",
"nil",
",",
"t... | // Close frees Win32 resources associated with the BackupFileReader. It does not close
// the underlying file. | [
"Close",
"frees",
"Win32",
"resources",
"associated",
"with",
"the",
"BackupFileReader",
".",
"It",
"does",
"not",
"close",
"the",
"underlying",
"file",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/backup.go#L217-L224 |
28,665 | Microsoft/go-winio | backup.go | Write | func (w *BackupFileWriter) Write(b []byte) (int, error) {
var bytesWritten uint32
err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx)
if err != nil {
return 0, &os.PathError{"BackupWrite", w.f.Name(), err}
}
runtime.KeepAlive(w.f)
if int(bytesWritten) != len(b) {
r... | go | func (w *BackupFileWriter) Write(b []byte) (int, error) {
var bytesWritten uint32
err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx)
if err != nil {
return 0, &os.PathError{"BackupWrite", w.f.Name(), err}
}
runtime.KeepAlive(w.f)
if int(bytesWritten) != len(b) {
r... | [
"func",
"(",
"w",
"*",
"BackupFileWriter",
")",
"Write",
"(",
"b",
"[",
"]",
"byte",
")",
"(",
"int",
",",
"error",
")",
"{",
"var",
"bytesWritten",
"uint32",
"\n",
"err",
":=",
"backupWrite",
"(",
"syscall",
".",
"Handle",
"(",
"w",
".",
"f",
".",... | // Write restores a portion of the file using the provided backup stream. | [
"Write",
"restores",
"a",
"portion",
"of",
"the",
"file",
"using",
"the",
"provided",
"backup",
"stream",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/backup.go#L241-L252 |
28,666 | Microsoft/go-winio | backup.go | Close | func (w *BackupFileWriter) Close() error {
if w.ctx != 0 {
backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx)
runtime.KeepAlive(w.f)
w.ctx = 0
}
return nil
} | go | func (w *BackupFileWriter) Close() error {
if w.ctx != 0 {
backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx)
runtime.KeepAlive(w.f)
w.ctx = 0
}
return nil
} | [
"func",
"(",
"w",
"*",
"BackupFileWriter",
")",
"Close",
"(",
")",
"error",
"{",
"if",
"w",
".",
"ctx",
"!=",
"0",
"{",
"backupWrite",
"(",
"syscall",
".",
"Handle",
"(",
"w",
".",
"f",
".",
"Fd",
"(",
")",
")",
",",
"nil",
",",
"nil",
",",
"... | // Close frees Win32 resources associated with the BackupFileWriter. It does not
// close the underlying file. | [
"Close",
"frees",
"Win32",
"resources",
"associated",
"with",
"the",
"BackupFileWriter",
".",
"It",
"does",
"not",
"close",
"the",
"underlying",
"file",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/backup.go#L256-L263 |
28,667 | Microsoft/go-winio | vhd/vhd.go | CreateVhdx | func CreateVhdx(path string, maxSizeInGb, blockSizeInMb uint32) error {
var (
defaultType virtualStorageType
handle syscall.Handle
)
parameters := createVirtualDiskParameters{
Version: 2,
Version2: createVersion2{
MaximumSize: uint64(maxSizeInGb) * 1024 * 1024 * 1024,
BlockSizeInBytes: block... | go | func CreateVhdx(path string, maxSizeInGb, blockSizeInMb uint32) error {
var (
defaultType virtualStorageType
handle syscall.Handle
)
parameters := createVirtualDiskParameters{
Version: 2,
Version2: createVersion2{
MaximumSize: uint64(maxSizeInGb) * 1024 * 1024 * 1024,
BlockSizeInBytes: block... | [
"func",
"CreateVhdx",
"(",
"path",
"string",
",",
"maxSizeInGb",
",",
"blockSizeInMb",
"uint32",
")",
"error",
"{",
"var",
"(",
"defaultType",
"virtualStorageType",
"\n",
"handle",
"syscall",
".",
"Handle",
"\n",
")",
"\n\n",
"parameters",
":=",
"createVirtualDi... | // CreateVhdx will create a simple vhdx file at the given path using default values. | [
"CreateVhdx",
"will",
"create",
"a",
"simple",
"vhdx",
"file",
"at",
"the",
"given",
"path",
"using",
"default",
"values",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/vhd/vhd.go#L86-L118 |
28,668 | Microsoft/go-winio | vhd/vhd.go | DetachVhd | func DetachVhd(path string) error {
handle, err := OpenVirtualDisk(path, VirtualDiskAccessDetach, OpenVirtualDiskFlagNone)
if err != nil {
return err
}
defer syscall.CloseHandle(handle)
return detachVirtualDisk(handle, 0, 0)
} | go | func DetachVhd(path string) error {
handle, err := OpenVirtualDisk(path, VirtualDiskAccessDetach, OpenVirtualDiskFlagNone)
if err != nil {
return err
}
defer syscall.CloseHandle(handle)
return detachVirtualDisk(handle, 0, 0)
} | [
"func",
"DetachVhd",
"(",
"path",
"string",
")",
"error",
"{",
"handle",
",",
"err",
":=",
"OpenVirtualDisk",
"(",
"path",
",",
"VirtualDiskAccessDetach",
",",
"OpenVirtualDiskFlagNone",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
... | // DetachVhd detaches a VHD attached at the given path. | [
"DetachVhd",
"detaches",
"a",
"VHD",
"attached",
"at",
"the",
"given",
"path",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/vhd/vhd.go#L121-L128 |
28,669 | Microsoft/go-winio | vhd/vhd.go | OpenVirtualDisk | func OpenVirtualDisk(path string, accessMask VirtualDiskAccessMask, flag VirtualDiskFlag) (syscall.Handle, error) {
var (
defaultType virtualStorageType
handle syscall.Handle
)
parameters := openVirtualDiskParameters{Version: 2}
if err := openVirtualDisk(
&defaultType,
path,
uint32(accessMask),
uin... | go | func OpenVirtualDisk(path string, accessMask VirtualDiskAccessMask, flag VirtualDiskFlag) (syscall.Handle, error) {
var (
defaultType virtualStorageType
handle syscall.Handle
)
parameters := openVirtualDiskParameters{Version: 2}
if err := openVirtualDisk(
&defaultType,
path,
uint32(accessMask),
uin... | [
"func",
"OpenVirtualDisk",
"(",
"path",
"string",
",",
"accessMask",
"VirtualDiskAccessMask",
",",
"flag",
"VirtualDiskFlag",
")",
"(",
"syscall",
".",
"Handle",
",",
"error",
")",
"{",
"var",
"(",
"defaultType",
"virtualStorageType",
"\n",
"handle",
"syscall",
... | // OpenVirtuaDisk obtains a handle to a VHD opened with supplied access mask and flags. | [
"OpenVirtuaDisk",
"obtains",
"a",
"handle",
"to",
"a",
"VHD",
"opened",
"with",
"supplied",
"access",
"mask",
"and",
"flags",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/vhd/vhd.go#L131-L147 |
28,670 | Microsoft/go-winio | pkg/etwlogrus/hook.go | NewHook | func NewHook(providerName string) (*Hook, error) {
provider, err := etw.NewProvider(providerName, nil)
if err != nil {
return nil, err
}
return &Hook{provider, true}, nil
} | go | func NewHook(providerName string) (*Hook, error) {
provider, err := etw.NewProvider(providerName, nil)
if err != nil {
return nil, err
}
return &Hook{provider, true}, nil
} | [
"func",
"NewHook",
"(",
"providerName",
"string",
")",
"(",
"*",
"Hook",
",",
"error",
")",
"{",
"provider",
",",
"err",
":=",
"etw",
".",
"NewProvider",
"(",
"providerName",
",",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",... | // NewHook registers a new ETW provider and returns a hook to log from it. The
// provider will be closed when the hook is closed. | [
"NewHook",
"registers",
"a",
"new",
"ETW",
"provider",
"and",
"returns",
"a",
"hook",
"to",
"log",
"from",
"it",
".",
"The",
"provider",
"will",
"be",
"closed",
"when",
"the",
"hook",
"is",
"closed",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etwlogrus/hook.go#L16-L23 |
28,671 | Microsoft/go-winio | pkg/etwlogrus/hook.go | NewHookFromProvider | func NewHookFromProvider(provider *etw.Provider) (*Hook, error) {
return &Hook{provider, false}, nil
} | go | func NewHookFromProvider(provider *etw.Provider) (*Hook, error) {
return &Hook{provider, false}, nil
} | [
"func",
"NewHookFromProvider",
"(",
"provider",
"*",
"etw",
".",
"Provider",
")",
"(",
"*",
"Hook",
",",
"error",
")",
"{",
"return",
"&",
"Hook",
"{",
"provider",
",",
"false",
"}",
",",
"nil",
"\n",
"}"
] | // NewHookFromProvider creates a new hook based on an existing ETW provider. The
// provider will not be closed when the hook is closed. | [
"NewHookFromProvider",
"creates",
"a",
"new",
"hook",
"based",
"on",
"an",
"existing",
"ETW",
"provider",
".",
"The",
"provider",
"will",
"not",
"be",
"closed",
"when",
"the",
"hook",
"is",
"closed",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etwlogrus/hook.go#L27-L29 |
28,672 | Microsoft/go-winio | pkg/etwlogrus/hook.go | Levels | func (h *Hook) Levels() []logrus.Level {
return []logrus.Level{
logrus.TraceLevel,
logrus.DebugLevel,
logrus.InfoLevel,
logrus.WarnLevel,
logrus.ErrorLevel,
logrus.FatalLevel,
logrus.PanicLevel,
}
} | go | func (h *Hook) Levels() []logrus.Level {
return []logrus.Level{
logrus.TraceLevel,
logrus.DebugLevel,
logrus.InfoLevel,
logrus.WarnLevel,
logrus.ErrorLevel,
logrus.FatalLevel,
logrus.PanicLevel,
}
} | [
"func",
"(",
"h",
"*",
"Hook",
")",
"Levels",
"(",
")",
"[",
"]",
"logrus",
".",
"Level",
"{",
"return",
"[",
"]",
"logrus",
".",
"Level",
"{",
"logrus",
".",
"TraceLevel",
",",
"logrus",
".",
"DebugLevel",
",",
"logrus",
".",
"InfoLevel",
",",
"lo... | // Levels returns the set of levels that this hook wants to receive log entries
// for. | [
"Levels",
"returns",
"the",
"set",
"of",
"levels",
"that",
"this",
"hook",
"wants",
"to",
"receive",
"log",
"entries",
"for",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etwlogrus/hook.go#L33-L43 |
28,673 | Microsoft/go-winio | pkg/etwlogrus/hook.go | Fire | func (h *Hook) Fire(e *logrus.Entry) error {
// Logrus defines more levels than ETW typically uses, but analysis is
// easiest when using a consistent set of levels across ETW providers, so we
// map the Logrus levels to ETW levels.
level := logrusToETWLevelMap[e.Level]
if !h.provider.IsEnabledForLevel(level) {
... | go | func (h *Hook) Fire(e *logrus.Entry) error {
// Logrus defines more levels than ETW typically uses, but analysis is
// easiest when using a consistent set of levels across ETW providers, so we
// map the Logrus levels to ETW levels.
level := logrusToETWLevelMap[e.Level]
if !h.provider.IsEnabledForLevel(level) {
... | [
"func",
"(",
"h",
"*",
"Hook",
")",
"Fire",
"(",
"e",
"*",
"logrus",
".",
"Entry",
")",
"error",
"{",
"// Logrus defines more levels than ETW typically uses, but analysis is",
"// easiest when using a consistent set of levels across ETW providers, so we",
"// map the Logrus level... | // Fire receives each Logrus entry as it is logged, and logs it to ETW. | [
"Fire",
"receives",
"each",
"Logrus",
"entry",
"as",
"it",
"is",
"logged",
"and",
"logs",
"it",
"to",
"ETW",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etwlogrus/hook.go#L56-L78 |
28,674 | Microsoft/go-winio | pkg/etwlogrus/hook.go | Close | func (h *Hook) Close() error {
if h.closeProvider {
return h.provider.Close()
}
return nil
} | go | func (h *Hook) Close() error {
if h.closeProvider {
return h.provider.Close()
}
return nil
} | [
"func",
"(",
"h",
"*",
"Hook",
")",
"Close",
"(",
")",
"error",
"{",
"if",
"h",
".",
"closeProvider",
"{",
"return",
"h",
".",
"provider",
".",
"Close",
"(",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // Close cleans up the hook and closes the ETW provider. If the provder was
// registered by etwlogrus, it will be closed as part of `Close`. If the
// provider was passed in, it will not be closed. | [
"Close",
"cleans",
"up",
"the",
"hook",
"and",
"closes",
"the",
"ETW",
"provider",
".",
"If",
"the",
"provder",
"was",
"registered",
"by",
"etwlogrus",
"it",
"will",
"be",
"closed",
"as",
"part",
"of",
"Close",
".",
"If",
"the",
"provider",
"was",
"passe... | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etwlogrus/hook.go#L83-L88 |
28,675 | Microsoft/go-winio | privilege.go | RunWithPrivilege | func RunWithPrivilege(name string, fn func() error) error {
return RunWithPrivileges([]string{name}, fn)
} | go | func RunWithPrivilege(name string, fn func() error) error {
return RunWithPrivileges([]string{name}, fn)
} | [
"func",
"RunWithPrivilege",
"(",
"name",
"string",
",",
"fn",
"func",
"(",
")",
"error",
")",
"error",
"{",
"return",
"RunWithPrivileges",
"(",
"[",
"]",
"string",
"{",
"name",
"}",
",",
"fn",
")",
"\n",
"}"
] | // RunWithPrivilege enables a single privilege for a function call. | [
"RunWithPrivilege",
"enables",
"a",
"single",
"privilege",
"for",
"a",
"function",
"call",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/privilege.go#L71-L73 |
28,676 | Microsoft/go-winio | privilege.go | RunWithPrivileges | func RunWithPrivileges(names []string, fn func() error) error {
privileges, err := mapPrivileges(names)
if err != nil {
return err
}
runtime.LockOSThread()
defer runtime.UnlockOSThread()
token, err := newThreadToken()
if err != nil {
return err
}
defer releaseThreadToken(token)
err = adjustPrivileges(toke... | go | func RunWithPrivileges(names []string, fn func() error) error {
privileges, err := mapPrivileges(names)
if err != nil {
return err
}
runtime.LockOSThread()
defer runtime.UnlockOSThread()
token, err := newThreadToken()
if err != nil {
return err
}
defer releaseThreadToken(token)
err = adjustPrivileges(toke... | [
"func",
"RunWithPrivileges",
"(",
"names",
"[",
"]",
"string",
",",
"fn",
"func",
"(",
")",
"error",
")",
"error",
"{",
"privileges",
",",
"err",
":=",
"mapPrivileges",
"(",
"names",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}... | // RunWithPrivileges enables privileges for a function call. | [
"RunWithPrivileges",
"enables",
"privileges",
"for",
"a",
"function",
"call",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/privilege.go#L76-L93 |
28,677 | Microsoft/go-winio | wim/wim.go | Time | func (ft *Filetime) Time() time.Time {
// 100-nanosecond intervals since January 1, 1601
nsec := int64(ft.HighDateTime)<<32 + int64(ft.LowDateTime)
// change starting time to the Epoch (00:00:00 UTC, January 1, 1970)
nsec -= 116444736000000000
// convert into nanoseconds
nsec *= 100
return time.Unix(0, nsec)
} | go | func (ft *Filetime) Time() time.Time {
// 100-nanosecond intervals since January 1, 1601
nsec := int64(ft.HighDateTime)<<32 + int64(ft.LowDateTime)
// change starting time to the Epoch (00:00:00 UTC, January 1, 1970)
nsec -= 116444736000000000
// convert into nanoseconds
nsec *= 100
return time.Unix(0, nsec)
} | [
"func",
"(",
"ft",
"*",
"Filetime",
")",
"Time",
"(",
")",
"time",
".",
"Time",
"{",
"// 100-nanosecond intervals since January 1, 1601",
"nsec",
":=",
"int64",
"(",
"ft",
".",
"HighDateTime",
")",
"<<",
"32",
"+",
"int64",
"(",
"ft",
".",
"LowDateTime",
"... | // Time returns the time as time.Time. | [
"Time",
"returns",
"the",
"time",
"as",
"time",
".",
"Time",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L199-L207 |
28,678 | Microsoft/go-winio | wim/wim.go | UnmarshalXML | func (ft *Filetime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
type time struct {
Low string `xml:"LOWPART"`
High string `xml:"HIGHPART"`
}
var t time
err := d.DecodeElement(&t, &start)
if err != nil {
return err
}
low, err := strconv.ParseUint(t.Low, 0, 32)
if err != nil {
return er... | go | func (ft *Filetime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
type time struct {
Low string `xml:"LOWPART"`
High string `xml:"HIGHPART"`
}
var t time
err := d.DecodeElement(&t, &start)
if err != nil {
return err
}
low, err := strconv.ParseUint(t.Low, 0, 32)
if err != nil {
return er... | [
"func",
"(",
"ft",
"*",
"Filetime",
")",
"UnmarshalXML",
"(",
"d",
"*",
"xml",
".",
"Decoder",
",",
"start",
"xml",
".",
"StartElement",
")",
"error",
"{",
"type",
"time",
"struct",
"{",
"Low",
"string",
"`xml:\"LOWPART\"`",
"\n",
"High",
"string",
"`xml... | // UnmarshalXML unmarshals the time from a WIM XML blob. | [
"UnmarshalXML",
"unmarshals",
"the",
"time",
"from",
"a",
"WIM",
"XML",
"blob",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L210-L233 |
28,679 | Microsoft/go-winio | wim/wim.go | NewReader | func NewReader(f io.ReaderAt) (*Reader, error) {
r := &Reader{r: f}
section := io.NewSectionReader(f, 0, 0xffff)
err := binary.Read(section, binary.LittleEndian, &r.hdr)
if err != nil {
return nil, err
}
if r.hdr.ImageTag != wimImageTag {
return nil, &ParseError{Oper: "image tag", Err: errors.New("not a WIM ... | go | func NewReader(f io.ReaderAt) (*Reader, error) {
r := &Reader{r: f}
section := io.NewSectionReader(f, 0, 0xffff)
err := binary.Read(section, binary.LittleEndian, &r.hdr)
if err != nil {
return nil, err
}
if r.hdr.ImageTag != wimImageTag {
return nil, &ParseError{Oper: "image tag", Err: errors.New("not a WIM ... | [
"func",
"NewReader",
"(",
"f",
"io",
".",
"ReaderAt",
")",
"(",
"*",
"Reader",
",",
"error",
")",
"{",
"r",
":=",
"&",
"Reader",
"{",
"r",
":",
"f",
"}",
"\n",
"section",
":=",
"io",
".",
"NewSectionReader",
"(",
"f",
",",
"0",
",",
"0xffff",
"... | // NewReader returns a Reader that can be used to read WIM file data. | [
"NewReader",
"returns",
"a",
"Reader",
"that",
"can",
"be",
"used",
"to",
"read",
"WIM",
"file",
"data",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L347-L400 |
28,680 | Microsoft/go-winio | wim/wim.go | Close | func (r *Reader) Close() error {
for _, img := range r.Image {
img.reset()
}
return nil
} | go | func (r *Reader) Close() error {
for _, img := range r.Image {
img.reset()
}
return nil
} | [
"func",
"(",
"r",
"*",
"Reader",
")",
"Close",
"(",
")",
"error",
"{",
"for",
"_",
",",
"img",
":=",
"range",
"r",
".",
"Image",
"{",
"img",
".",
"reset",
"(",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
] | // Close releases resources associated with the Reader. | [
"Close",
"releases",
"resources",
"associated",
"with",
"the",
"Reader",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L403-L408 |
28,681 | Microsoft/go-winio | wim/wim.go | Open | func (img *Image) Open() (*File, error) {
if img.sds == nil {
rsrc, err := img.wim.resourceReaderWithOffset(&img.offset, img.rootOffset)
if err != nil {
return nil, err
}
sds, n, err := img.wim.readSecurityDescriptors(rsrc)
if err != nil {
rsrc.Close()
return nil, err
}
img.sds = sds
img.r = r... | go | func (img *Image) Open() (*File, error) {
if img.sds == nil {
rsrc, err := img.wim.resourceReaderWithOffset(&img.offset, img.rootOffset)
if err != nil {
return nil, err
}
sds, n, err := img.wim.readSecurityDescriptors(rsrc)
if err != nil {
rsrc.Close()
return nil, err
}
img.sds = sds
img.r = r... | [
"func",
"(",
"img",
"*",
"Image",
")",
"Open",
"(",
")",
"(",
"*",
"File",
",",
"error",
")",
"{",
"if",
"img",
".",
"sds",
"==",
"nil",
"{",
"rsrc",
",",
"err",
":=",
"img",
".",
"wim",
".",
"resourceReaderWithOffset",
"(",
"&",
"img",
".",
"o... | // Open parses the image and returns the root directory. | [
"Open",
"parses",
"the",
"image",
"and",
"returns",
"the",
"root",
"directory",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L570-L595 |
28,682 | Microsoft/go-winio | wim/wim.go | Open | func (s *Stream) Open() (io.ReadCloser, error) {
return s.wim.resourceReader(&s.offset)
} | go | func (s *Stream) Open() (io.ReadCloser, error) {
return s.wim.resourceReader(&s.offset)
} | [
"func",
"(",
"s",
"*",
"Stream",
")",
"Open",
"(",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"return",
"s",
".",
"wim",
".",
"resourceReader",
"(",
"&",
"s",
".",
"offset",
")",
"\n",
"}"
] | // Open returns an io.ReadCloser that can be used to read the stream's contents. | [
"Open",
"returns",
"an",
"io",
".",
"ReadCloser",
"that",
"can",
"be",
"used",
"to",
"read",
"the",
"stream",
"s",
"contents",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L845-L847 |
28,683 | Microsoft/go-winio | wim/wim.go | Open | func (f *File) Open() (io.ReadCloser, error) {
return f.img.wim.resourceReader(&f.offset)
} | go | func (f *File) Open() (io.ReadCloser, error) {
return f.img.wim.resourceReader(&f.offset)
} | [
"func",
"(",
"f",
"*",
"File",
")",
"Open",
"(",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"return",
"f",
".",
"img",
".",
"wim",
".",
"resourceReader",
"(",
"&",
"f",
".",
"offset",
")",
"\n",
"}"
] | // Open returns an io.ReadCloser that can be used to read the file's contents. | [
"Open",
"returns",
"an",
"io",
".",
"ReadCloser",
"that",
"can",
"be",
"used",
"to",
"read",
"the",
"file",
"s",
"contents",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L850-L852 |
28,684 | Microsoft/go-winio | wim/wim.go | Readdir | func (f *File) Readdir() ([]*File, error) {
if !f.IsDir() {
return nil, errors.New("not a directory")
}
return f.img.readdir(f.subdirOffset)
} | go | func (f *File) Readdir() ([]*File, error) {
if !f.IsDir() {
return nil, errors.New("not a directory")
}
return f.img.readdir(f.subdirOffset)
} | [
"func",
"(",
"f",
"*",
"File",
")",
"Readdir",
"(",
")",
"(",
"[",
"]",
"*",
"File",
",",
"error",
")",
"{",
"if",
"!",
"f",
".",
"IsDir",
"(",
")",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"... | // Readdir reads the directory entries. | [
"Readdir",
"reads",
"the",
"directory",
"entries",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/wim.go#L855-L860 |
28,685 | Microsoft/go-winio | wim/lzx/lzx.go | feed | func (f *decompressor) feed() bool {
err := f.ensureAtLeast(2)
if err != nil {
if err == io.ErrUnexpectedEOF {
return false
}
}
f.c |= (uint32(f.b[f.bo+1])<<8 | uint32(f.b[f.bo])) << (16 - f.nbits)
f.nbits += 16
f.bo += 2
return true
} | go | func (f *decompressor) feed() bool {
err := f.ensureAtLeast(2)
if err != nil {
if err == io.ErrUnexpectedEOF {
return false
}
}
f.c |= (uint32(f.b[f.bo+1])<<8 | uint32(f.b[f.bo])) << (16 - f.nbits)
f.nbits += 16
f.bo += 2
return true
} | [
"func",
"(",
"f",
"*",
"decompressor",
")",
"feed",
"(",
")",
"bool",
"{",
"err",
":=",
"f",
".",
"ensureAtLeast",
"(",
"2",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"err",
"==",
"io",
".",
"ErrUnexpectedEOF",
"{",
"return",
"false",
"\n",
... | // feed retrieves another 16-bit word from the stream and consumes
// it into f.c. It returns false if there are no more bytes available.
// Otherwise, on error, it sets f.err. | [
"feed",
"retrieves",
"another",
"16",
"-",
"bit",
"word",
"from",
"the",
"stream",
"and",
"consumes",
"it",
"into",
"f",
".",
"c",
".",
"It",
"returns",
"false",
"if",
"there",
"are",
"no",
"more",
"bytes",
"available",
".",
"Otherwise",
"on",
"error",
... | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L118-L129 |
28,686 | Microsoft/go-winio | wim/lzx/lzx.go | getBits | func (f *decompressor) getBits(n byte) uint16 {
if f.nbits < n {
if !f.feed() {
f.fail(io.ErrUnexpectedEOF)
}
}
c := uint16(f.c >> (32 - n))
f.c <<= n
f.nbits -= n
return c
} | go | func (f *decompressor) getBits(n byte) uint16 {
if f.nbits < n {
if !f.feed() {
f.fail(io.ErrUnexpectedEOF)
}
}
c := uint16(f.c >> (32 - n))
f.c <<= n
f.nbits -= n
return c
} | [
"func",
"(",
"f",
"*",
"decompressor",
")",
"getBits",
"(",
"n",
"byte",
")",
"uint16",
"{",
"if",
"f",
".",
"nbits",
"<",
"n",
"{",
"if",
"!",
"f",
".",
"feed",
"(",
")",
"{",
"f",
".",
"fail",
"(",
"io",
".",
"ErrUnexpectedEOF",
")",
"\n",
... | // getBits retrieves the next n bits from the byte stream. n
// must be <= 16. It sets f.err on error. | [
"getBits",
"retrieves",
"the",
"next",
"n",
"bits",
"from",
"the",
"byte",
"stream",
".",
"n",
"must",
"be",
"<",
"=",
"16",
".",
"It",
"sets",
"f",
".",
"err",
"on",
"error",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L133-L143 |
28,687 | Microsoft/go-winio | wim/lzx/lzx.go | getCode | func (f *decompressor) getCode(h *huffman) uint16 {
if h.maxbits > 0 {
if f.nbits < maxTreePathLen {
f.feed()
}
// For codes with length < tablebits, it doesn't matter
// what the remainder of the bits used for table lookup
// are, since entries with all possible suffixes were
// added to the table.
... | go | func (f *decompressor) getCode(h *huffman) uint16 {
if h.maxbits > 0 {
if f.nbits < maxTreePathLen {
f.feed()
}
// For codes with length < tablebits, it doesn't matter
// what the remainder of the bits used for table lookup
// are, since entries with all possible suffixes were
// added to the table.
... | [
"func",
"(",
"f",
"*",
"decompressor",
")",
"getCode",
"(",
"h",
"*",
"huffman",
")",
"uint16",
"{",
"if",
"h",
".",
"maxbits",
">",
"0",
"{",
"if",
"f",
".",
"nbits",
"<",
"maxTreePathLen",
"{",
"f",
".",
"feed",
"(",
")",
"\n",
"}",
"\n\n",
"... | // getCode retrieves the next code using the provided
// huffman tree. It sets f.err on error. | [
"getCode",
"retrieves",
"the",
"next",
"code",
"using",
"the",
"provided",
"huffman",
"tree",
".",
"It",
"sets",
"f",
".",
"err",
"on",
"error",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L224-L257 |
28,688 | Microsoft/go-winio | wim/lzx/lzx.go | readTree | func (f *decompressor) readTree(lens []byte) error {
// Get the pre-tree for the main tree.
var pretreeLen [20]byte
for i := range pretreeLen {
pretreeLen[i] = byte(f.getBits(4))
}
if f.err != nil {
return f.err
}
h := buildTable(pretreeLen[:])
// The lengths are encoded as a series of huffman codes
// en... | go | func (f *decompressor) readTree(lens []byte) error {
// Get the pre-tree for the main tree.
var pretreeLen [20]byte
for i := range pretreeLen {
pretreeLen[i] = byte(f.getBits(4))
}
if f.err != nil {
return f.err
}
h := buildTable(pretreeLen[:])
// The lengths are encoded as a series of huffman codes
// en... | [
"func",
"(",
"f",
"*",
"decompressor",
")",
"readTree",
"(",
"lens",
"[",
"]",
"byte",
")",
"error",
"{",
"// Get the pre-tree for the main tree.",
"var",
"pretreeLen",
"[",
"20",
"]",
"byte",
"\n",
"for",
"i",
":=",
"range",
"pretreeLen",
"{",
"pretreeLen",... | // readTree updates the huffman tree path lengths in lens by
// reading and decoding lengths from the byte stream. lens
// should be prepopulated with the previous block's tree's path
// lengths. For the first block, lens should be zero. | [
"readTree",
"updates",
"the",
"huffman",
"tree",
"path",
"lengths",
"in",
"lens",
"by",
"reading",
"and",
"decoding",
"lengths",
"from",
"the",
"byte",
"stream",
".",
"lens",
"should",
"be",
"prepopulated",
"with",
"the",
"previous",
"block",
"s",
"tree",
"s... | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L263-L326 |
28,689 | Microsoft/go-winio | wim/lzx/lzx.go | readTrees | func (f *decompressor) readTrees(readAligned bool) (main *huffman, length *huffman, aligned *huffman, err error) {
// Aligned offset blocks start with a small aligned offset tree.
if readAligned {
var alignedLen [8]byte
for i := range alignedLen {
alignedLen[i] = byte(f.getBits(3))
}
aligned = buildTable(a... | go | func (f *decompressor) readTrees(readAligned bool) (main *huffman, length *huffman, aligned *huffman, err error) {
// Aligned offset blocks start with a small aligned offset tree.
if readAligned {
var alignedLen [8]byte
for i := range alignedLen {
alignedLen[i] = byte(f.getBits(3))
}
aligned = buildTable(a... | [
"func",
"(",
"f",
"*",
"decompressor",
")",
"readTrees",
"(",
"readAligned",
"bool",
")",
"(",
"main",
"*",
"huffman",
",",
"length",
"*",
"huffman",
",",
"aligned",
"*",
"huffman",
",",
"err",
"error",
")",
"{",
"// Aligned offset blocks start with a small al... | // readTrees reads the two or three huffman trees for the current block.
// readAligned specifies whether to read the aligned offset tree. | [
"readTrees",
"reads",
"the",
"two",
"or",
"three",
"huffman",
"trees",
"for",
"the",
"current",
"block",
".",
"readAligned",
"specifies",
"whether",
"to",
"read",
"the",
"aligned",
"offset",
"tree",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L393-L437 |
28,690 | Microsoft/go-winio | wim/lzx/lzx.go | readCompressedBlock | func (f *decompressor) readCompressedBlock(start, end uint16, hmain, hlength, haligned *huffman) (int, error) {
i := start
for i < end {
main := f.getCode(hmain)
if f.err != nil {
break
}
if main < 256 {
// Literal byte.
f.window[i] = byte(main)
i++
continue
}
// This is a match backward i... | go | func (f *decompressor) readCompressedBlock(start, end uint16, hmain, hlength, haligned *huffman) (int, error) {
i := start
for i < end {
main := f.getCode(hmain)
if f.err != nil {
break
}
if main < 256 {
// Literal byte.
f.window[i] = byte(main)
i++
continue
}
// This is a match backward i... | [
"func",
"(",
"f",
"*",
"decompressor",
")",
"readCompressedBlock",
"(",
"start",
",",
"end",
"uint16",
",",
"hmain",
",",
"hlength",
",",
"haligned",
"*",
"huffman",
")",
"(",
"int",
",",
"error",
")",
"{",
"i",
":=",
"start",
"\n",
"for",
"i",
"<",
... | // readCompressedBlock decodes a compressed block, writing into the window
// starting at start and ending at end, and using the provided huffman trees. | [
"readCompressedBlock",
"decodes",
"a",
"compressed",
"block",
"writing",
"into",
"the",
"window",
"starting",
"at",
"start",
"and",
"ending",
"at",
"end",
"and",
"using",
"the",
"provided",
"huffman",
"trees",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L441-L510 |
28,691 | Microsoft/go-winio | wim/lzx/lzx.go | readBlock | func (f *decompressor) readBlock(start uint16) (int, error) {
blockType, size, err := f.readBlockHeader()
if err != nil {
return 0, err
}
if blockType == uncompressedBlock {
if size%2 == 1 {
// Remember to realign the byte stream at the next block.
f.unaligned = true
}
copied := 0
if f.bo < f.bv {
... | go | func (f *decompressor) readBlock(start uint16) (int, error) {
blockType, size, err := f.readBlockHeader()
if err != nil {
return 0, err
}
if blockType == uncompressedBlock {
if size%2 == 1 {
// Remember to realign the byte stream at the next block.
f.unaligned = true
}
copied := 0
if f.bo < f.bv {
... | [
"func",
"(",
"f",
"*",
"decompressor",
")",
"readBlock",
"(",
"start",
"uint16",
")",
"(",
"int",
",",
"error",
")",
"{",
"blockType",
",",
"size",
",",
"err",
":=",
"f",
".",
"readBlockHeader",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"retur... | // readBlock decodes the current block and returns the number of uncompressed bytes. | [
"readBlock",
"decodes",
"the",
"current",
"block",
"and",
"returns",
"the",
"number",
"of",
"uncompressed",
"bytes",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L513-L544 |
28,692 | Microsoft/go-winio | wim/lzx/lzx.go | decodeE8 | func decodeE8(b []byte, off int64) {
if off > maxe8offset || len(b) < 10 {
return
}
for i := 0; i < len(b)-10; i++ {
if b[i] == 0xe8 {
currentPtr := int32(off) + int32(i)
abs := int32(binary.LittleEndian.Uint32(b[i+1 : i+5]))
if abs >= -currentPtr && abs < e8filesize {
var rel int32
if abs >= 0 ... | go | func decodeE8(b []byte, off int64) {
if off > maxe8offset || len(b) < 10 {
return
}
for i := 0; i < len(b)-10; i++ {
if b[i] == 0xe8 {
currentPtr := int32(off) + int32(i)
abs := int32(binary.LittleEndian.Uint32(b[i+1 : i+5]))
if abs >= -currentPtr && abs < e8filesize {
var rel int32
if abs >= 0 ... | [
"func",
"decodeE8",
"(",
"b",
"[",
"]",
"byte",
",",
"off",
"int64",
")",
"{",
"if",
"off",
">",
"maxe8offset",
"||",
"len",
"(",
"b",
")",
"<",
"10",
"{",
"return",
"\n",
"}",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"len",
"(",
"b",
")... | // decodeE8 reverses the 0xe8 x86 instruction encoding that was performed
// to the uncompressed data before it was compressed. | [
"decodeE8",
"reverses",
"the",
"0xe8",
"x86",
"instruction",
"encoding",
"that",
"was",
"performed",
"to",
"the",
"uncompressed",
"data",
"before",
"it",
"was",
"compressed",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L548-L568 |
28,693 | Microsoft/go-winio | wim/lzx/lzx.go | NewReader | func NewReader(r io.Reader, uncompressedSize int) (io.ReadCloser, error) {
if uncompressedSize > windowSize {
return nil, errors.New("uncompressed size is limited to 32KB")
}
f := &decompressor{
lru: [3]uint16{1, 1, 1},
uncompressed: uncompressedSize,
b: make([]byte, 4096),
r: ... | go | func NewReader(r io.Reader, uncompressedSize int) (io.ReadCloser, error) {
if uncompressedSize > windowSize {
return nil, errors.New("uncompressed size is limited to 32KB")
}
f := &decompressor{
lru: [3]uint16{1, 1, 1},
uncompressed: uncompressedSize,
b: make([]byte, 4096),
r: ... | [
"func",
"NewReader",
"(",
"r",
"io",
".",
"Reader",
",",
"uncompressedSize",
"int",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"if",
"uncompressedSize",
">",
"windowSize",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\""... | // NewReader returns a new io.ReadCloser that decompresses a
// WIM LZX stream until uncompressedSize bytes have been returned. | [
"NewReader",
"returns",
"a",
"new",
"io",
".",
"ReadCloser",
"that",
"decompresses",
"a",
"WIM",
"LZX",
"stream",
"until",
"uncompressedSize",
"bytes",
"have",
"been",
"returned",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/wim/lzx/lzx.go#L595-L606 |
28,694 | Microsoft/go-winio | pkg/guid/guid.go | FromString | func FromString(s string) (*GUID, error) {
if len(s) != 36 {
return nil, errors.New("invalid GUID format (length)")
}
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
return nil, errors.New("invalid GUID format (dashes)")
}
var g GUID
data1, err := strconv.ParseUint(s[0:8], 16, 32)
if err !... | go | func FromString(s string) (*GUID, error) {
if len(s) != 36 {
return nil, errors.New("invalid GUID format (length)")
}
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
return nil, errors.New("invalid GUID format (dashes)")
}
var g GUID
data1, err := strconv.ParseUint(s[0:8], 16, 32)
if err !... | [
"func",
"FromString",
"(",
"s",
"string",
")",
"(",
"*",
"GUID",
",",
"error",
")",
"{",
"if",
"len",
"(",
"s",
")",
"!=",
"36",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"s",
"[",
"8",
"]... | // FromString parses a string containing a GUID and returns the GUID. The only
// format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
// format. | [
"FromString",
"parses",
"a",
"string",
"containing",
"a",
"GUID",
"and",
"returns",
"the",
"GUID",
".",
"The",
"only",
"format",
"currently",
"supported",
"is",
"the",
"xxxxxxxx",
"-",
"xxxx",
"-",
"xxxx",
"-",
"xxxx",
"-",
"xxxxxxxxxxxx",
"format",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/guid/guid.go#L56-L93 |
28,695 | Microsoft/go-winio | pkg/guid/guid.go | UnmarshalJSON | func (g *GUID) UnmarshalJSON(data []byte) error {
g2, err := FromString(strings.Trim(string(data), "\""))
if err != nil {
return err
}
*g = *g2
return nil
} | go | func (g *GUID) UnmarshalJSON(data []byte) error {
g2, err := FromString(strings.Trim(string(data), "\""))
if err != nil {
return err
}
*g = *g2
return nil
} | [
"func",
"(",
"g",
"*",
"GUID",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"g2",
",",
"err",
":=",
"FromString",
"(",
"strings",
".",
"Trim",
"(",
"string",
"(",
"data",
")",
",",
"\"",
"\\\"",
"\"",
")",
")",
"\n",
... | // UnmarshalJSON unmarshals a GUID from JSON representation and sets itself to
// the unmarshaled GUID. | [
"UnmarshalJSON",
"unmarshals",
"a",
"GUID",
"from",
"JSON",
"representation",
"and",
"sets",
"itself",
"to",
"the",
"unmarshaled",
"GUID",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/guid/guid.go#L103-L110 |
28,696 | Microsoft/go-winio | pkg/etw/mksyscall_windows.go | tmpVar | func (p *Param) tmpVar() string {
if p.tmpVarIdx < 0 {
p.tmpVarIdx = p.fn.curTmpVarIdx
p.fn.curTmpVarIdx++
}
return fmt.Sprintf("_p%d", p.tmpVarIdx)
} | go | func (p *Param) tmpVar() string {
if p.tmpVarIdx < 0 {
p.tmpVarIdx = p.fn.curTmpVarIdx
p.fn.curTmpVarIdx++
}
return fmt.Sprintf("_p%d", p.tmpVarIdx)
} | [
"func",
"(",
"p",
"*",
"Param",
")",
"tmpVar",
"(",
")",
"string",
"{",
"if",
"p",
".",
"tmpVarIdx",
"<",
"0",
"{",
"p",
".",
"tmpVarIdx",
"=",
"p",
".",
"fn",
".",
"curTmpVarIdx",
"\n",
"p",
".",
"fn",
".",
"curTmpVarIdx",
"++",
"\n",
"}",
"\n... | // tmpVar returns temp variable name that will be used to represent p during syscall. | [
"tmpVar",
"returns",
"temp",
"variable",
"name",
"that",
"will",
"be",
"used",
"to",
"represent",
"p",
"during",
"syscall",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/mksyscall_windows.go#L100-L106 |
28,697 | Microsoft/go-winio | pkg/etw/mksyscall_windows.go | BoolTmpVarCode | func (p *Param) BoolTmpVarCode() string {
const code = `var %s uint32
if %s {
%s = 1
} else {
%s = 0
}`
tmp := p.tmpVar()
return fmt.Sprintf(code, tmp, p.Name, tmp, tmp)
} | go | func (p *Param) BoolTmpVarCode() string {
const code = `var %s uint32
if %s {
%s = 1
} else {
%s = 0
}`
tmp := p.tmpVar()
return fmt.Sprintf(code, tmp, p.Name, tmp, tmp)
} | [
"func",
"(",
"p",
"*",
"Param",
")",
"BoolTmpVarCode",
"(",
")",
"string",
"{",
"const",
"code",
"=",
"`var %s uint32\n\tif %s {\n\t\t%s = 1\n\t} else {\n\t\t%s = 0\n\t}`",
"\n",
"tmp",
":=",
"p",
".",
"tmpVar",
"(",
")",
"\n",
"return",
"fmt",
".",
"Sprintf",
... | // BoolTmpVarCode returns source code for bool temp variable. | [
"BoolTmpVarCode",
"returns",
"source",
"code",
"for",
"bool",
"temp",
"variable",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/mksyscall_windows.go#L109-L118 |
28,698 | Microsoft/go-winio | pkg/etw/mksyscall_windows.go | SliceTmpVarCode | func (p *Param) SliceTmpVarCode() string {
const code = `var %s *%s
if len(%s) > 0 {
%s = &%s[0]
}`
tmp := p.tmpVar()
return fmt.Sprintf(code, tmp, p.Type[2:], p.Name, tmp, p.Name)
} | go | func (p *Param) SliceTmpVarCode() string {
const code = `var %s *%s
if len(%s) > 0 {
%s = &%s[0]
}`
tmp := p.tmpVar()
return fmt.Sprintf(code, tmp, p.Type[2:], p.Name, tmp, p.Name)
} | [
"func",
"(",
"p",
"*",
"Param",
")",
"SliceTmpVarCode",
"(",
")",
"string",
"{",
"const",
"code",
"=",
"`var %s *%s\n\tif len(%s) > 0 {\n\t\t%s = &%s[0]\n\t}`",
"\n",
"tmp",
":=",
"p",
".",
"tmpVar",
"(",
")",
"\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"cod... | // SliceTmpVarCode returns source code for slice temp variable. | [
"SliceTmpVarCode",
"returns",
"source",
"code",
"for",
"slice",
"temp",
"variable",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/mksyscall_windows.go#L121-L128 |
28,699 | Microsoft/go-winio | pkg/etw/mksyscall_windows.go | StringTmpVarCode | func (p *Param) StringTmpVarCode() string {
errvar := p.fn.Rets.ErrorVarName()
if errvar == "" {
errvar = "_"
}
tmp := p.tmpVar()
const code = `var %s %s
%s, %s = %s(%s)`
s := fmt.Sprintf(code, tmp, p.fn.StrconvType(), tmp, errvar, p.fn.StrconvFunc(), p.Name)
if errvar == "-" {
return s
}
const morecode =... | go | func (p *Param) StringTmpVarCode() string {
errvar := p.fn.Rets.ErrorVarName()
if errvar == "" {
errvar = "_"
}
tmp := p.tmpVar()
const code = `var %s %s
%s, %s = %s(%s)`
s := fmt.Sprintf(code, tmp, p.fn.StrconvType(), tmp, errvar, p.fn.StrconvFunc(), p.Name)
if errvar == "-" {
return s
}
const morecode =... | [
"func",
"(",
"p",
"*",
"Param",
")",
"StringTmpVarCode",
"(",
")",
"string",
"{",
"errvar",
":=",
"p",
".",
"fn",
".",
"Rets",
".",
"ErrorVarName",
"(",
")",
"\n",
"if",
"errvar",
"==",
"\"",
"\"",
"{",
"errvar",
"=",
"\"",
"\"",
"\n",
"}",
"\n",... | // StringTmpVarCode returns source code for string temp variable. | [
"StringTmpVarCode",
"returns",
"source",
"code",
"for",
"string",
"temp",
"variable",
"."
] | 3fe4fa31662f6ede2353d913e93907b8e096e0b6 | https://github.com/Microsoft/go-winio/blob/3fe4fa31662f6ede2353d913e93907b8e096e0b6/pkg/etw/mksyscall_windows.go#L131-L148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.