Reformatted code
This commit is contained in:
22
gomilter.go
22
gomilter.go
@@ -24,14 +24,14 @@ package gomilter
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
"encoding/binary"
|
||||
"reflect"
|
||||
"os"
|
||||
"strings"
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/gob"
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type sockaddr_in struct {
|
||||
@@ -193,7 +193,6 @@ func GobDecode(buf []byte, data interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
// ********* Filter Callback functions *********
|
||||
// These are registered with Milter
|
||||
// They are only called if they get registered but need to be defined anyway
|
||||
@@ -491,7 +490,7 @@ func AddHeader(ctx uintptr, headerf, headerv string) int {
|
||||
defer C.free(unsafe.Pointer(cheaderv))
|
||||
|
||||
// Call smfi_addheader
|
||||
return int(C.smfi_addheader(int2ctx(ctx), cheaderf, cheaderv));
|
||||
return int(C.smfi_addheader(int2ctx(ctx), cheaderf, cheaderv))
|
||||
}
|
||||
|
||||
func ChgHeader(ctx uintptr, headerf string, hdridx int, headerv string) int {
|
||||
@@ -504,7 +503,7 @@ func ChgHeader(ctx uintptr, headerf string, hdridx int, headerv string) int {
|
||||
defer C.free(unsafe.Pointer(cheaderv))
|
||||
|
||||
// Call smfi_chgheader
|
||||
return int(C.smfi_chgheader(int2ctx(ctx), cheaderf, C.int(hdridx), cheaderv));
|
||||
return int(C.smfi_chgheader(int2ctx(ctx), cheaderf, C.int(hdridx), cheaderv))
|
||||
}
|
||||
|
||||
func InsHeader(ctx uintptr, hdridx int, headerf, headerv string) int {
|
||||
@@ -517,10 +516,9 @@ func InsHeader(ctx uintptr, hdridx int, headerf, headerv string) int {
|
||||
defer C.free(unsafe.Pointer(cheaderv))
|
||||
|
||||
// Call smfi_insheader
|
||||
return int(C.smfi_insheader(int2ctx(ctx), C.int(hdridx), cheaderf, cheaderv));
|
||||
return int(C.smfi_insheader(int2ctx(ctx), C.int(hdridx), cheaderf, cheaderv))
|
||||
}
|
||||
|
||||
|
||||
func ChgFrom(ctx uintptr, mail, args string) int {
|
||||
/* Change the envelope sender address. SMFIF_CHGFROM
|
||||
*/
|
||||
@@ -595,8 +593,6 @@ func progress(ctx uintptr) int {
|
||||
|
||||
// ********* Run the milter *********
|
||||
|
||||
|
||||
|
||||
func Run(amilter Milter) int {
|
||||
milter = amilter
|
||||
if milter.GetDebug() {
|
||||
|
||||
@@ -15,13 +15,10 @@ Sample Milter
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
"."
|
||||
"fmt"
|
||||
|
||||
)
|
||||
|
||||
|
||||
type Mymilter struct {
|
||||
gomilter.MilterRaw // Embed the basic functionality. No callbacks yet
|
||||
}
|
||||
|
||||
@@ -7,10 +7,8 @@ Copyright (c) 2015 Leon Baker
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
m "github.com/leonrbaker/gomilter"
|
||||
"fmt"
|
||||
|
||||
m "github.com/leonrbaker/gomilter"
|
||||
)
|
||||
|
||||
type Mymilter struct {
|
||||
|
||||
Reference in New Issue
Block a user