コード例 #1
0
ファイル: b64pack.c プロジェクト: unixba/b64pack
int main(int argc, char *argv[])
{
    char *msg;
    size_t msglen;
    int operation;

    switch (argc) {
    case 1:
        operation = OP_COMPRESS;
        break;
    case 2:
        if (strcmp(argv[1], "-d") == 0) {
            operation = OP_DECOMPRESS;
            break;
        }
    default:
        err_use(argv[0]);
    }

    msglen = get_message(&msg);

    if (operation == OP_COMPRESS)
        b64pack_compress(msg, &msglen);
    else
        b64pack_decompress(msg, &msglen);

    put_message(msg, msglen);

    exit(EXIT_SUCCESS);
}
コード例 #2
0
ファイル: hesap2.c プロジェクト: gdemir/pro-lang
int main(int argc, char *argv[]) {
	if (argc != 3)	err_use(argv[0]);
	printf("%d\n", hesap(atof(argv[1]), atof(argv[2]), argv[0]));
	return 0;
}