code
stringlengths
10
1.34M
language
stringclasses
1 value
// 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. // Darwin system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system...
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. package syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
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. package syscall func Getpagesize() int { return 4096 } func NsecToTimeval(nsec int64) (tv Timeval) { tv.Sec = int32(nsec / 1e9); tv.Usec = int32(nsec % 1e9...
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. // Linux system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates system ...
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. package syscall //sys Chown(path string, uid int, gid int) (errno int) //sys Fchown(fd int, uid int, gid int) (errno int) //sys Fstat(fd int, stat *Stat_t) (er...
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. // This package contains an interface to the low-level operating system // primitives. The details vary depending on the underlying system. // Its primary use ...
Go
// hand generated package syscall const ( SYS_SYSCALL_BASE = 0; SYS_RESTART_SYSCALL = (SYS_SYSCALL_BASE + 0); SYS_EXIT = (SYS_SYSCALL_BASE + 1); SYS_FORK = (SYS_SYSCALL_BASE + 2); SYS_READ = (SYS_SYSCALL_BASE + 3); SYS_WRITE = (SYS_SYSCALL_BASE + 4); SYS_OPEN = (SYS_SYSCALL_BASE + 5); SYS_CLOSE ...
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. package syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
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. package syscall import "unsafe" func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ...
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. package syscall func Getpagesize() int { return 4096 } func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func NsecToTimesp...
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. package syscall func str(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { return "-" + str(-val) } var buf [32]byte;...
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. package os import ( "syscall"; ) // ForkExec forks the current process and invokes Exec with the file, arguments, // and environment specified by argv0, argv...
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. package os import "syscall" // Time returns the current time, in whole seconds and // fractional nanoseconds, plus an Error if any. The current // time is th...
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. package os func Hostname() (name string, err Error) { return "nacl", nil }
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. package os // MkdirAll creates a directory named path, // along with any necessary parents, and returns nil, // or else returns an error. // The permission bi...
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. // Process etc. package os import "syscall" var Args []string // provided by runtime var Envs []string // provided by runtime // Getuid returns the numeric...
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. package os import "syscall" func isSymlink(stat *syscall.Stat_t) bool { return stat.Mode&syscall.S_IFMT == syscall.S_IFLNK } func dirFromStat(name string, d...
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. // Linux-specific package os // Hostname returns the host name reported by the kernel. func Hostname() (name string, err Error) { f, err := Open("/proc/sys/...
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. package os import ( "syscall"; "unsafe"; ) const ( blockSize = 4096; // TODO(r): use statfs ) func clen(n []byte) int { for i := 0; i < len(n); i++ { i...
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. package os import "syscall" // An operating-system independent representation of Unix data structures. // OS-specific routines in this directory convert the O...
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. package os import "syscall" func isSymlink(stat *syscall.Stat_t) bool { return stat.Mode&syscall.S_IFMT == syscall.S_IFLNK } func dirFromStat(name string, d...
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. // Environment variables. package os import ( "once"; ) // ENOENV is the Error indicating that an environment variable does not exist. var ENOENV = NewError...
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. package os import syscall "syscall" // An Error can represent any printable error condition. type Error interface { String() string; } // A helper type that...
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. // The os package provides a platform-independent interface to operating // system functionality. The design is Unix-like. package os import ( "syscall"; ) ...
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. // Darwin-specific package os import "syscall" func Hostname() (name string, err Error) { var errno int; name, errno = syscall.Sysctl("kern.hostname"); if...
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. package os import "syscall" func isSymlink(stat *syscall.Stat_t) bool { return stat.Mode&syscall.S_IFMT == syscall.S_IFLNK } func dirFromStat(name string, d...
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. package os import ( "syscall"; "unsafe"; ) const ( blockSize = 4096; // TODO(r): use statfs ) // Readdirnames reads the contents of the directory associat...
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. package os import ( "syscall"; ) // Getwd returns a rooted path name corresponding to the // current directory. If the current directory can be // reached v...
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. package os import ( "syscall"; "unsafe"; ) const ( blockSize = 4096; // TODO(r): use statfs ) func clen(n []byte) int { for i := 0; i < len(n); i++ { i...
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. package image // TODO(nigeltao): Think about how floating-point color models work. // All Colors can convert themselves, with a possible loss of precision, to...
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. package png import ( "bufio"; "compress/zlib"; "hash/crc32"; "image"; "io"; "os"; "strconv"; ) type encoder struct { w io.Writer; m image.Image; c...
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. // The png package implements a PNG image decoder and encoder. // // The PNG specification is at http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html packag...
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. // The image package implements a basic 2-D image library. package image // An Image is a rectangular grid of Colors drawn from a ColorModel. type Image interf...
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. package ebnf import ( "container/vector"; "go/scanner"; "go/token"; "os"; "strconv"; ) type parser struct { scanner.ErrorVector; scanner scanner.Scann...
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. // A library for EBNF grammars. The input is text ([]byte) satisfying // the following grammar (represented itself in EBNF): // // Production = name "=" Expres...
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. // Parse URLs (actually URIs, but that seems overly pedantic). // RFC 2396 package http import ( "os"; "strconv"; "strings"; ) // URLError reports an erro...
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. package main import ( "bytes"; "bufio"; "expvar"; "flag"; "fmt"; "io"; "log"; "net"; "os"; "strconv"; ) // hello world, the web server var helloReq...
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. // Primitive HTTP client. See RFC 2616. package http import ( "bufio"; "fmt"; "io"; "net"; "os"; "strconv"; "strings"; ) // Response represents the re...
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. // HTTP file system request handler package http import ( "fmt"; "io"; "os"; "path"; "strings"; "utf8"; ) // TODO this should be in a mime package some...
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. // HTTP server. See RFC 2616. // TODO(rsc): // logging // cgi support // post support package http import ( "bufio"; "fmt"; "io"; "log"; "net"; "os"; ...
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. package http // HTTP status codes, defined in RFC 2616. const ( StatusContinue = 100; StatusSwitchingProtocols = 101; StatusOK = 200; StatusCreated ...
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. // HTTP Request reading and parsing. // The http package implements parsing of HTTP requests, replies, // and URLs and provides an extensible HTTP server and a...
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. // Process etc. package os import "api" var Args []string // provided by runtime var Envs []string // provided by runtime // Exit causes the current program...
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. package os // An operating-system independent representation of Unix data structures. // OS-specific routines in this directory convert the OS-local versions t...
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. package os // An Error can represent any printable error condition. type Error interface { String() string; } // A helper type that can be embedded or wrappe...
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. // The os package provides a platform-independent interface to operating // system functionality. The design is Unix-like. package os import ( "api"; ) /...
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. package api func ExitProcess(uExitCode uint32)
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. package api func CloseHandle(hObject Handle) uint32 func GetStdHandle(nStdHandle uint32) Handle func CreateFile(lpFileName []uint16, dwDesiredAccess uint32, ...
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. package api // StringByteSlice returns a NUL-terminated slice of bytes // containing the text of s. func StringByteSlice(s string) []byte { a := make([]byt...
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. /* The unsafe package contains operations that step around the type safety of Go programs. */ package unsafe // ArbitraryType is here for the purposes of docu...
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. /* The gob package manages streams of gobs - binary values exchanged between an Encoder (transmitter) and a Decoder (receiver). A typical use is transporting...
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. package gob import ( "bytes"; "io"; "os"; "sync"; ) // A Decoder manages the receipt of type and data information read from the // remote side of a connec...
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. package gob // TODO(rsc): When garbage collector changes, revisit // the allocations in this file that use unsafe.Pointer. import ( "bytes"; "io"; "math"; ...
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. package gob import ( "bytes"; "io"; "math"; "os"; "reflect"; "unsafe"; ) const uint64Size = unsafe.Sizeof(uint64(0)) // The global execution state of a...
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. package gob import ( "fmt"; "os"; "reflect"; "sync"; ) type kind reflect.Type // Reflection types are themselves interface values holding structs // desc...
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. // The testing package implements a simple regular expression library. // It is a reduced version of the regular expression package suitable // for use in tests...
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. // This package implements utility functions to help with black box testing. package quick import ( "flag"; "fmt"; "math"; "os"; "rand"; "reflect"; "str...
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. // This package aids in the testing of code that uses channels. package script import ( "fmt"; "os"; "rand"; "reflect"; "strings"; ) // An Event is an el...
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. package iotest import ( "io"; "os"; ) // TruncateWriter returns a Writer that writes to w // but stops silently after n bytes. func TruncateWriter(w io.Writ...
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. // The iotest package implements Readers and Writers // useful only for testing. package iotest import ( "io"; "os"; "bytes"; ) // OneByteReader returns a ...
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. package iotest import ( "io"; "log"; "os"; ) type writeLogger struct { prefix string; w io.Writer; } func (l *writeLogger) Write(p []byte) (n int, err o...
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. // The testing package provides support for automated testing of Go packages. // It is intended to be used in concert with the ``gotest'' utility, which automat...
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. // The iterable package provides several traversal and searching methods. // It can be used on anything that satisfies the Iterable interface, // including vect...
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. package ogle import ( "debug/proc"; "exp/eval"; "fmt"; "os"; ) // A Goroutine represents a goroutine in a remote process. type Goroutine struct { g remo...
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. package ogle import ( "debug/proc"; "exp/eval"; "fmt"; ) // A RemoteMismatchError occurs when an operation that requires two // identical remote processes...
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. package main import "exp/ogle" func main() { ogle.Main() }
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. package ogle import ( "debug/proc"; "math"; ) type Arch interface { // ToWord converts an array of up to 8 bytes in memory order // to a word. ToWord(da...
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. // Ogle is the beginning of a debugger for Go. package ogle import ( "bufio"; "debug/elf"; "debug/proc"; "exp/eval"; "fmt"; "go/scanner"; "go/token"; ...
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. package ogle import ( "debug/proc"; "exp/eval"; "reflect"; ) // This file contains remote runtime definitions. Using reflection, // we convert all of the...
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. package ogle import ( "debug/proc"; "fmt"; "os"; ) /* * Hooks and events */ // An EventHandler is a function that takes an event and returns a // respo...
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. package ogle import ( "debug/elf"; "debug/gosym"; "debug/proc"; "exp/eval"; "fmt"; "log"; "os"; "reflect"; ) // A FormatError indicates a failure to ...
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. package ogle import ( "debug/gosym"; "debug/proc"; "fmt"; "os"; ) // A Frame represents a single frame on a remote call stack. type Frame struct { // pc...
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. package ogle import ( "debug/gosym"; "debug/proc"; "exp/eval"; "log"; "os"; ) /* * Remote frame pointers */ // A NotOnStack error occurs when attempt...
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. package ogle import ( "os"; "runtime"; ) // An aborter aborts the thread's current computation, usually // passing the error to a waiting thread. type abor...
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. package ogle import ( "debug/proc"; "exp/eval"; "fmt"; "log"; ) const debugParseRemoteType = false // A remoteType is the local representation of a type...
Go
// Copyright (c) 1996 Barry Silverman, Brian Silverman, Vadim Gerasimov. // Portions Copyright (c) 2009 The Go Authors. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restricti...
Go
// This file contains the assembly language and machine code for // Spacewar!, the original PDP-1 video game. It is downloaded from // http://spacewar.oversigma.com/sources/sources.zip which has // the following notice at http://spacewar.oversigma.com/: // // Spacewar! was conceived in 1961 by Martin Graetz, Stephen R...
Go
// Copyright (c) 1996 Barry Silverman, Brian Silverman, Vadim Gerasimov. // Portions Copyright (c) 2009 The Go Authors. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restricti...
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. package eval import ( "log"; "go/token"; "reflect"; ) /* * Type bridging */ var ( evalTypes = make(map[reflect.Type]Type); nativeTypes = make(map[Typ...
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. package eval import ( "bignum"; "log"; "go/ast"; "go/token"; ) const ( returnPC = ^uint(0); badPC = ^uint(1); ) /* * Statement compiler */ type st...
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. package main import ( "./_obj/eval"; "bufio"; "flag"; "go/parser"; "go/scanner"; "io"; "os"; ) var filename = flag.String("f", "", "file to run") fun...
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. package eval import ( "bignum"; ) // TODO(austin): Maybe add to bignum in more general form func ratToString(rat *bignum.Rational) string { n, dnat := rat....
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. package eval import ( "fmt"; "go/scanner"; "go/token"; ) type positioned interface { Pos() token.Position; } // A compiler captures information used t...
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. package eval import ( "bignum"; "go/ast"; "go/token"; "log"; "strconv"; "strings"; "os"; ) // An expr is the result of compiling an expression. It st...
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. // This package is the beginning of an interpreter for Go. // It can run simple Go programs but does not implement // interface values or packages. package eva...
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. package main // generate operator implementations import ( "log"; "os"; "template"; ) type Op struct { Name string; Expr string; Body string; // ov...
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. package eval import ( "bignum"; "go/ast"; "go/token"; "log"; "reflect"; "sort"; "unsafe"; // For Sizeof ) // XXX(Spec) The type compatibility section...
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. package eval import ( "bignum"; "fmt"; ) type Value interface { String() string; // Assign copies another value into this one. It should // assume that...
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. package eval import ( "go/ast"; "go/token"; "log"; ) /* * Type compiler */ type typeCompiler struct { *compiler; block *block; // Check to be perfo...
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. package eval import "os" /* * Virtual machine */ type Thread struct { abort chan os.Error; pc uint; // The execution frame of this function. This rema...
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. package eval import ( "go/token"; "log"; ) /* * Blocks and scopes */ // A definition can be a *Variable, *Constant, or Type. type Def interface { Pos()...
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. package eval import ( "fmt"; "os"; "runtime"; ) // Abort aborts the thread's current computation, // causing the innermost Try to return err. func (t *Thr...
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. package draw import "image" // A Color represents a color with 8-bit R, G, B, and A values, // packed into a uint32—0xRRGGBBAA—so that comparison // is defin...
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. package draw // A Point is an X, Y coordinate pair. type Point struct { X, Y int; } // ZP is the zero Point. var ZP Point // A Rectangle contains the Point...
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. // Package draw provides basic graphics and drawing primitives, // in the style of the Plan 9 graphics library // (see http://plan9.bell-labs.com/magic/man2htm...
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. package draw // A Context represents a single graphics window. type Context interface { // Screen returns an editable Image of window. Screen() Image; // ...
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. // Native Client audio/video // Package av implements audio and video access for Native Client // binaries running standalone or embedded in a web browser win...
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. // NaCl GUI events. // Clients do not have raw access to the event stream // (only filtered through the lens of package draw) // but perhaps they will. packag...
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. package av import ( "image"; ) // Native Client image format: // a single linear array of 32-bit ARGB as packed uint32s. // An Image represents a Native Cl...
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. // This package implements Native Client's simple RPC (SRPC). package srpc import ( "bytes"; "log"; "os"; "sync"; ) // A Client represents the client sid...
Go