aboutsummaryrefslogtreecommitdiffstats
path: root/c_lhosts.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-09 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-09 20:20:20 +0100
commit6f866cf8feb9d5c7707e337c6edb2335c1fa16d8 (patch)
treef471d53f293ad2991d9b241721323eb277a028d7 /c_lhosts.go
parentclean (diff)
downloadhardflip-6f866cf8feb9d5c7707e337c6edb2335c1fa16d8.tar.gz
hardflip-6f866cf8feb9d5c7707e337c6edb2335c1fa16d8.tar.bz2
hardflip-6f866cf8feb9d5c7707e337c6edb2335c1fa16d8.tar.xz
hardflip-6f866cf8feb9d5c7707e337c6edb2335c1fa16d8.tar.zst
hardflip-6f866cf8feb9d5c7707e337c6edb2335c1fa16d8.zip
folding visually
Diffstat (limited to 'c_lhosts.go')
-rw-r--r--c_lhosts.go47
1 files changed, 28 insertions, 19 deletions
diff --git a/c_lhosts.go b/c_lhosts.go
index 4041279..80fbdbc 100644
--- a/c_lhosts.go
+++ b/c_lhosts.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/c_lhosts.go
- * Tue Jan 09 11:16:59 2024
+ * Tue Jan 09 12:07:53 2024
* Joe
*
* the hosts linked list
@@ -54,28 +54,28 @@ package main
// 0: ssh
// 1: rdp
type HostNode struct {
- ID int
- Protocol int8 `yaml:"type"`
- Name string `yaml:"name"`
- Host string `yaml:"host"`
- Port uint16 `yaml:"port"`
- User string `yaml:"user"`
- Pass string `yaml:"pass"`
- Priv string `yaml:"priv"`
- Jump string `yaml:"jump"`
+ ID int
+ Protocol int8 `yaml:"type"`
+ Name string `yaml:"name"`
+ Host string `yaml:"host"`
+ Port uint16 `yaml:"port"`
+ User string `yaml:"user"`
+ Pass string `yaml:"pass"`
+ Priv string `yaml:"priv"`
+ Jump string `yaml:"jump"`
JumpPort uint16 `yaml:"jump_port"`
JumpUser string `yaml:"jump_user"`
JumpPass string `yaml:"jump_pass"`
JumpPriv string `yaml:"jump_priv"`
- Quality uint8 `yaml:"quality"`
- Domain string `yaml:"domain"`
- Width uint16 `yaml:"width"`
- Height uint16 `yaml:"height"`
- Dynamic bool `yaml:"dynamic"`
- Note string `yaml:"note"`
- Filename string
- Parent *DirsNode
- next *HostNode
+ Quality uint8 `yaml:"quality"`
+ Domain string `yaml:"domain"`
+ Width uint16 `yaml:"width"`
+ Height uint16 `yaml:"height"`
+ Dynamic bool `yaml:"dynamic"`
+ Note string `yaml:"note"`
+ Filename string
+ Parent *DirsNode
+ next *HostNode
}
type HostList struct {
@@ -166,3 +166,12 @@ func (host *HostNode) protocol_str() string {
default: return ""
}
}
+
+func (host *HostNode) folded_parents() bool {
+ for ptr := host.Parent; ptr.Parent != nil; ptr = ptr.Parent {
+ if ptr.Folded == true {
+ return true
+ }
+ }
+ return false
+}