openssl rsa
user_setup: api_flac_test api_ibac_test ukey.pvt ukey.pub if ! grep
useradd wliusr1; \
chown wliusr1 flac_test; chmod a+w flac_test; \ chown wliusr1 ibac_test; chmod a+w ibac_test; \ chown wliusr1 api_flac_test; chmod u+w flac_test; \ chown wliusr1 api_ibac_test; chmod u+w ibac_test; \ chown wliusr1 ukey.pvt; chmod
clean:
rm
userdel
fi
rm
A.3 FLAC add and delete program
/*
*(C) Copyright 2010
*Description:
*api_flac_test.c
*/ |
|
#include<stdio.h> |
|
#include<fcntl.h> |
|
#include<sys/errno.h> |
|
#include<api.h> |
|
#define FLAC_TEST | "flac_test" |
main(int argc, char *argv[]) | |
{ |
|
wli_fap_t | ptype = WLIAPI_FAP_FLAC; |
wliapi_err_t | err = WLIAPI_SUCCESS; |
int | fd = 0; |
fd = open(FLAC_TEST, O_CREATO_TRUNCO_RDWR, 0666); if ( fd < 0 ) {
(void) fprintf(stderr,
"Failed to create a test file; error %d\n", errno);
}
close(fd);
err = wli_add_fap(FLAC_TEST, ptype); if (err) {
(void) fprintf(stderr,
"Failed to add fap %d\n", err);
}
err = wli_del_fap(FLAC_TEST, ptype); if (err) {
fprintf(stderr,
"Failed to del fap %d\n", err);
}
return(err);
}
A.4 IBAC add and delete program
/*
*(C) Copyright 2010
*Description:
46libwliapi example