]> granicus.if.org Git - ejabberd/commitdiff
Deprecate jlib:integer_to_binary/1 and jlib:binary_to_integer/1
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sat, 24 Sep 2016 20:34:28 +0000 (23:34 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Sat, 24 Sep 2016 20:34:28 +0000 (23:34 +0300)
32 files changed:
src/cyrsasl_anonymous.erl
src/ejabberd_c2s.erl
src/ejabberd_captcha.erl
src/ejabberd_commands_doc.erl
src/ejabberd_http.erl
src/ejabberd_http_bind.erl
src/ejabberd_sm_sql.erl
src/ejabberd_sql.erl
src/ejabberd_system_monitor.erl
src/ejabberd_web_admin.erl
src/jd2ejd.erl
src/jlib.erl
src/mod_caps.erl
src/mod_caps_sql.erl
src/mod_configure.erl
src/mod_http_api.erl
src/mod_http_upload.erl
src/mod_last_sql.erl
src/mod_mam_mnesia.erl
src/mod_mam_sql.erl
src/mod_muc_admin.erl
src/mod_offline.erl
src/mod_privacy_sql.erl
src/mod_pubsub.erl
src/mod_shared_roster.erl
src/mod_vcard_sql.erl
src/pubsub_db_sql.erl
src/pubsub_subscription.erl
src/pubsub_subscription_sql.erl
src/randoms.erl
src/xmpp_codec.erl
tools/xmpp_codec.spec

index 802e1cd7b81c161499dd5548afb0082bb0612286..15980afc53a53aa73341915606a2b55f87de5f63 100644 (file)
@@ -45,7 +45,7 @@ mech_new(Host, _GetPassword, _CheckPassword, _CheckPasswordDigest) ->
 
 mech_step(#state{server = Server} = S, ClientIn) ->
     User = iolist_to_binary([randoms:get_string(),
-                             jlib:integer_to_binary(p1_time_compat:unique_integer([positive]))]),
+                             integer_to_binary(p1_time_compat:unique_integer([positive]))]),
     case ejabberd_auth:is_user_exists(User, Server) of
         true  -> mech_step(S, ClientIn);
         false -> {ok, [{username, User}, {authzid, User}, {auth_module, ejabberd_auth_anonymous}]}
index d89290d478671217f1483166baecb5797c4d289b..02540259a269a37cc09918d81ecea8afd7a08587 100644 (file)
@@ -1633,7 +1633,7 @@ new_id() -> randoms:get_string().
 -spec new_uniq_id() -> binary().
 new_uniq_id() ->
     iolist_to_binary([randoms:get_string(),
-                     jlib:integer_to_binary(p1_time_compat:unique_integer([positive]))]).
+                     integer_to_binary(p1_time_compat:unique_integer([positive]))]).
 
 -spec get_conn_type(state()) -> c2s | c2s_tls | c2s_compressed | websocket |
                                c2s_compressed_tls | http_bind.
index df74a68b1f1f3b52a5702cad251eadee075677ef..9650f3773e71d2c86d11017052cf22608c85d46f 100644 (file)
@@ -392,7 +392,7 @@ get_url(Str) ->
     end.
 
 get_transfer_protocol(PortString) ->
-    PortNumber = jlib:binary_to_integer(PortString),
+    PortNumber = binary_to_integer(PortString),
     PortListeners = get_port_listeners(PortNumber),
     get_captcha_transfer_protocol(PortListeners).
 
index dc00c5d2aef7752e6f53344433c729f54771e40f..477e4f5d5d2b90af4d4f9094ea8589a0ab338fb3 100644 (file)
@@ -41,7 +41,7 @@
 -define(SPAN(N, V), ?TAG_R(span, ??N, V)).
 
 -define(STR(A), ?SPAN(str,[<<"\"">>, A, <<"\"">>])).
--define(NUM(A), ?SPAN(num,jlib:integer_to_binary(A))).
+-define(NUM(A), ?SPAN(num,integer_to_binary(A))).
 -define(FIELD(A), ?SPAN(field,A)).
 -define(ID(A), ?SPAN(id,A)).
 -define(OP(A), ?SPAN(op,A)).
