// Registers my luaList type to given L.
481157
func registerLuaListType(L *lua.LState) {
	mt := L.NewTypeMetatable(luaLuaListTypeName)

	// List package
	L.SetGlobal("List", mt)

	// static attributes

	L.SetMetatable(mt, mt)

	// list package
	mt = L.NewTypeMetatable(luaLuaListTypeName)
	L.SetGlobal("list", mt)

	// static attributes
	L.SetField(mt, "__call", L.NewFunction(newLuaList))
	L.SetField(mt, "create", L.NewFunction(createLuaList))

	L.SetField(mt, "size", L.NewFunction(luaListSize))
	L.SetField(mt, "insert", L.NewFunction(luaListInsert))
	L.SetField(mt, "append", L.NewFunction(luaListAppend))
	L.SetField(mt, "prepend", L.NewFunction(luaListPrepend))
	L.SetField(mt, "take", L.NewFunction(luaListTake))
	L.SetField(mt, "remove", L.NewFunction(luaListRemove))
	L.SetField(mt, "drop", L.NewFunction(luaListDrop))
	L.SetField(mt, "trim", L.NewFunction(luaListTrim))
	L.SetField(mt, "clone", L.NewFunction(luaListClone))
	L.SetField(mt, "concat", L.NewFunction(luaListConcat))
	L.SetField(mt, "merge", L.NewFunction(luaListMerge))
	L.SetField(mt, "iterator", L.NewFunction(luaListIterator))

	// methods
	L.SetFuncs(mt, map[string]lua.LGFunction{
		"__index":    luaListIndex,
		"__newindex": luaListNewIndex,
		"__len":      luaListLen,
		"__tostring": luaListToString,
	})

	L.SetMetatable(mt, mt)
}
383754
func (d *Downloader) RegisterLightPeer(id string, version int, peer LightPeer) error {
	return d.RegisterPeer(id, version, &lightPeerWrapper{peer})
}
238090
func registerLuaAerospikeType(L *lua.LState) {
	mt := L.NewTypeMetatable(luaLuaAerospikeTypeName)

	L.SetGlobal("aerospike", mt)

	// static attributes
	L.SetField(mt, "log", L.NewFunction(luaAerospikeLog))

	L.SetMetatable(mt, mt)
}
4607
func (decoder *HTTPDecoder) Register(f DecoderFunc, contentTypes ...string) {
	p := newDecodePool(f)

	for _, contentType := range contentTypes {
		mediaType, _, err := mime.ParseMediaType(contentType)
		if err != nil {
			mediaType = contentType
		}
		decoder.pools[mediaType] = p
	}
}
1070355
func (d *Dispatcher) Register(etype Type, callback Callback) {
	if callback == nil {
		return
	}

	d.Lock()
	defer d.Unlock()
	d.callbacks[etype] = append(d.callbacks[etype], callback)
}
335204
func RegisterLTSVEncoder() error {
	return zap.RegisterEncoder("ltsv",
		func(cfg zapcore.EncoderConfig) (zapcore.Encoder, error) {
			return NewLTSVEncoder(cfg), nil
		})
}
1167504
func Register(trigger string, args ...interface{}) {
	tl.Lock()
	defer tl.Unlock()

	var f interface{}
	var priority int

	if len(args) >= 2 {
		priority, _ = args[0].(int)
		f = args[1]
	} else {
		priority = 0
		f = args[0]
	}

	str := args[len(args)-1]

	// if the last element you pass in is a string, and not a function, then lets default to exec
	if _, isString := str.(string); isString {
		f = func(i interface{}) {
			payload, err := json.Marshal(i)
			if err != nil {
				return
			}

			in := bytes.NewReader(payload)
			cmd := exec.Command("bash", "-c", str.(string))
			cmd.Stdin = in

			if results, err := cmd.Output(); err == nil {
				json.Unmarshal(results, &i)
			}
		}
	}

	_, exists := triggers[trigger]
	if !exists {
		triggers[trigger] = make(map[int][]interface{})
		for p := 0; p <= 100; p++ {
			triggers[trigger][p] = make([]interface{}, 0)
		}
	}
	triggers[trigger][priority] = append(triggers[trigger][priority], f)
}
322118
func Register(style *chroma.Style) *chroma.Style {
	Registry[style.Name] = style
	return style
}
948098
func (c *CodecMsgpack) RegisterType(rt reflect.Type, code ExtCode) {
	c.h.(*codec.MsgpackHandle).SetExt(rt, uint64(code), ext{c.ExtCodec})
}
1081901
func register(kq int, fds []int, flags int, fflags uint32) error {
	changes := make([]unix.Kevent_t, len(fds))

	for i, fd := range fds {
		// SetKevent converts int to the platform-specific types:
		unix.SetKevent(&changes[i], fd, unix.EVFILT_VNODE, flags)
		changes[i].Fflags = fflags
	}

	// register the events
	success, err := unix.Kevent(kq, changes, nil, nil)
	if success == -1 {
		return err
	}
	return nil
}
1124186
func (l *LARS) RegisterCustomHandler(customType interface{}, fn CustomHandlerFunc) {

	if l.customHandlersFuncs == nil {
		l.customHandlersFuncs = make(customHandlers)
	}

	t := reflect.TypeOf(customType)

	if _, ok := l.customHandlersFuncs[t]; ok {
		panic(fmt.Sprint("Custom Type + CustomHandlerFunc already declared: ", t))
	}

	l.customHandlersFuncs[t] = fn
}
157508
func (t *connTable) Register(ck ckey, matchedRule *Rule, srcIP, srcPort string, targetPort layers.TCPPort) {
	t.mtx.Lock()
	defer t.mtx.Unlock()

	if _, ok := t.table[ck]; ok {
		// TODO: wut?
	} else {
		logger.Debugf("[contable] registering %s:%s->%d", srcIP, srcPort, targetPort)

		t.table[ck] = &Metadata{
			Added:      time.Now(),
			Rule:       matchedRule,
			TargetPort: targetPort,
			//TargetIP:   targetIP,
		}
	}
}
818304
func (L *State) register(f interface{}) uint {
	//fmt.Printf("Registering %v\n")
	index, ok := L.getFreeIndex()
	//fmt.Printf("\tfreeindex: index = %v, ok = %v\n", index, ok)
	//if not ok, then we need to add new index by extending the slice
	if !ok {
		index = uint(len(L.registry))
		//reallocate backing array if necessary
		if index+1 > uint(cap(L.registry)) {
			newSlice := make([]interface{}, index, cap(L.registry)*2)
			copy(newSlice, L.registry)
			L.registry = newSlice
		}
		//reslice
		L.registry = L.registry[0 : index+1]
	}
	//fmt.Printf("\tregistering %d %v\n", index, f)
	L.registry[index] = f
	return index
}
922818
func Register(lexer chroma.Lexer) chroma.Lexer {
	config := lexer.Config()
	Registry.byName[config.Name] = lexer
	Registry.byName[strings.ToLower(config.Name)] = lexer
	for _, alias := range config.Aliases {
		Registry.byAlias[alias] = lexer
		Registry.byAlias[strings.ToLower(alias)] = lexer
	}
	Registry.Lexers = append(Registry.Lexers, lexer)
	return lexer
}
895540
func Register(t string, f ReadWriteFormatter) {
	if f == nil {
		log.FatalLog("format/REGISTER_FORMATTER",
			"Failed to register nil formatter for: ", t)
	}

	if _, dup := formatters[t]; dup {
		log.FatalLog("format/REGISTER_FORMATTER",
			"Failed to register duplicate formatter for: ", t)
	}

	formatters[t] = f
}
31191
func Register(scheme string, fn func(*url.URL) (*ConnectionHelper, error)) {
	helpers[scheme] = fn
}
538341
func Register(distType Type, f newDistribution) {
	if _, ok := distributions[distType]; ok {
		panic(fmt.Errorf("distribution %q already registered", distType))
	}
	distributions[distType] = f
}