Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
1570-snmp-Types-and-specs-for-snmp_index-new-1-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1570-snmp-Types-and-specs-for-snmp_index-new-1-2.patch of Package erlang
From 75a0faaa4149deff6f9f4598f98a5734eae1cbc5 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Mon, 15 Jan 2024 17:30:10 +0100 Subject: [PATCH 50/67] [snmp] Types and specs for snmp_index:new/1,2 --- lib/snmp/doc/src/snmp_index.xml | 10 +++------- lib/snmp/src/agent/snmp_index.erl | 12 +++++++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/snmp/doc/src/snmp_index.xml b/lib/snmp/doc/src/snmp_index.xml index 95685399c0..fc410f5217 100644 --- a/lib/snmp/doc/src/snmp_index.xml +++ b/lib/snmp/doc/src/snmp_index.xml @@ -299,15 +299,11 @@ get_next_pid(Oid, SnmpIndex) -> </func> <func> - <name since="">new(KeyTypes) -> Index</name> + <name name="new" arity="1" clause_i="1" since=""/> + <name name="new" arity="2" clause_i="1" since=""/> <fsummary>Create a new snmp index structure</fsummary> - <type> - <v>KeyTypes = key_types()</v> - <v>Index = index()</v> - </type> <desc> - <p>Creates a new snmp index structure. The <c>key_types()</c> - type is described above.</p> + <p>Creates a new snmp index structure. </p> </desc> </func> </funcs> diff --git a/lib/snmp/src/agent/snmp_index.erl b/lib/snmp/src/agent/snmp_index.erl index 9fd082f849..b0c6448783 100644 --- a/lib/snmp/src/agent/snmp_index.erl +++ b/lib/snmp/src/agent/snmp_index.erl @@ -61,14 +61,24 @@ %%----------------------------------------------------------------- %% Args: KeyTypes = key() | {key(), ...} %% key() = integer | string | fix_string -%% Returns: handle() +%% Returns: index() %%----------------------------------------------------------------- +-spec new(KeyTypes) -> Index when + KeyTypes :: key_types(), + Index :: index(). + new(KeyTypes) -> ?vlog("new -> entry with" "~n KeyTypes: ~p", [KeyTypes]), do_new(KeyTypes, ?MODULE, [public, ordered_set]). + +-spec new(KeyTypes, Name) -> Index when + KeyTypes :: key_types(), + Name :: atom(), + Index :: index(). + new(KeyTypes, Name) when is_atom(Name) -> ?vlog("new -> entry with" "~n KeyTypes: ~p" -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor