/*** parser for VMware Fusion's networking file */
355530
func tokenizeNetworkingConfig(eof sentinelSignaller, in chan byte) (chan string, sentinelSignaller) {
	var ch byte
	var state string
	var repeat_newline bool

	eot := make(sentinelSignaller)

	out := make(chan string)
	go func(out chan string) {
		for reading := true; reading; {
			select {
			case <-eof:
				reading = false

			case ch = <-in:
				switch ch {
				case '\r':
					fallthrough
				case '\t':
					fallthrough
				case ' ':
					if len(state) == 0 {
						continue
					}
					out <- state
					state = ""
				case '\n':
					if repeat_newline {
						continue
					}
					if len(state) > 0 {
						out <- state
					}
					out <- string(ch)
					state = ""
					repeat_newline = true
					continue
				default:
					state += string(ch)
				}
				repeat_newline = false
			}
		}
		if len(state) > 0 {
			out <- state
		}
		close(eot)
	}(out)
	return out, eot
}
1100604
func (ini *INI) ParseFile(filename string) error {
    contents, err := ioutil.ReadFile(filename)
    if err != nil {
        return err
    }
    ini.parseSection = true
    ini.skipCommits = true
    return ini.parseINI(contents, DefaultLineSeparator, DefaultKeyValueSeparator)
}
55686
func (d *Decoder) ParseFile(filename string) error {
	d.filename = filename
	defer func() { d.filename = "" }()

	r, err := os.Open(filename)
	if err != nil {
		return err
	}
	defer r.Close()
	content, err := ioutil.ReadAll(r)
	if err != nil {
		return err
	}
	return d.ParseString(string(content))
}
387926
func main() {
	file, _ := avutil.Open("projectindex.flv")
	conn, _ := rtmp.Dial("rtmp://localhost:1936/app/publish")
	// conn, _ := avutil.Create("rtmp://localhost:1936/app/publish")

	demuxer := &pktque.FilterDemuxer{Demuxer: file, Filter: &pktque.Walltime{}}
	avutil.CopyFile(conn, demuxer)

	file.Close()
	conn.Close()
}
975350
func ParseFile(filename string) (interface{}, error) {
	var (
		bytes []byte
		err   error
	)
	if bytes, err = ioutil.ReadFile(filename); err != nil {
		return nil, err
	}
	return Parse(bytes)
}
620437
func (c *Conn) ParseDefaultConfigEnv() error {
	ret := C.rados_conf_parse_env(c.cluster, nil)
	if ret == 0 {
		return nil
	} else {
		return RadosError(int(ret))
	}
}
627343
func (c *Conf) Parse(path string) {
	c.loadDefaults()

	if path == "" {
		log.Info("Loaded configuration defaults")
		return
	}

	if _, err := toml.DecodeFile(path, c); err != nil {
		panic(err)
	}
}
975430
func ParseFile(path string) (config Config, err error) {
	var file *os.File
	file, err = os.Open(path) //nolint:gosec
	if err != nil {
		return
	}
	defer file.Close() // nolint: errcheck
	return Parse(file)
}
1366996
func parseConnectionInfo(s *terraform.InstanceState) (*connectionInfo, error) {
	connInfo := &connectionInfo{}
	decConf := &mapstructure.DecoderConfig{
		WeaklyTypedInput: true,
		Result:           connInfo,
	}
	dec, err := mapstructure.NewDecoder(decConf)
	if err != nil {
		return nil, err
	}
	if err := dec.Decode(s.Ephemeral.ConnInfo); err != nil {
		return nil, err
	}

	// Check on script paths which point to the default Windows TEMP folder because files
	// which are put in there very early in the boot process could get cleaned/deleted
	// before you had the change to execute them.
	//
	// TODO (SvH) Needs some more debugging to fully understand the exact sequence of events
	// causing this...
	if strings.HasPrefix(filepath.ToSlash(connInfo.ScriptPath), "C:/Windows/Temp") {
		return nil, fmt.Errorf(
			`Using the C:\Windows\Temp folder is not supported. Please use a different 'script_path'.`)
	}

	if connInfo.User == "" {
		connInfo.User = DefaultUser
	}

	// Format the host if needed.
	// Needed for IPv6 support.
	connInfo.Host = shared.IpFormat(connInfo.Host)

	if connInfo.Port == 0 {
		if connInfo.HTTPS {
			connInfo.Port = DefaultHTTPSPort
		} else {
			connInfo.Port = DefaultPort
		}
	}
	if connInfo.ScriptPath == "" {
		connInfo.ScriptPath = DefaultScriptPath
	}
	if connInfo.Timeout != "" {
		connInfo.TimeoutVal = safeDuration(connInfo.Timeout, DefaultTimeout)
	} else {
		connInfo.TimeoutVal = DefaultTimeout
	}

	return connInfo, nil
}
294821
func (cniApp *cniAppInfo) parseNwInfoLabels() {

	var cniNetInfo struct {
		Args struct {
			Mesos struct {
				NetworkInfo struct {
					Labels struct {
						NwLabel []cniapi.NetworkLabel `json:"labels"`
					} `json:"labels"`
				} `json:"network_info"`
			} `json:"org.apache.mesos"`
		} `json:"args"`
	}

	cniLog.Infof("parse config file %s ", cniApp.netcfgFile)
	cfgFile, err := ioutil.ReadFile(cniApp.netcfgFile)

	if err != nil {
		cniLog.Warnf("%s", err)
		return
	}

	if err := json.Unmarshal(cfgFile, &cniNetInfo); err != nil {
		cniLog.Errorf("failed to parse %s, %s", cniApp.netcfgFile, err)
		return
	}

	for idx, elem := range cniNetInfo.Args.Mesos.NetworkInfo.Labels.NwLabel {
		cniLog.Infof("configured labels [%d] {key: %s, val: %s}", idx,
			elem.Key, elem.Value)

		// copy netplugin related labels
		switch elem.Key {
		case cniapi.LabelTenantName:
			cniApp.cniMesosAttr.Labels.TenantName = elem.Value

		case cniapi.LabelNetworkName:
			cniApp.cniMesosAttr.Labels.NetworkName = elem.Value

		case cniapi.LabelNetworkGroup:
			cniApp.cniMesosAttr.Labels.NetworkGroup = elem.Value
		}
	}
}
181643
func ParseOneCloud(data []byte) (Cloud, error) {
	c := &cloud{}
	if err := yaml.Unmarshal(data, &c); err != nil {
		return Cloud{}, errors.Annotate(err, "cannot unmarshal yaml cloud metadata")
	}
	return cloudFromInternal(c), nil
}
1272237
func (p *fileParser) parsePackage(path string) error {
	var pkgs map[string]*ast.Package
	if imp, err := build.Import(path, p.srcDir, build.FindOnly); err != nil {
		return err
	} else if pkgs, err = parser.ParseDir(p.fileSet, imp.Dir, nil, 0); err != nil {
		return err
	}
	for _, pkg := range pkgs {
		file := ast.MergePackageFiles(pkg, ast.FilterFuncDuplicates|ast.FilterUnassociatedComments|ast.FilterImportDuplicates)
		if _, ok := p.importedInterfaces[path]; !ok {
			p.importedInterfaces[path] = make(map[string]*ast.InterfaceType)
		}
		for ni := range iterInterfaces(file) {
			p.importedInterfaces[path][ni.name.Name] = ni.it
		}
		imports, _ := importsOfFile(file)
		for pkgName, pkgPath := range imports {
			if _, ok := p.imports[pkgName]; !ok {
				p.imports[pkgName] = pkgPath
			}
		}
	}
	return nil
}
152721
func jsonnet_evaluate_file(vmRef *C.struct_JsonnetVm, filename *C.char, e *C.int) *C.char {
	f := C.GoString(filename)
	data, err := ioutil.ReadFile(f)
	if err != nil {
		*e = 1
		// TODO(sbarzowski) make sure that it's ok allocation-wise
		return C.CString(fmt.Sprintf("Failed to read input file: %s: %s", f, err.Error()))
	} else {
		return evaluateSnippet(vmRef, f, string(data), e)
	}
}
403738
func ParseCloudMetadataFile(file string) (map[string]Cloud, error) {
	data, err := ioutil.ReadFile(file)
	if err != nil {
		return nil, err
	}
	clouds, err := ParseCloudMetadata(data)
	if err != nil {
		return nil, err
	}
	return clouds, err
}
672390
func CloudProviderConfigParse(filePath string) (*CloudBackupConfig, error) {

	config := &CloudBackupConfig{}
	data, err := ioutil.ReadFile(filePath)
	if err != nil {
		return nil, fmt.Errorf("Unable to read the Cloud backup configuration file (%s): %s", filePath, err.Error())
	}
	if err := yaml.Unmarshal(data, config); err != nil {
		return nil, fmt.Errorf("Unable to parse Cloud backup configuration: %s", err.Error())
	}
	return config, nil

}
1044743
func ParseFile(filePath string, root Root) error {
	workDir, fileName := filepath.Split(filePath)
	_, err := ParseReadFile(workDir, fileName, root)
	return err
}
1012116
func ParseFile(f string) (*File, error) {
	fs := token.NewFileSet()
	if !strings.HasSuffix(f, ".go") {
		return nil, errors.New("Invalid file, file suffix not .go")
	}
	parsed, err := parser.ParseFile(fs, f, nil, parser.ParseComments)
	if err != nil {
		//log.Fatalf("parsing file: %s: %s", f, err)
		return nil, errors.New(fmt.Sprintf("go/parser.ParseFile error \"%v\"", err))
	}
	file := File{ast: parsed, pathName: f, fs: fs}
	file.Check()
	return &file, nil
}