Skip to content

Commit

Permalink
discovery/avahi: package moved into its separate repository
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpevzner committed Aug 13, 2024
1 parent a182410 commit 519dc40
Show file tree
Hide file tree
Showing 31 changed files with 158 additions and 53 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tags
*.swp
*.orig
coverage.out
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
BSD 2-Clause License

Copyright (c) 2024, Alexander Pevzner

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ../../Rules.mak
include Rules.mak
100 changes: 100 additions & 0 deletions Rules.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# CGo binding for Avahi
#
# Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
# See LICENSE for license terms and conditions
#
# Common part for Makefiles

# ----- Environment -----

TOPDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
GOFILES := $(wildcard *.go)
GOTESTS := $(wildcard *_test.go)
PACKAGE := $(shell basename $(shell pwd))

# ----- Parameters -----

GO := go
GOTAGS := $(shell which gotags 2>/dev/null)
GOLINT := $(shell which golint 2>/dev/null)

# ----- Common targets -----

.PHONY: all
.PHONY: clean
.PHONY: cover
.PHONY: tags
.PHONY: test
.PHONY: vet

# Recursive targets
all: subdirs_all do_all
clean: subdirs_clean do_clean
lint: subdirs_lint do_lint
test: subdirs_test do_test
vet: subdirs_vet do_vet

# Non-recursive targets
cover: do_cover

# Dependencies
do_all: tags

# Default actions
tags:
do_all:
do_clean:
do_cover:
do_lint:
do_test:
do_vet:

# Conditional actions
ifneq ($(GOFILES),)

do_all:
$(GO) build
ifneq ($(GOTESTS),)
$(GO) test -c
rm -f $(PACKAGE).test
endif

do_cover:
ifneq ($(GOTESTS),)
go test -coverprofile=coverage.out
go tool cover -html=coverage.out
rm -f coverage.out
endif

do_lint:
ifneq ($(GOLINT),)
$(GOLINT) -set_exit_status
endif

do_test:
ifneq ($(GOTESTS),)
$(GO) test
endif

do_vet:
$(GO) vet

endif

ifneq ($(GOTAGS),)
tags:
cd $(TOPDIR); gotags -R . > tags
endif

ifneq ($(CLEAN),)
do_clean:
rm -f $(CLEAN)
endif

# ----- Subdirs handling

subdirs_all subdirs_lint subdirs_test subdirs_vet subdirs_clean:
@for i in $(SUBDIRS); do \
$(MAKE) -C $$i $(subst subdirs_,,$@) || exit 1; \
done

3 changes: 1 addition & 2 deletions addressresolver.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions avahi_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions browserevent.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions clientstate.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions closer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions dns.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions domainbrowser.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions entrygroup.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions entrygroupstate.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions err.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions eventqueue.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions glue.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module go-avahi

go 1.18
3 changes: 1 addition & 2 deletions hostnameresolver.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions ifindex.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions localhost.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions lookupflags.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions loopback.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions protocol.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions publishiflags.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions recordbrowser.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions resolverevent.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions servicebrowser.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions serviceresolver.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down
3 changes: 1 addition & 2 deletions servicetypebrowser.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// MFP - Miulti-Function Printers and scanners toolkit
// Cgo binding for Avahi
// CGo binding for Avahi
//
// Copyright (C) 2024 and up by Alexander Pevzner ([email protected])
// See LICENSE for license terms and conditions
Expand Down

0 comments on commit 519dc40

Please sign in to comment.