code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "syscall" func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { // TODO(mikio): Implement this return syscall.E...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "net" "syscall" ) // MulticastHopLimit returns the hop limit field value for outgoing // multicast packets. func (c *dgramOpt) Multic...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "syscall" func setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error { // TODO(mikio): Implement this retur...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // This program generates internet protocol constants by reading IANA // protocol registries. // // Usage: // go run gentest.go > iana_test.g...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "net" func boolint(b bool) int { if b { return 1 } return 0 } func netAddrToIP16(a net.Addr) net.IP { switch v := a.(type) { case...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "sync" // An ICMPType represents a type of ICMP message. type ICMPType int func (typ ICMPType) String() string { s, ok := icmpTypes[typ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "errors" "fmt" "net" "sync" ) var ( errNotSupported = errors.New("not supported") errMissingAddress = errors.New("missing add...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "net" "os" "syscall" "unsafe" ) const ( // See /usr/include/linux/in6.h. syscall_IPV6_RECVPATHMTU = syscall.IPV6_DSTOPTS + 1 + io...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build freebsd netbsd openbsd package ipv6 import ( "os" "syscall" ) func ipv6PathMTU(fd int) (int, error) { v, err := syscall.GetsockoptIPv6MTUInfo(f...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build freebsd netbsd openbsd package ipv6 import ( "net" "os" "syscall" "unsafe" ) const pktinfo = FlagDst | FlagInterface func setControlMessage(f...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd package ipv6 import ( "net" "os" "syscall" ) func ipv6TrafficClass(fd int) (int, error) { v, err := syscal...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "syscall" // TrafficClass returns the traffic class field value for outgoing // packets. func (c *genericOpt) TrafficClass() (int, error)...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "net" "os" "syscall" "unsafe" ) const pktinfo = FlagDst | FlagInterface func setControlMessage(fd int, opt *rawOpt, cf ControlFlag...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd openbsd package ipv6 import ( "os" "syscall" ) func setIPv6Checksum(fd int, on bool, offset int) error { if !on { offse...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "net" "os" "syscall" "unsafe" ) func ipv6TrafficClass(fd syscall.Handle) (int, error) { // TODO(mikio): Implement this return 0, ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "os" "syscall" ) func ipv6ReceiveTrafficClass(fd int) (bool, error) { return false, errNotSupported } func setIPv6ReceiveTrafficCla...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "net" // A payloadHandler represents the IPv6 datagram payload handler. type payloadHandler struct { net.PacketConn rawOpt } func (c *...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build plan9 windows package ipv6 import ( "net" "syscall" ) // ReadFrom reads a payload of the received IPv6 datagram, from the // endpoint c, copying...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "syscall" type rawICMPFilter struct { syscall.ICMPv6Filter } func (f *rawICMPFilter) set(typ ICMPType, block bool) { if block { f.Da...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // This program generates internet protocol constatns and tables by // reading IANA protocol registries. // // Usage: // go run gen.go > iana...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !plan9,!windows package ipv6 import ( "net" "syscall" ) // ReadFrom reads a payload of the received IPv6 datagram, from the // endpoint c, copyi...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "os" "syscall" ) func setIPv6Checksum(fd int, on bool, offset int) error { if !on { offset = -1 } return os.NewSyscallError("set...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 type rawICMPFilter struct { // TODO(mikio): Implement this } func (f *rawICMPFilter) set(typ ICMPType, block bool) { // TODO(mikio): Implement...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "syscall" func (c *genericOpt) sysfd() (int, error) { // TODO(mikio): Implement this return 0, syscall.EPLAN9 } func (c *dgramOpt) sys...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build freebsd linux netbsd openbsd package ipv6 import ( "os" "syscall" ) func ipv6ReceiveTrafficClass(fd int) (bool, error) { v, err := syscall.Gets...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd package ipv6 import ( "net" "reflect" ) func (c *genericOpt) sysfd() (int, error) { switch p := c.Conn.(typ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "os" "syscall" ) func ipv6PathMTU(fd int) (int, error) { v, err := syscall.GetsockoptIPv6MTUInfo(fd, ianaProtocolIPv6, syscall_IPV6_...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "syscall" func ipv6PathMTU(fd int) (int, error) { // TODO(mikio): Implement this return 0, syscall.EPLAN9 }
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd linux netbsd openbsd windows package ipv6 import ( "net" "syscall" ) // MulticastHopLimit returns the hop limit field value for o...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import ( "net" "syscall" ) // A Conn represents a network endpoint that uses IPv6 transport. // It allows to set basic IP-level socket options...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package ipv6 implements IP-level socket options for the Internet // Protocol version 6. // // The package provides IP-level socket options that allow // man...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 import "syscall" func ipv6ReceiveTrafficClass(fd syscall.Handle) (bool, error) { // TODO(mikio): Implement this return false, syscall.EWINDOWS...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ipv6 type rawICMPFilter struct { // TODO(mikio): Implement this } func (f *rawICMPFilter) set(typ ICMPType, block bool) { // TODO(mikio): Implement...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin freebsd netbsd openbsd package ipv6 import "syscall" type rawICMPFilter struct { syscall.ICMPv6Filter } func (f *rawICMPFilter) set(typ I...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package crypt provides simple, password-based encryption and decryption of data blobs. package crypt import ( "bytes" "crypto/aes" "crypto/cipher" "cry...
Go
package main import ( "bufio" "go/build" "io" "log" "math" "os" "strconv" "strings" "code.google.com/p/rsc/c2go/liblink" "code.google.com/p/rsc/c2go/liblink/amd64" "code.google.com/p/rsc/c2go/liblink/arm" "code.google.com/p/rsc/c2go/liblink/x86" ) var arch *liblink.LinkArch func main() { switch build.D...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "flag" "fmt" "io" "io/ioutil" "log" "os" "regexp" "strings" "unicode/utf8" "code.google.com/p/rsc/c2go" "c...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package c2go import ( "bytes" "fmt" "os" "path" "strings" "code.google.com/p/rsc/cc" ) type PrintSpecial int const ( Indent PrintSpecial = iota Uni...
Go
// +build ignore package main import ( "fmt" "go/format" "io/ioutil" "log" "os" "path" "path/filepath" "strings" "code.google.com/p/rsc/c2go" "code.google.com/p/rsc/cc" ) // print an error; fprintf is a bad name but helps go vet. func fprintf(span cc.Span, format string, args ...interface{}) { msg := fmt...
Go
package liblink import ( "os" "path" "strconv" "strings" ) // Derived from Inferno utils/6l/obj.c and utils/6l/span.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c // // Copyright © 1994-1999 Lucent Technologies Inc. All r...
Go
package arm import ( "encoding/binary" "fmt" "log" "math" "code.google.com/p/rsc/c2go/liblink" ) // Derived from Inferno utils/5c/swt.c // http://code.google.com/p/inferno-os/source/browse/utils/5c/swt.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997...
Go
package arm import ( "fmt" "log" "math" "sort" "code.google.com/p/rsc/c2go/liblink" ) type Optab struct { as int a1 uint8 a2 int a3 uint8 typ uint8 size int param int flag int8 pcrelsiz uint8 } type Oprang struct { start []Optab stop []Optab } type Opcross [...
Go
package arm // Inferno utils/5l/span.c // http://code.google.com/p/inferno-os/source/browse/utils/5l/span.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions C...
Go
package arm func bool2int(b bool) int { if b { return 1 } return 0 } const ( fmtLong = 1 << iota ) // list[568].c // obj.c // objfile.c // pass.c // pcln.c // sym.c // TODO(ality): remove this workaround. // It's here because Pconv in liblink/list?.c references %L. var Anames5 = []string{ "XXX", "AND", "E...
Go
package arm import ( "fmt" "code.google.com/p/rsc/c2go/liblink" ) // Inferno utils/5c/list.c // http://code.google.com/p/inferno-os/source/browse/utils/5c/list.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Porti...
Go
package liblink import ( "math" "strings" ) // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // go-specific code shared across loaders (5l, 6l, 8l). // replace all "". with pkg. func expandpkg(t0 string, pk...
Go
package liblink import ( "bytes" "fmt" "log" "strconv" "strings" ) // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Writing and reading of Go object files. // // Originally, Go object files were Plan...
Go
package liblink /* * The authors of this software are Rob Pike and Ken Thompson. * Copyright (c) 2002 by Lucent Technologies. * Permission to use, copy, modify, and distribute this software for any * purpose without fee is hereby granted, provided that this entire notice * is included in all copies o...
Go
package liblink import ( "fmt" "log" "os" "strconv" "strings" ) // Derived from Inferno utils/6l/obj.c and utils/6l/span.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c // // Copyright © 1994-1999 Lucent Technologies Inc. ...
Go
package liblink import "fmt" // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. const ( HISTSZ = 10 NSYM = 50 ) func linklinefmt(ctxt *Link, lno int, showAll, showFullPath bool) string { var a [HISTSZ]str...
Go
package liblink func bool2int(b bool) int { if b { return 1 } return 0 } const ( fmtLong = 1 << iota ) // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file defines flags attached to various f...
Go
package liblink // Inferno utils/6l/pass.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/pass.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portio...
Go
package liblink import ( "encoding/binary" "fmt" ) // Derived from Inferno utils/6l/l.h and related files. // http://code.google.com/p/inferno-os/source/browse/utils/6l/l.h // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net...
Go
package x86 import ( "fmt" "code.google.com/p/rsc/c2go/liblink" ) // Inferno utils/8c/list.c // http://code.google.com/p/inferno-os/source/browse/utils/8c/list.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Porti...
Go
package x86 func bool2int(b bool) int { if b { return 1 } return 0 } const ( fmtLong = 1 << iota ) var Anames8 = []string{ "XXX", "AAA", "AAD", "AAM", "AAS", "ADCB", "ADCL", "ADCW", "ADDB", "ADDL", "ADDW", "ADJSP", "ANDB", "ANDL", "ANDW", "ARPL", "BOUNDL", "BOUNDW", "BSFL", "BSFW", "BSRL",...
Go
package x86 import ( "encoding/binary" "fmt" "log" "math" "code.google.com/p/rsc/c2go/liblink" ) // Inferno utils/8l/pass.c // http://code.google.com/p/inferno-os/source/browse/utils/8l/pass.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyt...
Go
package x86 import ( "fmt" "log" "code.google.com/p/rsc/c2go/liblink" ) /* * this is the ranlib header */ const ( MaxAlign = 32 FuncAlign = 16 ) type Optab struct { as int ytab []uint8 prefix int op [13]uint8 } const ( Yxxx = 0 + iota Ynone Yi0 Yi1 Yi8 Yi32 Yiauto Yal Ycl Yax Ycx ...
Go
package x86 // Inferno utils/8l/span.c // http://code.google.com/p/inferno-os/source/browse/utils/8l/span.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions C...
Go
package liblink import ( "bufio" "fmt" "go/build" "io" "log" "os" "runtime" ) func Cputime() float64 { return 0 } func sysfatal(format string, args ...interface{}) { log.Fatalf(format, args...) } func Getgoroot() string { return build.Default.GOROOT } func Getgoos() string { return build.Default.GOOS } ...
Go
package liblink // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Stack layout parameters. Included both by runtime (compiled via 6c) and linkers (compiled via gcc). The per-goroutine g->stackguard is set ...
Go
package liblink const ( AEXIST = 0 ) var GOEXPERIMENT string const ( OREAD = iota OWRITE ORDWR SIGBUS SIGSEGV NDFLT FPPDBL FPRNR BOM HEADER_IO )
Go
package liblink import ( "log" "math" ) // Derived from Inferno utils/6l/obj.c and utils/6l/span.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Po...
Go
package amd64 import ( "fmt" "log" "code.google.com/p/rsc/c2go/liblink" ) /* * this is the ranlib header */ const ( MaxAlign = 32 LoopAlign = 16 MaxLoopPad = 0 FuncAlign = 16 ) type Optab struct { as int ytab []uint8 prefix int op [23]uint8 } type Movtab struct { as int ft uint8 t...
Go
package amd64 import ( "fmt" "code.google.com/p/rsc/c2go/liblink" ) // Inferno utils/6c/list.c // http://code.google.com/p/inferno-os/source/browse/utils/6c/list.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Por...
Go
package amd64 // Inferno utils/6l/span.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions...
Go
package amd64 func bool2int(b bool) int { if b { return 1 } return 0 } const ( fmtLong = 1 << iota ) var Anames6 = []string{ "XXX", "AAA", "AAD", "AAM", "AAS", "ADCB", "ADCL", "ADCW", "ADDB", "ADDL", "ADDW", "ADJSP", "ANDB", "ANDL", "ANDW", "ARPL", "BOUNDL", "BOUNDW", "BSFL", "BSFW", "BSRL...
Go
package amd64 import ( "encoding/binary" "fmt" "log" "math" "code.google.com/p/rsc/c2go/liblink" ) // Inferno utils/6l/pass.c // http://code.google.com/p/inferno-os/source/browse/utils/6l/pass.c // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Fors...
Go
package liblink import ( "fmt" "log" ) // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. func addvarint(ctxt *Link, d *Pcdata, val uint32) { var v uint32 for v = val; v >= 0x80; v >>= 7 { d.P = append(d...
Go
// +build ignore package main import ( "bytes" "fmt" "strconv" "strings" "code.google.com/p/rsc/c2go" "code.google.com/p/rsc/cc" ) func tryPrintf(curfn *cc.Decl, x *cc.Expr, name string, fmtpos int, newName string) bool { if (x.Left.Text == name || strings.Contains(name, ".") && x.Left.String() == name) && l...
Go
// +build ignore package main import ( "bufio" "bytes" "fmt" "io" "log" "os" "strings" "code.google.com/p/rsc/cc" ) type Config struct { Replace map[string]string Delete map[string]bool ForceType map[string]*cc.Type Len map[string]string // map T.n to T.p where t.n = len(t.p) StopFlow map[s...
Go
// +build ignore package main import ( "fmt" "os" "sort" "strings" "code.google.com/p/rsc/c2go" "code.google.com/p/rsc/cc" ) // A flowSyntax is a node representing the flow of a value // through a piece of syntax in the program. // The syntax can be a *cc.Expr or a *cc.Decl. type flowSyntax struct { syntax ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "code.google.com/p/rsc/c2go" "code.google.com/p/rsc/cc" ) func unparen(x *cc.Expr) *cc.Expr { for x != nil && x.Op...
Go
// +build ignore package main import ( "fmt" "path/filepath" "strings" "code.google.com/p/rsc/c2go" "code.google.com/p/rsc/cc" ) var goKeyword = map[string]string{ "chan": "chan_", "defer": "defer_", "fallthrough": "fallthrough_", "func": "fun", "go": "go_", "import": "i...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "flag" "fmt" "log" "os" "regexp/syntax" "runtime/pprof" ) var maxState = flag.Int("m", 1e5, "maximum number of states to explore"...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Copy of code.google.com/p/codesearch/regexp/utf.go. package main import ( "regexp/syntax" "unicode" "unicode/utf8" ) const ( instFail = syntax.I...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Copied from code.google.com/p/codesearch/regexp/copy.go // and adapted for the problem of finding a matching string, not // testing whether a particular str...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code to merge (join) multiple regexp progs into a single prog. // New code; not copied from anywhere. package main import "regexp/syntax" func joinProgs(...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Copied from code.google.com/p/codesearch/regexp/copy.go. // Copied from Go's regexp/syntax. // Formatters edited to handle instByteRange. package main im...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Copied from code.google.com/p/codesearch/sparse/set.go, // tweaked for better inlinability. package main // For comparison: running cindex over the Linux ...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Copy of go/src/pkg/sort/sort.go, specialized for []int // and to remove some array indexing. package main func min(a, b int) int { if a < b { return a ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package app import ( "fmt" "net/http" "strings" "time" "appengine" "appengine/memcache" "appengine/urlfetch" "code.google.com/p/rsc/appfs/fs" _ "co...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package plist implements parsing of Apple plist files. package plist import ( "bytes" "fmt" "reflect" "strconv" ) func next(data []byte) (skip, tag, r...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package gf256 implements arithmetic over the Galois Field GF(256). package gf256 import "strconv" // A Field represents an instance of GF(256) defined by ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package issue provides access to the Google Code Issue Tracker API. package issue import ( "encoding/xml" "fmt" "html" "io" "net/http" "net/url" "os...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "log" "net/http" "code.google.com/p/rsc/appfs/fs" "code.google.com/p/rsc/issue/dashboard" ) func main() { log.S...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package dashboard implements the issue dashboard for an // upcoming Go release. package dashboard import ( "bytes" "encoding/json" "fmt" "html/template...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Simple demo of using package ext2. // +build ignore package main import ( "fmt" "io" "log" "os" "strings" "code.google.com/p/rsc/ext2" ) func mai...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package ext2 implements read-only access to EXT2 file systems. package ext2 import ( "bytes" "encoding/binary" "fmt" "io" "os" "reflect" "strconv" ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cloudprint implements sending and receiving print jobs // using Google Cloud Print (https://developers.google.com/cloud-print/). package cloudprint ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // XMPP support for talking to Google Cloud Print (only). package cloudprint import ( "bufio" "bytes" "crypto/tls" "encoding/base64" "encoding/xml" "er...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cloudprint import ( "bytes" "crypto/rand" "encoding/json" "fmt" "io" "log" "mime/multipart" "net/http" "net/http/httptest" "os/exec" "strin...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cloudprint // defaultPPD is the default PPD (capabilities) for a new printer. var defaultPPD = `*PPD-Adobe: "4.3" *FormatVersion: "4.3" *FileVersion: ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package dbstore stores and retrieves Go data structures as rows in a SQL database. // // Each struct type is stored in its own table, and each field is a sep...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( // "flag" "bufio" "fmt" "log" "net" "net/rpc" "os" "strings" "syscall" "code.google.com/p/rsc/google" "code.google.com/p/rsc...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // TODO: Add ChatHangup. // TODO: Auto-hangup chats that are gone. package main import ( "fmt" "code.google.com/p/rsc/google" "code.google.com/p/rsc/xmpp...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // TODO: Something about redialing. package google import ( // "flag" "encoding/json" "fmt" "io/ioutil" "log" "net" "net/rpc" "os" "os/exec" "sysca...
Go
package main import ( "bufio" "bytes" "flag" "fmt" "io" "log" "os" "os/exec" "os/signal" "regexp" "sort" "strings" "syscall" "time" "code.google.com/p/rsc/google" "code.google.com/p/rsc/imap" ) var cmdtab = []struct { Name string Args int F func(*Cmd, *imap.MsgPart) *imap.MsgPart TF func(*Cm...
Go
package main import ( "bufio" "bytes" "encoding/base64" "flag" "fmt" "io" "net/smtp" "os" "regexp" "strings" "code.google.com/p/rsc/google" ) func enc(s string) string { // TODO =? .. ?= return s } type Addr struct { Name string Email string } func (a Addr) enc() string { if a.Name == "" { retur...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package google import "code.google.com/p/rsc/xmpp" type ChatID struct { ID string Email string Status xmpp.Status StatusMsg string } type ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main /* TODO: - Del of main window should move to other window. - Editing main window should update status on \n or something like that. - Make use...
Go