code
stringlengths
10
1.34M
language
stringclasses
1 value
// 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. /* Arqfs implements a file system interface to a collection of Arq backups. usage: arqfs [-m mtpt] Arqfs mounts the Arq backups on the file system direct...
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 arq import ( "crypto/aes" "crypto/cipher" "crypto/sha1" "hash" "log" "bitbucket.org/taruti/pbkdf2.go" // TODO: Pull in copy ) type cryptoState...
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. // Parsing of Arq's binary data structures. package arq import ( "bytes" "encoding/binary" "fmt" "reflect" "time" ) var errMalformed = fmt.Errorf("malf...
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. /* Hist shows the history of a given file, using Arq backups. usage: hist [-d] [-h host] [-m mtpt] [-s yyyy/mmdd] file ... The -d flag causes it to show ...
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 arq implements read-only access to Arq backups stored on S3. // Arq is a Mac backup tool (http://www.haystacksoftware.com/arq/) // but the package c...
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 keychain /* #include <CoreFoundation/CoreFoundation.h> #include <Security/Security.h> #include <CoreServices/CoreServices.h> #cgo LDFLAGS: -framework...
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 keychain implements access to the passwords and other keys // stored in the system-provided keychain. package keychain // BUG(rsc): Package keychai...
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: Rewrite using package syscall not cgo package fuse /* // Adapted from Plan 9 from User Space's src/cmd/9pfuse/fuse.c, // which carries this notice:...
Go
package fuse import "time" type attr struct { Ino uint64 Size uint64 Blocks uint64 Atime uint64 Mtime uint64 Ctime uint64 AtimeNsec uint32 MtimeNsec uint32 CtimeNsec uint32 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint32 // Blksize uint32...
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. // FUSE directory tree, for servers that wish to use it with the service loop. package fuse import ( "os" pathpkg "path" "strings" ) // A Tree implements...
Go
package fuse
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. // FUSE service loop, for servers that wish to use it. package fuse import ( "fmt" "hash/fnv" "io" "log" "os" "path" "sync" "syscall" "time" ) // T...
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. // Hellofs implements a simple "hello world" file system. package main import ( "log" "os" "code.google.com/p/rsc/fuse" ) func main() { c, err := fuse.M...
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. // Adapted from Plan 9 from User Space's src/cmd/9pfuse/fuse.c, // which carries this notice: // // The files in this directory are subject to the following li...
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. // Derived from FUSE's fuse_kernel.h /* This file defines the kernel interface of FUSE Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> T...
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 fuse import ( "fmt" "net" "os" "os/exec" "syscall" ) func mount(dir string) (fusefd int, errmsg string) { fds, err := syscall.Socketpair(syscal...
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. // FUSE service loop, for servers that wish to use it. package fuse import ( "runtime" ) func stack() string { buf := make([]byte, 1024) return string(bu...
Go
package fuse import ( "time" ) type attr struct { Ino uint64 Size uint64 Blocks uint64 Atime uint64 Mtime uint64 Ctime uint64 Crtime_ uint64 // OS X only AtimeNsec uint32 MtimeNsec uint32 CtimeNsec uint32 CrtimeNsec uint32 // OS X only Mode uint32 Nlink u...
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 proto defines the protocol between appfs client and server. package proto import "time" // An Auth appears, JSON-encoded, as the X-Appfs-Auth head...
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 fs is an indirection layer, allowing code to use a // file system without knowing whether it is the host file system // (running without App Engine)...
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 fs import ( "io/ioutil" "net/http" "os" "path/filepath" "code.google.com/p/rsc/appfs/proto" ) type context struct{} type cacheKey struct{} fu...
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 client implements a basic appfs client. package client import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "strings" "time" ...
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 server implements an appfs server backed by the // App Engine datastore. package server import ( "bytes" "crypto/sha1" "encoding/base64" "enco...
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. // appfile is a command-line interface to an appfs file system. package main import ( "flag" "fmt" "io/ioutil" "log" "os" "code.google.com/p/rsc/appfs/...
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. // appmount mounts an appfs file system. package main import ( "bytes" "encoding/gob" "flag" "fmt" "log" "os" "os/exec" "path" "strings" "syscall" ...
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. // Devweb is a simple environment for developing a web server. // It runs its own web server on the given address and proxies // all requests to the http serve...
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 slave import ( "fmt" "log" "net" "net/http" "os" ) func Main() { if len(os.Args) != 2 || os.Args[1] != "LISTEN_STDIN" { fmt.Fprintf(os.Stderr...
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 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
// +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 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 ( "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. 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 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
// +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
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 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 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 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 ( "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 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 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 // 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 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 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 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" "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 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" "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 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 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 ( "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
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 const ( AEXIST = 0 ) var GOEXPERIMENT string const ( OREAD = iota OWRITE ORDWR SIGBUS SIGSEGV NDFLT FPPDBL FPRNR BOM HEADER_IO )
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 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 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 // 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 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 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 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 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
// 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 ( "code.google.com/p/rsc/devweb/slave" _ "code.google.com/p/rsc/blog/post" ) func main() { slave.Main() }
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 post import ( "bytes" "encoding/json" "encoding/xml" "fmt" "html/template" "net/http" "os" "path" "runtime/debug" "sort" "strings" "time" ...
Go
package post import ( "fmt" "net/http" "runtime/debug" qrweb "code.google.com/p/rsc/qr/web" ) func carp(f http.HandlerFunc) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { defer func() { if err := recover(); err != nil { w.Header().Set("Content-Type", "text/plain...
Go
// 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. // Adapted from encoding/xml/read_test.go. // Package atom defines XML data structures for an Atom feed. package atom import ( "encoding/xml" "time" ) typ...
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 cc var hdr_u_h = ` typedef signed char schar; typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; typedef long long vlong; typedef unsigned long long uvlong; typedef schar int8; typedef uchar uint8; typedef short int16; typedef ushort uint16; 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 cc import ( "bytes" "fmt" "strings" ) type special int const ( indent special = iota unindent untab newline ) type Printer struct { buf ...
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. // Scoping and type checking. // C99 standard: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf package cc import ( "fmt" "strconv" "strings" ) ...
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 cc import ( "fmt" "io/ioutil" "os" "path/filepath" "sort" "strings" ) // A Syntax represents any syntax element. type Syntax interface { // Ge...
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 cc import "fmt" // An Expr is a parsed C expression. type Expr struct { SyntaxInfo Op ExprOp // operator Left *Expr // left (or only) ope...
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 cc type Stmt struct { SyntaxInfo Op StmtOp Pre *Expr Expr *Expr Post *Expr Decl *Decl Body *Stmt Else *Stmt Block []*Stmt ...
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 cc import ( "fmt" "strings" ) var printf = fmt.Printf type Type struct { SyntaxInfo Kind TypeKind Qual TypeQual Base *Type Tag ...
Go
//line cc.y:34 package cc import __yyfmt__ "fmt" //line cc.y:34 type typeClass struct { c Storage q TypeQual t *Type } type idecor struct { d func(*Type) (*Type, string) i *Init } //line cc.y:49 type yySymType struct { yys int abdecor func(*Type) *Type decl *Decl decls []*Decl decor func(*...
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 cc import ( "fmt" "io" "io/ioutil" "strings" ) func Read(name string, r io.Reader) (*Prog, error) { return ReadMany([]string{name}, []io.Reader{...
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 ( "flag" "fmt" "log" "os" "code.google.com/p/rsc/cc" ) func main() { log.SetFlags(0) flag.Parse() args := flag...
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 cc implements parsing, type checking, and printing of C programs. package cc
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 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. // 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. // 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 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. // 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. // 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/sparse/set.go, // tweaked for better inlinability. package main // For comparison: running cindex over the Linux ...
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(rsc): // More precise error handling. // Presence functionality. // TODO(mattn): // Add proxy authentication. // Package xmpp implements a simple Goo...
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 oauthprompt implements prompting a local user for // an OAuth token and caching the result in the user's home directory. package oauthprompt import...
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 smugmug uses the SmugMug API to manipulate photo albums // stored on smugmug.com. package smugmug import ( "bytes" "crypto/md5" "encoding/json" ...
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. // Smugup uploads a collection of photos to SmugMug. // // Run 'smugup -help' for details. package main import ( "crypto/md5" "flag" "fmt" "io/ioutil" "l...
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
package imap import ( "bytes" "fmt" "log" "regexp" "sort" "strings" "time" ) type Flags uint32 const ( FlagJunk Flags = 1 << iota FlagNonJunk FlagReplied FlagFlagged FlagDeleted FlagDraft FlagRecent FlagSeen FlagNoInferiors FlagNoSelect FlagMarked FlagUnMarked FlagHasChildren FlagHasNoChildren ...
Go
package imap // NOTE(rsc): These belong elsewhere but the existing charset // packages seem too complicated. var tab_iso8859_1 = [256]rune{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x...
Go
package imap import ( "bufio" "bytes" "crypto/md5" "crypto/tls" "fmt" "io" "log" "net" "os" "os/exec" "strconv" "strings" "sync" ) var Debug = false const tag = "#" // A Mode specifies the IMAP connection mode. type Mode int const ( Unencrypted Mode = iota // unencrypted TCP connection StartTLS ...
Go