// RawMode places the terminal into raw mode.
322326
func RawMode(t *Term) error {
	var a attr
	if err := termios.Tcgetattr(uintptr(t.fd), (*syscall.Termios)(&a)); err != nil {
		return err
	}
	termios.Cfmakeraw((*syscall.Termios)(&a))
	return termios.Tcsetattr(uintptr(t.fd), termios.TCSANOW, (*syscall.Termios)(&a))
}
960631
func (c *Config) rawConfigs() map[string]*RawConfig {
	result := make(map[string]*RawConfig)
	for _, m := range c.Modules {
		source := fmt.Sprintf("module '%s'", m.Name)
		result[source] = m.RawConfig
	}

	for _, pc := range c.ProviderConfigs {
		source := fmt.Sprintf("provider config '%s'", pc.Name)
		result[source] = pc.RawConfig
	}

	for _, rc := range c.Resources {
		source := fmt.Sprintf("resource '%s'", rc.Id())
		result[source+" count"] = rc.RawCount
		result[source+" config"] = rc.RawConfig

		for i, p := range rc.Provisioners {
			subsource := fmt.Sprintf(
				"%s provisioner %s (#%d)",
				source, p.Type, i+1)
			result[subsource] = p.RawConfig
		}
	}

	for _, o := range c.Outputs {
		source := fmt.Sprintf("output '%s'", o.Name)
		result[source] = o.RawConfig
	}

	return result
}
105623
func (m *Meta) InputMode() terraform.InputMode {
	if test || !m.input {
		return 0
	}

	if envVar := os.Getenv(InputModeEnvVar); envVar != "" {
		if v, err := strconv.ParseBool(envVar); err == nil {
			if !v {
				return 0
			}
		}
	}

	var mode terraform.InputMode
	mode |= terraform.InputModeProvider
	mode |= terraform.InputModeVar
	mode |= terraform.InputModeVarUnset

	return mode
}
535009
func (s GeoDistanceSort) SortMode(sortMode string) GeoDistanceSort {
	s.sortMode = &sortMode
	return s
}
1226346
func syscallMode(i os.FileMode) (o uint32) {
	o |= uint32(i.Perm())
	if i&os.ModeSetuid != 0 {
		o |= unix.S_ISUID
	}
	if i&os.ModeSetgid != 0 {
		o |= unix.S_ISGID
	}
	if i&os.ModeSticky != 0 {
		o |= unix.S_ISVTX
	}
	return
}
748128
func (s *StringCodeGenerator) FeedMode(feedMode int) {
	switch feedMode {
	case vm.FeedModeInvTime:
		s.put("G93")
	case vm.FeedModeUnitsMin:
		s.put("G94")
	case vm.FeedModeUnitsRev:
		s.put("G95")
	default:
		panic("Unknown feed mode")
	}
}
730878
func (s *M2tsSettings) SetRateMode(v string) *M2tsSettings {
	s.RateMode = &v
	return s
}
832536
func StringToRunMode(s string) (RunMode, error) {
	switch s {
	case string(DevelRunMode):
		return DevelRunMode, nil
	case string(ProductionRunMode):
		return ProductionRunMode, nil
	case string(StagingRunMode):
		return StagingRunMode, nil
	case "":
		return NoRunMode, nil
	default:
		return NoRunMode, fmt.Errorf("unknown run mode: '%s'", s)
	}
}
307616
func (i *UI) rawRead(f *os.File) (string, error) {

	// MakeRaw put the terminal connected to the given file descriptor
	// into raw mode
	fd := int(f.Fd())
	if !terminal.IsTerminal(fd) {
		return "", fmt.Errorf("file descriptor %d is not a terminal", fd)
	}

	oldState, err := terminal.MakeRaw(fd)
	if err != nil {
		return "", err
	}
	defer terminal.Restore(fd, oldState)

	return i.rawReadline(f)
}
954908
func (n *NetworkOpt) NetworkMode() string {
	networkIDOrName := "default"
	netOptVal := n.Value()
	if len(netOptVal) > 0 {
		networkIDOrName = netOptVal[0].Target
	}
	return networkIDOrName
}
1331483
func (o *GetOptions) raw(f cmdutil.Factory) error {
	restClient, err := f.RESTClient()
	if err != nil {
		return err
	}

	stream, err := restClient.Get().RequestURI(o.Raw).Stream()
	if err != nil {
		return err
	}
	defer stream.Close()

	_, err = io.Copy(o.Out, stream)
	if err != nil && err != io.EOF {
		return err
	}
	return nil
}
370754
func (s *TracingConfig) SetMode(v string) *TracingConfig {
	s.Mode = &v
	return s
}
817674
func (dep Departure) Mode() (mode TransportMode, err error) {
	return parseMode(dep.Line)
}
1192310
func (s *TaskDefinition) SetPidMode(v string) *TaskDefinition {
	s.PidMode = &v
	return s
}
1171152
func SetMode(value string) {
	switch value {
	case DebugMode, "":
		ginMode = debugCode
	case ReleaseMode:
		ginMode = releaseCode
	case TestMode:
		ginMode = testCode
	default:
		panic("gin mode unknown: " + value)
	}
	if value == "" {
		value = DebugMode
	}
	modeName = value
}
437582
func (w *mlWriter) Raw(raw string) error {
	w.writeIndent(true)
	if err := w.activePlugin().Raw(raw); err != nil {
		return err
	}
	w.writeNewline()
	return nil
}
695852
func (s *ImportDocumentationPartsInput) SetMode(v string) *ImportDocumentationPartsInput {
	s.Mode = &v
	return s
}