quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

ares_expand_string.3 (1399B)


      1 .\"
      2 .\" Copyright 1998 by the Massachusetts Institute of Technology.
      3 .\" SPDX-License-Identifier: MIT
      4 .\"
      5 .TH ARES_EXPAND_NAME 3 "20 Nov 2009"
      6 .SH NAME
      7 ares_expand_string \- Expand a length encoded string
      8 .SH SYNOPSIS
      9 .nf
     10 #include <ares.h>
     11 
     12 int ares_expand_string(const unsigned char *\fIencoded\fP,
     13                        const unsigned char *\fIabuf\fP, int \fIalen\fP,
     14                        unsigned char **\fIs\fP, long *\fIenclen\fP)
     15 .fi
     16 .SH DESCRIPTION
     17 The
     18 .B ares_expand_string
     19 function converts a length encoded string to a NUL-terminated C
     20 string.  The argument
     21 .I encoded
     22 gives the beginning of the encoded string, and the arguments
     23 .I abuf
     24 and
     25 .I alen
     26 give the containing message buffer (necessary for the processing of
     27 indirection pointers within the encoded domain name).  The result is
     28 placed in a NUL-terminated allocated buffer, a pointer to which is
     29 stored in the variable pointed to by
     30 .IR s .
     31 The length of the encoded string is stored in the variable pointed to by
     32 .I enclen
     33 so that the caller can advance past the encoded string to read
     34 further data in the message.
     35 .SH RETURN VALUES
     36 .B ares_expand_string
     37 can return any of the following values:
     38 .TP 15
     39 .B ARES_SUCCESS
     40 Expansion of the encoded string succeeded.
     41 .TP 15
     42 .B ARES_EBADSTR
     43 The encoded string was malformed and could not be expanded.
     44 .TP 15
     45 .B ARES_ENOMEM
     46 Memory was exhausted.
     47 .SH SEE ALSO
     48 .BR ares_free_string (3)