]> git.ozlabs.org Git - ccan/blob - ccan/str/hex/_info
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / str / hex / _info
1 #include "config.h"
2 #include <stdio.h>
3 #include <string.h>
4
5 /**
6  * str/hex - hex-to-string conversions and vice-versa
7  *
8  * This code contains simple routines for hexadecimal strings.
9  *
10  * License: CC0 (Public domain)
11  * Author: Rusty Russell <rusty@rustcorp.com.au>
12  *
13  * Example:
14  *      int main(int argc, char *argv[])
15  *      {
16  *              int i;
17  *
18  *              for (i = 1; i < argc; i++) {
19  *                      char str[hex_str_size(strlen(argv[i]))];
20  *
21  *                      hex_encode(str, sizeof(str), argv[i], strlen(argv[i]));
22  *                      printf("%s ", str);
23  *              }
24  *              printf("\n");
25  *              return 0;
26  *      }
27  */
28 int main(int argc, char *argv[])
29 {
30         /* Expect exactly one argument */
31         if (argc != 2)
32                 return 1;
33
34         if (strcmp(argv[1], "depends") == 0) {
35                 return 0;
36         }
37
38         return 1;
39 }