hex2chars.c
changeset 27 81a574d60c15
parent 9 c3fecc82ade6
child 29 7abf6146898e
equal deleted inserted replaced
26:d227047a3e88 27:81a574d60c15
    24 const char *characters = "xuzicjklmneopbdaqfrstvgwhy";
    24 const char *characters = "xuzicjklmneopbdaqfrstvgwhy";
    25 
    25 
    26 char *remap_works (char *str, int slen)
    26 char *remap_works (char *str, int slen)
    27 {
    27 {
    28     int i;
    28     int i;
       
    29 
    29     int pos;
    30     int pos;
       
    31 
    30     static char *s;
    32     static char *s;
    31 
    33 
    32     if ((s = malloc (slen + 1)) == NULL)
    34     if ((s = malloc (slen + 1)) == NULL)
    33         return NULL;
    35         return NULL;
    34 
    36 
    49 }
    51 }
    50 
    52 
    51 char *remap_works_not (char *str, int slen)
    53 char *remap_works_not (char *str, int slen)
    52 {
    54 {
    53     int i, j;
    55     int i, j;
       
    56 
    54     double value;
    57     double value;
       
    58 
    55     double *table;
    59     double *table;
       
    60 
    56     static char *s;
    61     static char *s;
    57 
    62 
    58     int clen = strlen (characters);
    63     int clen = strlen (characters);
    59 
    64 
    60     if ((s = malloc (slen + 1)) == NULL)
    65     if ((s = malloc (slen + 1)) == NULL)
   101 }
   106 }
   102 
   107 
   103 int main (int argc, char **argv)
   108 int main (int argc, char **argv)
   104 {
   109 {
   105     int i;
   110     int i;
       
   111 
   106     int len;
   112     int len;
       
   113 
   107     char *start;
   114     char *start;
       
   115 
   108     char *end;
   116     char *end;
   109 
   117 
   110     if (argc != 2) {
   118     if (argc != 2) {
   111         printf ("Usage: %s <string>\n", argv[0]);
   119         printf ("Usage: %s <string>\n", argv[0]);
   112         exit (0);
   120         exit (0);