Add mypicname function

This commit is contained in:
Mr-Dave
2024-01-11 16:48:29 -07:00
parent b9787dc8ba
commit ded4b07661
3 changed files with 74 additions and 109 deletions

View File

@@ -557,6 +557,24 @@ size_t mystrftime(ctx_dev *cam, char *s, size_t max, const char *userformat,
return strftime(s, max, format, &timestamp_tm);
}
void mypicname(ctx_dev *cam
, char* fullname, std::string fmtstr
, std::string basename, std::string extname)
{
char filename[PATH_MAX];
int retcd;
mystrftime(cam, filename, sizeof(filename)
, basename.c_str(), &cam->current_image->imgts, NULL, 0);
retcd = snprintf(fullname, PATH_MAX, fmtstr.c_str()
, cam->conf->target_dir.c_str(), filename, extname.c_str());
if ((retcd < 0) || (retcd >= PATH_MAX)) {
MOTPLS_LOG(ERR, TYPE_EVENTS, NO_ERRNO
,_("Error creating picture file name"));
return;
}
}
void mythreadname_set(const char *abbr, int threadnbr, const char *threadname)
{
/* When the abbreviation is sent in as null, that means we are being