MCPcopy Create free account
hub / github.com/git/git / main

Function main

base85.c:105–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104#ifdef DEBUG_85
105int main(int ac, char **av)
106{
107 char buf[1024];
108
109 if (!strcmp(av[1], "-e")) {
110 int len = strlen(av[2]);
111 encode_85(buf, av[2], len);
112 if (len <= 26) len = len + 'A' - 1;
113 else len = len + 'a' - 26 - 1;
114 printf("encoded: %c%s\n", len, buf);
115 return 0;
116 }
117 if (!strcmp(av[1], "-d")) {
118 int len = *av[2];
119 if ('A' <= len && len <= 'Z') len = len - 'A' + 1;
120 else len = len - 'a' + 26 + 1;
121 decode_85(buf, av[2]+1, len);
122 printf("decoded: %.*s\n", len, buf);
123 return 0;
124 }
125 if (!strcmp(av[1], "-t")) {
126 char t[4] = { -1,-1,-1,-1 };
127 encode_85(buf, t, 4);
128 printf("encoded: D%s\n", buf);
129 return 0;
130 }
131}
132#endif

Callers

nothing calls this directly

Calls 2

encode_85Function · 0.85
decode_85Function · 0.85

Tested by

no test coverage detected