Esempio n. 1
0
func main() {
	var (
		ver, kind string
		verList   []string
	)
	loadSpecXml()
	enumNodes, funcNodes := specDoc.SelectNodesRecursive("*", "enum"), specDoc.SelectNodesRecursive("*", "function")
	if errs := uio.NewDirWalker(true, nil, checkGoFile).Walk(util.GopathSrcGithub("go3d")); len(errs) > 0 {
		panic(errs[0])
	}
	for glName, _ := range glNames {
		kind, ver = "", ""
		for _, enode := range enumNodes {
			if enode.As("*", "name") == glName {
				ver, kind = enode.As("*", "version"), "enum"
			}
		}
		if len(ver) == 0 {
			for _, fnode := range funcNodes {
				if fnode.As("*", "name") == glName {
					ver, kind = fnode.As("*", "version"), "function"
				}
			}
		}
		if len(ver) > 0 {
			glNames[glName].glVersion, glNames[glName].nameKind = ver, kind
			if ver > "3.2" {
				if verList = glVersions[ver]; (verList == nil) || (len(verList) == 0) {
					verList = []string{}
				}
				if !inSlice(verList, glName) {
					verList = append(verList, glName)
				}
				glVersions[ver] = verList
			}
		}
	}
	for ver, verList = range glVersions {
		fmt.Printf("GL v%v used %vx:\n", ver, len(verList))
		for _, glName := range verList {
			if gni := glNames[glName]; gni != nil {
				fmt.Printf("\t%v %v:\n", gni.nameKind, glName)
				for _, filePath := range gni.filePaths {
					fmt.Printf("\t\t%v\n", filePath)
				}
			}
		}
	}
}
Esempio n. 2
0
func main() {
	flag.Parse()
	if errs := uio.NewDirWalker(true, nil, processFile).Walk(*fSrcDirPath); len(errs) > 0 {
		panic(errs[0])
	}
}
Esempio n. 3
0
func main() {
	if errs := uio.NewDirWalker(true, nil, processPreview).Walk(srcDirPath); len(errs) > 0 {
		panic(errs[0])
	}
}