@@ -171,7 +171,7 @@ xml_gen({Name, integer}, Int, Indent, HTMLOutput) ->
     [?XML(member, Indent,
          [?XML_L(name, Indent, 1, ?ID_A(Name)),
           ?XML(value, Indent, 1,
-               [?XML_L(integer, Indent, 2, ?ID(jlib:integer_to_binary(Int)))])])];
+               [?XML_L(integer, Indent, 2, ?ID(integer_to_binary(Int)))])])];
 xml_gen({Name, string}, Str, Indent, HTMLOutput) ->
     [?XML(member, Indent,
          [?XML_L(name, Indent, 1, ?ID_A(Name)),
index 1c8de2fbf87c13b2283488db0ddd1712bd2066c8..35679ccd398600eb63f86655ce825456df7646ed 100644 (file)
@@ -252,7 +252,7 @@ process_header(State, Data) ->
                      request_headers = add_header(Name, Auth, State)};
       {ok,
        {http_header, _, 'Content-Length' = Name, _, SLen}} ->
-         case catch jlib:binary_to_integer(SLen) of
+         case catch binary_to_integer(SLen) of
            Len when is_integer(Len) ->
                State#state{request_content_length = Len,
                            request_headers = add_header(Name, SLen, State)};
@@ -327,10 +327,10 @@ get_transfer_protocol(SockMod, HostPort) ->
     case {SockMod, PortList} of
       {gen_tcp, []} -> {Host, 80, http};
       {gen_tcp, [Port]} ->
-         {Host, jlib:binary_to_integer(Port), http};
+         {Host, binary_to_integer(Port), http};
       {fast_tls, []} -> {Host, 443, https};
       {fast_tls, [Port]} ->
-         {Host, jlib:binary_to_integer(Port), https}
+         {Host, binary_to_integer(Port), https}
     end.
 
 %% XXX bard: search through request handlers looking for one that
@@ -587,12 +587,12 @@ make_text_output(State, Status, Reason, Headers, Text) ->
                   of
                 {value, _} ->
                     [{<<"Content-Length">>,
-                      jlib:integer_to_binary(byte_size(Data))}
+                      integer_to_binary(byte_size(Data))}
                      | Headers];
                 _ ->
                     [{<<"Content-Type">>, <<"text/html; charset=utf-8">>},
                      {<<"Content-Length">>,
-                      jlib:integer_to_binary(byte_size(Data))}
+                      integer_to_binary(byte_size(Data))}
                      | Headers]
               end,
     HeadersOut = case {State#state.request_version,
@@ -617,7 +617,7 @@ make_text_output(State, Status, Reason, Headers, Text) ->
                  _ -> Reason
                end,
     SL = [Version,
-         jlib:integer_to_binary(Status), <<" ">>,
+         integer_to_binary(Status), <<" ">>,
          NewReason, <<"\r\n">>],
     Data2 = case State#state.request_method of
              'HEAD' -> <<"">>;
index 1a238607a7ab4e3edc52b9047dbdfd94e0cfac90..20edaa178c5477861d373baf89f831660a68d884 100644 (file)
@@ -853,7 +853,7 @@ rid_allow(OldRid, NewRid, Attrs, Hold, MaxPause) ->
       %% We did not miss any packet, we can process it immediately:
       NewRid == OldRid + 1 ->
          case catch
-                jlib:binary_to_integer(fxml:get_attr_s(<<"pause">>,
+                binary_to_integer(fxml:get_attr_s(<<"pause">>,
                                                         Attrs))
              of
            {'EXIT', _} -> {true, 0};
@@ -1119,7 +1119,7 @@ parse_request(Data, PayloadSize, MaxStanzaSize) ->
          if Xmlns /= (?NS_HTTP_BIND) -> {error, bad_request};
             true ->
                 case catch
-                       jlib:binary_to_integer(fxml:get_attr_s(<<"rid">>,
+                       binary_to_integer(fxml:get_attr_s(<<"rid">>,
                                                                Attrs))
                     of
                   {'EXIT', _} -> {error, bad_request};
index 28796aca08455eb5749f6ef36b590e02c3a4c3fd..2a7b80c191ea84ec1486c89cf8367f1485682064 100644 (file)
@@ -147,7 +147,7 @@ timestamp_to_now(I) ->
     {MSec, Sec, USec}.
 
 dec_priority(Prio) ->
-    case catch jlib:binary_to_integer(Prio) of
+    case catch binary_to_integer(Prio) of
        {'EXIT', _} ->
            undefined;
        Int ->
@@ -157,7 +157,7 @@ dec_priority(Prio) ->
 enc_priority(undefined) ->
     <<"">>;
 enc_priority(Int) when is_integer(Int) ->
-    jlib:integer_to_binary(Int).
+    integer_to_binary(Int).
 
 row_to_session(LServer, {USec, PidS, User, Resource, PrioS, InfoS}) ->
     Now = timestamp_to_now(USec),
index a480a1bd3438e593f7016f9d73d31274f9370d54..8116d617f213a438ec8d7c26754973a62a61f061 100644 (file)
@@ -768,7 +768,7 @@ sqlite_to_odbc(Host, {rowid, _}) ->
 sqlite_to_odbc(_Host, [{columns, Columns}, {rows, TRows}]) ->
     Rows = [lists:map(
              fun(I) when is_integer(I) ->
-                     jlib:integer_to_binary(I);
+                     integer_to_binary(I);
                 (B) ->
                      B
              end, tuple_to_list(Row)) || Row <- TRows],
@@ -813,11 +813,11 @@ pgsql_item_to_odbc({<<"FETCH", _/binary>>, Rows,
     {selected, [element(1, Row) || Row <- Rows], Recs};
 pgsql_item_to_odbc(<<"INSERT ", OIDN/binary>>) ->
     [_OID, N] = str:tokens(OIDN, <<" ">>),
-    {updated, jlib:binary_to_integer(N)};
+    {updated, binary_to_integer(N)};
 pgsql_item_to_odbc(<<"DELETE ", N/binary>>) ->
-    {updated, jlib:binary_to_integer(N)};
+    {updated, binary_to_integer(N)};
 pgsql_item_to_odbc(<<"UPDATE ", N/binary>>) ->
-    {updated, jlib:binary_to_integer(N)};
+    {updated, binary_to_integer(N)};
 pgsql_item_to_odbc({error, Error}) -> {error, Error};
 pgsql_item_to_odbc(_) -> {updated, undefined}.
 
@@ -875,7 +875,7 @@ mysql_item_to_odbc(Columns, Recs) ->
 to_odbc({selected, Columns, Recs}) ->
     Rows = [lists:map(
              fun(I) when is_integer(I) ->
-                     jlib:integer_to_binary(I);
+                     integer_to_binary(I);
                 (B) ->
                      B
              end, Row) || Row <- Recs],
index 7f815a57eefd23c3aa37439b0d68e25ba0a2cb45..df6af1c959a6f841047d54e27e66e7590fc6aa79 100644 (file)
@@ -300,7 +300,7 @@ process_command2([<<"showlh">>, SNode], From, To) ->
 process_command2([<<"setlh">>, SNode, NewValueString],
                 From, To) ->
     Node = jlib:binary_to_atom(SNode),
-    NewValue = jlib:binary_to_integer(NewValueString),
+    NewValue = binary_to_integer(NewValueString),
     remote_command(Node, [setlh, NewValue], From, To);
 process_command2([<<"help">>], From, To) ->
     send_message(To, From, help());
index 2740e2879c44ff1f66eec9966f9e4e9425c81386..498fcf9b0b5af0ff36575c00f9aec2c1c0712905 100644 (file)
@@ -1458,8 +1458,8 @@ list_users_in_diapason(Host, Diap, Lang, URLFunc) ->
     Users = ejabberd_auth:get_vh_registered_users(Host),
     SUsers = lists:sort([{S, U} || {U, S} <- Users]),
     [S1, S2] = ejabberd_regexp:split(Diap, <<"-">>),
-    N1 = jlib:binary_to_integer(S1),
-    N2 = jlib:binary_to_integer(S2),
+    N1 = binary_to_integer(S1),
+    N2 = binary_to_integer(S2),
     Sub = lists:sublist(SUsers, N1, N2 - N1 + 1),
     [list_given_users(Host, Sub, <<"../../">>, Lang,
                      URLFunc)].
@@ -1648,7 +1648,7 @@ user_info(User, Server, Query, Lang) ->
                                                 "://",
                                                 (jlib:ip_to_list(IP))/binary,
                                                 ":",
-                                                (jlib:integer_to_binary(Port))/binary,
+                                                (integer_to_binary(Port))/binary,
                                                 "#",
                                                 (jlib:atom_to_binary(Node))/binary>>
                                       end,
@@ -2520,7 +2520,7 @@ make_netprot_html(NetProt) ->
 get_port_data(PortIP, Opts) ->
     {Port, IPT, IPS, _IPV, NetProt, OptsClean} =
        ejabberd_listener:parse_listener_portip(PortIP, Opts),
-    SPort = jlib:integer_to_binary(Port),
+    SPort = integer_to_binary(Port),
     SSPort = list_to_binary(
                lists:map(fun (N) ->
                                  io_lib:format("~.16b", [N])
index 037d6d63a0cb2fe605d45f139d7c8f6b16e3ecbf..fd70f8b1e58d8d20fc84aeb7529e970a08bdd010 100644 (file)
@@ -126,7 +126,7 @@ xdb_data(User, Server, #xmlel{attrs = Attrs} = El) ->
          TimeStamp = fxml:get_attr_s(<<"last">>, Attrs),
          Status = fxml:get_tag_cdata(El),
          catch mod_last:store_last_info(User, Server,
-                                        jlib:binary_to_integer(TimeStamp),
+                                        binary_to_integer(TimeStamp),
                                         Status),
          ok;
       ?NS_VCARD ->
index 532a74610c571813be4fccc67963ddbb220af1cc..b79b8fa7ce56975cc7ae561743c41d5720990426 100644 (file)
@@ -74,7 +74,9 @@
             {resourceprep, 1},
             {jid_tolower, 1},
             {jid_remove_resource, 1},
-            {jid_replace_resource, 2}]).
+            {jid_replace_resource, 2},
+            {integer_to_binary, 1},
+            {binary_to_integer, 1}]).
 
 -include("ejabberd.hrl").
 -include("jlib.hrl").
index ae11ab651ff76e182c3a65058a22864f4c83169d..4d9bdd61f6099e79c2bc9472c1321d51a0daaf79 100644 (file)
@@ -546,7 +546,7 @@ import_start(LServer, DBType) ->
 
 import(_LServer, {sql, _}, _DBType, <<"caps_features">>,
        [Node, SubNode, Feature, _TimeStamp]) ->
-    Feature1 = case catch jlib:binary_to_integer(Feature) of
+    Feature1 = case catch binary_to_integer(Feature) of
                    I when is_integer(I), I>0 -> I;
                    _ -> Feature
                end,
index 5faff98b64e9bc536299f14a17261ea454d9bf8a..dde301575a591f0091ce56af7026bdb5651f5d9d 100644 (file)
@@ -29,7 +29,7 @@ caps_read(LServer, {Node, SubNode}) ->
            ?SQL("select @(feature)s from caps_features where"
                 " node=%(Node)s and subnode=%(SubNode)s")) of
         {selected, [{H}|_] = Fs} ->
-            case catch jlib:binary_to_integer(H) of
+            case catch binary_to_integer(H) of
                 Int when is_integer(Int), Int>=0 ->
                     {ok, Int};
                 _ ->
@@ -58,7 +58,7 @@ export(_Server) ->
 %%%===================================================================
 sql_write_features_t({Node, SubNode}, Features) ->
     NewFeatures = if is_integer(Features) ->
-                          [jlib:integer_to_binary(Features)];
+                          [integer_to_binary(Features)];
                      true ->
                           Features
                   end,
index dd361028b914fa6e529944ac57b006c55e0f524c..5e2ff351c04f9a736038c94886d869c5215c9782 100644 (file)
@@ -552,8 +552,8 @@ get_local_items({_, Host},
     SUsers = lists:sort([{S, U} || {U, S} <- Users]),
     try
        [S1, S2] = ejabberd_regexp:split(Diap, <<"-">>),
-       N1 = jlib:binary_to_integer(S1),
-       N2 = jlib:binary_to_integer(S2),
+       N1 = binary_to_integer(S1),
+       N2 = binary_to_integer(S2),
        Sub = lists:sublist(SUsers, N1, N2 - N1 + 1),
        {result, lists:map(
                   fun({S, U}) ->
@@ -1659,11 +1659,11 @@ set_form(From, Host, ?NS_ADMINL(<<"user-stats">>), Lang,
     IPs1 = [ejabberd_sm:get_user_ip(User, Server, Resource)
            || Resource <- Resources],
     IPs = [<<(jlib:ip_to_list(IP))/binary, ":",
-             (jlib:integer_to_binary(Port))/binary>>
+             (integer_to_binary(Port))/binary>>
                || {IP, Port} <- IPs1],
     Items = ejabberd_hooks:run_fold(roster_get, Server, [],
                                    [{User, Server}]),
-    Rostersize = jlib:integer_to_binary(erlang:length(Items)),
+    Rostersize = integer_to_binary(erlang:length(Items)),
     {result,
      #xdata{type = form,
            fields = [?HFIELD(),
@@ -1695,7 +1695,7 @@ search_running_node(SNode, [Node | Nodes]) ->
     end.
 
 stop_node(From, Host, ENode, Action, XData) ->
-    Delay = jlib:binary_to_integer(get_value(<<"delay">>, XData)),
+    Delay = binary_to_integer(get_value(<<"delay">>, XData)),
     Subject = case get_value(<<"subject">>, XData) of
                  <<"">> ->
                      [];
index f3a69aa800ae1165cb9344a9471881767255ab6f..1578be964569927e9315c2caec9bccdda0c1a85c 100644 (file)
@@ -267,7 +267,7 @@ process(_Path, Request) ->
 get_api_version(#request{path = Path}) ->
     get_api_version(lists:reverse(Path));
 get_api_version([<<"v", String/binary>> | Tail]) ->
-    case catch jlib:binary_to_integer(String) of
+    case catch binary_to_integer(String) of
        N when is_integer(N) ->
            N;
        _ ->
index f1f5d8173d3cecbd47b519c0fdc3630ac5d06562..6ad18531cd87f71d36fd4d5e457d0a20e57df757 100644 (file)
@@ -35,7 +35,7 @@
 -define(FORMAT(Error), file:format_error(Error)).
 -define(URL_ENC(URL), binary_to_list(ejabberd_http:url_encode(URL))).
 -define(ADDR_TO_STR(IP), ejabberd_config:may_hide_data(jlib:ip_to_list(IP))).
--define(STR_TO_INT(Str, B), jlib:binary_to_integer(iolist_to_binary(Str), B)).
+-define(STR_TO_INT(Str, B), binary_to_integer(iolist_to_binary(Str), B)).
 -define(DEFAULT_CONTENT_TYPE, <<"application/octet-stream">>).
 -define(CONTENT_TYPES,
        [{<<".avi">>, <<"video/avi">>},
@@ -578,7 +578,7 @@ process_iq(_From, #iq{}, _State) ->
 create_slot(#state{service_url = undefined, max_size = MaxSize},
            JID, File, Size, _ContentType, Lang) when MaxSize /= infinity,
                                                      Size > MaxSize ->
-    Text = <<"File larger than ", (jlib:integer_to_binary(MaxSize))/binary,
+    Text = <<"File larger than ", (integer_to_binary(MaxSize))/binary,
             " Bytes.">>,
     ?INFO_MSG("Rejecting file ~s from ~s (too large: ~B bytes)",
              [File, jid:to_string(JID), Size]),
@@ -609,7 +609,7 @@ create_slot(#state{service_url = ServiceURL},
            Lang) ->
     Options = [{body_format, binary}, {full_result, false}],
     HttpOptions = [{timeout, ?SERVICE_REQUEST_TIMEOUT}],
-    SizeStr = jlib:integer_to_binary(Size),
+    SizeStr = integer_to_binary(Size),
     GetRequest = binary_to_list(ServiceURL) ++
                     "?jid=" ++ ?URL_ENC(jid:to_string({U, S, <<"">>})) ++
                     "&name=" ++ ?URL_ENC(File) ++
@@ -727,7 +727,7 @@ iq_disco_info(Host, Lang, Name, AddInfo) ->
               infinity ->
                   AddInfo;
               MaxSize ->
-                  MaxSizeStr = jlib:integer_to_binary(MaxSize),
+                  MaxSizeStr = integer_to_binary(MaxSize),
                   Fields = [#xdata_field{type = hidden,
                                          var = <<"FORM_TYPE">>,
                                          values = [?NS_HTTP_UPLOAD]},
index 13b028c6f6dc064fcdac79c695285b3d5ae42993..718f01dff8112487aaf09b58ed617f58ef3a97bb 100644 (file)
@@ -62,7 +62,7 @@ import(LServer) ->
     [{<<"select username, seconds, state from last">>,
       fun([LUser, TimeStamp, State]) ->
               #last_activity{us = {LUser, LServer},
-                             timestamp = jlib:binary_to_integer(
+                             timestamp = binary_to_integer(
                                            TimeStamp),
                              status = State}
       end}].
index ecaa4d0537bae954b6bb5334229625cb99cada56..e913d5a4534c1284a0bc1a0d542ece022aabf96f 100644 (file)
@@ -97,7 +97,7 @@ store(Pkt, _, {LUser, LServer}, Type, Peer, Nick, _Dir) ->
        _ ->
            LPeer = {PUser, PServer, _} = jid:tolower(Peer),
            TS = p1_time_compat:timestamp(),
-           ID = jlib:integer_to_binary(now_to_usec(TS)),
+           ID = integer_to_binary(now_to_usec(TS)),
            F = fun() ->
                        mnesia:write(
                          #archive_msg{us = {LUser, LServer},
@@ -145,7 +145,7 @@ select(_LServer, JidRequestor,
     Result = {lists:map(
                fun(Msg) ->
                        {Msg#archive_msg.id,
-                        jlib:binary_to_integer(Msg#archive_msg.id),
+                        binary_to_integer(Msg#archive_msg.id),
                         mod_mam:msg_to_el(Msg, MsgType, JidRequestor,
                                           JidArchive)}
                end, FilteredMsgs), IsComplete, Count},
index 2a0dcce9545c80dba3746092000678ff73bed523..1491f70f209c5a6d49ade4d2113f6b06c657b6c8 100644 (file)
@@ -55,7 +55,7 @@ extended_fields() ->
 
 store(Pkt, LServer, {LUser, LHost}, Type, Peer, Nick, _Dir) ->
     TSinteger = p1_time_compat:system_time(micro_seconds),
-    ID = jlib:integer_to_binary(TSinteger),
+    ID = integer_to_binary(TSinteger),
     SUser = case Type of
                chat -> LUser;
                groupchat -> jid:to_string({LUser, LHost, <<>>})
@@ -154,14 +154,14 @@ select(LServer, JidRequestor, #jid{luser = LUser} = JidArchive,
               fun([TS, XML, PeerBin, Kind, Nick]) ->
                       try
                           #xmlel{} = El = fxml_stream:parse_element(XML),
-                          Now = usec_to_now(jlib:binary_to_integer(TS)),
+                          Now = usec_to_now(binary_to_integer(TS)),
                           PeerJid = jid:tolower(jid:from_string(PeerBin)),
                           T = case Kind of
                                   <<"">> -> chat;
                                   null -> chat;
                                   _ -> jlib:binary_to_atom(Kind)
                               end,
-                          [{TS, jlib:binary_to_integer(TS),
+                          [{TS, binary_to_integer(TS),
                             mod_mam:msg_to_el(#archive_msg{timestamp = Now,
                                                            packet = El,
                                                            type = T,
@@ -176,7 +176,7 @@ select(LServer, JidRequestor, #jid{luser = LUser} = JidArchive,
                                          [Err, TS, XML, PeerBin, Kind, Nick]),
                               []
                       end
-              end, Res1), IsComplete, jlib:binary_to_integer(Count)};
+              end, Res1), IsComplete, binary_to_integer(Count)};
        _ ->
            {[], false, 0}
     end.
@@ -208,12 +208,12 @@ make_sql_query(User, LServer,
             _ -> fun ejabberd_sql:escape/1
         end,
     LimitClause = if is_integer(Max), Max >= 0, ODBCType /= mssql ->
-                         [<<" limit ">>, jlib:integer_to_binary(Max+1)];
+                         [<<" limit ">>, integer_to_binary(Max+1)];
                     true ->
                          []
                  end,
     TopClause = if is_integer(Max), Max >= 0, ODBCType == mssql ->
-                         [<<" TOP ">>, jlib:integer_to_binary(Max+1)];
+                         [<<" TOP ">>, integer_to_binary(Max+1)];
                     true ->
                          []
                  end,
@@ -235,7 +235,7 @@ make_sql_query(User, LServer,
                     _ ->
                         []
                 end,
-    PageClause = case catch jlib:binary_to_integer(ID) of
+    PageClause = case catch binary_to_integer(ID) of
                     I when is_integer(I), I >= 0 ->
                         case Direction of
                             before ->
@@ -251,14 +251,14 @@ make_sql_query(User, LServer,
     StartClause = case Start of
                      {_, _, _} ->
                          [<<" and timestamp >= ">>,
-                          jlib:integer_to_binary(now_to_usec(Start))];
+                          integer_to_binary(now_to_usec(Start))];
                      _ ->
                          []
                  end,
     EndClause = case End of
                    {_, _, _} ->
                        [<<" and timestamp <= ">>,
-                        jlib:integer_to_binary(now_to_usec(End))];
+                        integer_to_binary(now_to_usec(End))];
                    _ ->
                        []
                end,
index a7ba1613800eb3f1bd8dfcc600115d8ca74ecc76..4d56093e1379327e4983bbaae5a4f7d76bbb18e8 100644 (file)
@@ -761,7 +761,7 @@ change_room_option(Name, Service, OptionString, ValueString) ->
                password -> ValueString;
                subject ->ValueString;
                subject_author ->ValueString;
-               max_users -> jlib:binary_to_integer(ValueString);
+               max_users -> binary_to_integer(ValueString);
                _ -> jlib:binary_to_atom(ValueString)
            end,
     change_room_option(Name, Service, Option, Value).
index 9c062065ddfe3b94c8d98cc06b3a3c03cb212f97..258c97d4f34d46fb52307ae0f737eacafa135217 100644 (file)
@@ -301,7 +301,7 @@ get_sm_items(Acc, _From, _To, _Node, _Lang) ->
              ([xdata()], jid(), jid(), binary(), binary()) -> [xdata()].
 get_info(_Acc, #jid{luser = U, lserver = S, lresource = R},
         #jid{luser = U, lserver = S}, ?NS_FLEX_OFFLINE, _Lang) ->
-    N = jlib:integer_to_binary(count_offline_messages(U, S)),
+    N = integer_to_binary(count_offline_messages(U, S)),
     case ejabberd_sm:get_session_pid(U, S, R) of
        Pid when is_pid(Pid) ->
            Pid ! dont_ask_offline;
index a1f743657c3c274c7c54c247c55fa5c76fb53ab3..7ca19b5e9aa3233cddaaf0c49adc3d222cec836d 100644 (file)
@@ -198,7 +198,7 @@ export(Server) ->
                                 [<<"select id from privacy_list order by "
                                    "id desc limit 1;">>]) of
         {selected, [<<"id">>], [[I]]} ->
-            put(id, jlib:binary_to_integer(I));
+            put(id, binary_to_integer(I));
         _ ->
             put(id, 0)
     end,
index f7e1a98348d3fc5be0f7aba46fd2c72e8b390d17..b55115c9a0fa249b449068ed498af324b762d27a 100644 (file)
@@ -3279,7 +3279,7 @@ max_items(Host, Options) ->
 -define(INTEGER_CONFIG_FIELD(Label, Var),
     ?STRINGXFIELD(Label,
        <<"pubsub#", (atom_to_binary(Var, latin1))/binary>>,
-       (jlib:integer_to_binary(get_option(Options, Var))))).
+       (integer_to_binary(get_option(Options, Var))))).
 
 -define(JLIST_CONFIG_FIELD(Label, Var, Opts),
     ?LISTXFIELD(Label,
@@ -3418,7 +3418,7 @@ add_opt(Key, Value, Opts) ->
     set_xoption(Host, Opts, add_opt(Opt, Val, NewOpts))).
 
 -define(SET_INTEGER_XOPT(Opt, Val, Min, Max),
-       case catch jlib:binary_to_integer(Val) of
+       case catch binary_to_integer(Val) of
            IVal when is_integer(IVal), IVal >= Min ->
                if (Max =:= undefined) orelse (IVal =< Max) ->
                        set_xoption(Host, Opts, add_opt(Opt, IVal, NewOpts));
index 8b620514b33f3239e2207504bb4b7bee1f6d8250..45d91bccd9d3a119bc93fe7c4d8ee9bc06d8809d 100644 (file)
@@ -907,21 +907,21 @@ shared_roster_group(Host, Group, Query, Lang) ->
                             [?XCT(<<"td">>, <<"Description:">>),
                              ?XE(<<"td">>,
                                  [?TEXTAREA(<<"description">>,
-                                            jlib:integer_to_binary(lists:max([3,
+                                            integer_to_binary(lists:max([3,
                                                                                DescNL])),
                                             <<"20">>, Description)])]),
                         ?XE(<<"tr">>,
                             [?XCT(<<"td">>, <<"Members:">>),
                              ?XE(<<"td">>,
                                  [?TEXTAREA(<<"members">>,
-                                            jlib:integer_to_binary(lists:max([3,
+                                            integer_to_binary(lists:max([3,
                                                                                byte_size(FMembers)])),
                                             <<"20">>, FMembers)])]),
                         ?XE(<<"tr">>,
                             [?XCT(<<"td">>, <<"Displayed Groups:">>),
                              ?XE(<<"td">>,
                                  [?TEXTAREA(<<"dispgroups">>,
-                                            jlib:integer_to_binary(lists:max([3,                                                                                               length(FDisplayedGroups)])),
+                                            integer_to_binary(lists:max([3,                                                                                            length(FDisplayedGroups)])),
                                             <<"20">>,
                                             list_to_binary(FDisplayedGroups))])])])])),
     (?H1GL((?T(<<"Shared Roster Groups">>)),
index f8ac6be97ac6fd40c09c3afce55147dbb98fbcbb..129f76b5a0dcc505bcc47a00ec62f8fe76513463 100644 (file)
@@ -82,7 +82,7 @@ search(LServer, Data, AllowReturnAll, MaxMatch) ->
                        infinity ->
                            <<"">>;
                        Val ->
-                           [<<" LIMIT ">>, jlib:integer_to_binary(Val)]
+                           [<<" LIMIT ">>, integer_to_binary(Val)]
                    end,
           case catch ejabberd_sql:sql_query(
                        LServer,
index a6f8888a92af88e82965610a12251f1df4f26212..69b476539ef4b6475acfdc4cb76105022a157f11 100644 (file)
@@ -134,7 +134,7 @@ boolean_to_sql(false) -> <<"0">>.
 
 timestamp_to_sql(T) -> jlib:now_to_utc_string(T).
 
-sql_to_integer(N) -> jlib:binary_to_integer(N).
+sql_to_integer(N) -> binary_to_integer(N).
 
 sql_to_boolean(B) -> B == <<"1">>.
 
index 33c884afb49bf9ddc0d58453fce88357b6c0378c..de1a363db4daae98ea71d979acac2113bba6fae0 100644 (file)
@@ -203,7 +203,7 @@ var_xfield(_) -> {error, badarg}.
 val_xfield(deliver = Opt, [Val]) -> xopt_to_bool(Opt, Val);
 val_xfield(digest = Opt, [Val]) -> xopt_to_bool(Opt, Val);
 val_xfield(digest_frequency = Opt, [Val]) ->
-    case catch jlib:binary_to_integer(Val) of
+    case catch binary_to_integer(Val) of
        N when is_integer(N) -> N;
        _ ->
            Txt = <<"Value of '~s' should be integer">>,
@@ -225,7 +225,7 @@ val_xfield(subscription_type, [<<"items">>]) -> items;
 val_xfield(subscription_type, [<<"nodes">>]) -> nodes;
 val_xfield(subscription_depth, [<<"all">>]) -> all;
 val_xfield(subscription_depth = Opt, [Depth]) ->
-    case catch jlib:binary_to_integer(Depth) of
+    case catch binary_to_integer(Depth) of
        N when is_integer(N) -> N;
        _ ->
            Txt = <<"Value of '~s' should be integer">>,
index 7c067095772911c904b7324702abed16e15d0467..32aa41a93c8503f3d6b55bea03a46bcbec4b20d8 100644 (file)
@@ -168,7 +168,7 @@ var_xfield(_) -> {error, badarg}.
 val_xfield(deliver = Opt, [Val]) -> xopt_to_bool(Opt, Val);
 val_xfield(digest = Opt, [Val]) -> xopt_to_bool(Opt, Val);
 val_xfield(digest_frequency = Opt, [Val]) ->
-    case catch jlib:binary_to_integer(Val) of
+    case catch binary_to_integer(Val) of
        N when is_integer(N) -> N;
        _ ->
            Txt = <<"Value of '~s' should be integer">>,
@@ -190,7 +190,7 @@ val_xfield(subscription_type, [<<"items">>]) -> items;
 val_xfield(subscription_type, [<<"nodes">>]) -> nodes;
 val_xfield(subscription_depth, [<<"all">>]) -> all;
 val_xfield(subscription_depth = Opt, [Depth]) ->
-    case catch jlib:binary_to_integer(Depth) of
+    case catch binary_to_integer(Depth) of
        N when is_integer(N) -> N;
        _ ->
            Txt = <<"Value of '~s' should be integer">>,
index 52fceef4e61471d38a01582b0ee4c3c5108447b3..60d0b4e3db0f9dae8b538212ab4cb1adce8b4f6d 100644 (file)
@@ -36,5 +36,5 @@ start() ->
 
 get_string() ->
     R = crypto:rand_uniform(0, 16#10000000000000000),
-    jlib:integer_to_binary(R).
+    integer_to_binary(R).
 
index bffe2f1add79629bf06b85a1d91fffc1b785c8d4..a0181e1e6805e47fe429ea915c83c75e7dd9fa4c 100644 (file)
@@ -6686,8 +6686,8 @@ enc_tzo({H, M}) ->
 
 dec_tzo(Val) ->
     [H1, M1] = str:tokens(Val, <<":">>),
-    H = jlib:binary_to_integer(H1),
-    M = jlib:binary_to_integer(M1),
+    H = binary_to_integer(H1),
+    M = binary_to_integer(M1),
     if H >= -12, H =< 12, M >= 0, M < 60 -> {H, M} end.
 
 decode_thumbnail(__TopXMLNS, __IgnoreEls,
index ba402969eeb0a3e74217aedd61b3e849939492b5..6824cf3877c4de863273a05f4d916477aaad6f1c 100644 (file)
 -spec dec_tzo(_) -> {integer(), integer()}.
 dec_tzo(Val) ->
     [H1, M1] = str:tokens(Val, <<":">>),
-    H = jlib:binary_to_integer(H1),
-    M = jlib:binary_to_integer(M1),
+    H = binary_to_integer(H1),
+    M = binary_to_integer(M1),
     if H >= -12, H =< 12, M >= 0, M < 60  ->
             {H, M}
     end.