A
Atropo
Hi all,
All that I have done in c is a hello word, but I'm RTFM. I have to
extract the time from a usb-key from HASP-HL Aladdin. The software
that came with this brings me the code in c that do this
this is :
hasp_status_t status;
hasp_time_t time;
status = hasp_get_rtc(handle, &time);
/* check if operation was successful */
if (status != HASP_STATUS_OK)
{
switch (status)
{
case HASP_INV_HND:
break;
case HASP_NO_TIME:
break;
default:
break;
}
}
unsigned int day, month, year, hour, minute, second;
status = hasp_hasptime_to_datetime(time, &day, &month, &year, &hour,
&minute, &second);
if(status == HASP_INV_TIME)
{
/* handle error */
}
****************
So i tried to include in a main but throws a lot of undeclare
'hasp_status_t','hasp_time','status','handle' and a lot of parse
errors too.
this is what I did.
#include <stdio.h>
char get_lafecha( )
{
hasp_status_t status;
hasp_time_t time;
status = hasp_get_rtc(handle, &time);
/* check if operation was successful */
if (status != HASP_STATUS_OK)
{
switch (status)
{
case HASP_INV_HND:
break;
case HASP_NO_TIME:
break;
default:
break;
}
}
unsigned int day, month, year, hour, minute, second;
status = hasp_hasptime_to_datetime(time, &day, &month, &year, &hour,
&minute, &second);
if(status == HASP_INV_TIME)
{
/* handle error */
}
return status
}
char main()
{
char lafecha;
lafecha = get_lafecha()
printf(lafecha);
}
how could I accomplish this
All that I have done in c is a hello word, but I'm RTFM. I have to
extract the time from a usb-key from HASP-HL Aladdin. The software
that came with this brings me the code in c that do this
this is :
hasp_status_t status;
hasp_time_t time;
status = hasp_get_rtc(handle, &time);
/* check if operation was successful */
if (status != HASP_STATUS_OK)
{
switch (status)
{
case HASP_INV_HND:
break;
case HASP_NO_TIME:
break;
default:
break;
}
}
unsigned int day, month, year, hour, minute, second;
status = hasp_hasptime_to_datetime(time, &day, &month, &year, &hour,
&minute, &second);
if(status == HASP_INV_TIME)
{
/* handle error */
}
****************
So i tried to include in a main but throws a lot of undeclare
'hasp_status_t','hasp_time','status','handle' and a lot of parse
errors too.
this is what I did.
#include <stdio.h>
char get_lafecha( )
{
hasp_status_t status;
hasp_time_t time;
status = hasp_get_rtc(handle, &time);
/* check if operation was successful */
if (status != HASP_STATUS_OK)
{
switch (status)
{
case HASP_INV_HND:
break;
case HASP_NO_TIME:
break;
default:
break;
}
}
unsigned int day, month, year, hour, minute, second;
status = hasp_hasptime_to_datetime(time, &day, &month, &year, &hour,
&minute, &second);
if(status == HASP_INV_TIME)
{
/* handle error */
}
return status
}
char main()
{
char lafecha;
lafecha = get_lafecha()
printf(lafecha);
}
how could I accomplish this