Displaying 1 result from an estimated 1 matches for "setinfo_float".
2009 Aug 14
2
Bestfortress driver, network serial patch for nut-2.0
...*/
static inline void setinfo_int_minutes (const char *key, const char * s, size_t len)
{
char buf[10];
if (len > sizeof(buf)) len = sizeof(buf)-1;
strncpy (buf, s, len);
buf[len] = 0;
dstate_setinfo (key, "%d", 60*atoi (buf));
}
/* set info to float value */
static inline void setinfo_float (const char *key, char * fmt, const char * s, size_t len, double factor)
{
char buf[10];
if (len > sizeof(buf)) len = sizeof(buf)-1;
strncpy (buf, s, len);
buf[len] = 0;
dstate_setinfo (key, fmt, factor * (double)atoi (buf));
}
static int upssend(const char *fmt,...) {
int ret;
char bu...