gwenhywfar 4.0.3
|
#include "cgui_p.h"
#include "i18n_l.h"
#include <gwenhywfar/gui_be.h>
#include <gwenhywfar/inherit.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/gwentime.h>
#include <gwenhywfar/mdigest.h>
#include <gwenhywfar/text.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
Go to the source code of this file.
Defines | |
#define | DISABLE_DEBUGLOG |
#define | ICONV_CONST |
Functions | |
GWEN_GUI_CPROGRESS * | GWEN_Gui_CGui__findProgress (GWEN_GUI *gui, uint32_t id) |
int | GWEN_Gui_CGui__HashPair (const char *token, const char *pin, GWEN_BUFFER *buf) |
int | GWEN_Gui_CGui__input (GWEN_UNUSED GWEN_GUI *gui, uint32_t flags, char *buffer, int minLen, int maxLen, uint32_t guiid) |
char | GWEN_Gui_CGui__readCharFromStdin (int waitFor) |
int | GWEN_Gui_CGui_CheckCert (GWEN_GUI *gui, const GWEN_SSLCERTDESCR *cd, GWEN_SYNCIO *sio, uint32_t guiid) |
void GWENHYWFAR_CB | GWEN_Gui_CGui_FreeData (GWEN_UNUSED void *bp, void *p) |
int | GWEN_Gui_CGui_GetAcceptAllValidCerts (const GWEN_GUI *gui) |
GWEN_DB_NODE * | GWEN_Gui_CGui_GetCertDb (const GWEN_GUI *gui) |
const char * | GWEN_Gui_CGui_GetCharSet (const GWEN_GUI *gui) |
int | GWEN_Gui_CGui_GetIsNonInteractive (const GWEN_GUI *gui) |
int | GWEN_Gui_CGui_GetPassword (GWEN_GUI *gui, uint32_t flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen, uint32_t guiid) |
GWEN_DB_NODE * | GWEN_Gui_CGui_GetPasswordDb (const GWEN_GUI *gui) |
void | GWEN_Gui_CGui_HideBox (GWEN_GUI *gui, GWEN_UNUSED uint32_t id) |
int | GWEN_Gui_CGui_InputBox (GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, char *buffer, int minLen, int maxLen, uint32_t guiid) |
int | GWEN_Gui_CGui_MessageBox (GWEN_GUI *gui, uint32_t flags, const char *title, const char *text, const char *b1, const char *b2, const char *b3, GWEN_UNUSED uint32_t guiid) |
GWEN_GUI * | GWEN_Gui_CGui_new () |
int | GWEN_Gui_CGui_Print (GWEN_UNUSED GWEN_GUI *gui, GWEN_UNUSED const char *docTitle, GWEN_UNUSED const char *docType, GWEN_UNUSED const char *descr, GWEN_UNUSED const char *text, GWEN_UNUSED uint32_t guiid) |
int | GWEN_Gui_CGui_ProgressAdvance (GWEN_GUI *gui, uint32_t id, uint64_t progress) |
int | GWEN_Gui_CGui_ProgressEnd (GWEN_GUI *gui, uint32_t id) |
int | GWEN_Gui_CGui_ProgressLog (GWEN_GUI *gui, uint32_t id, GWEN_LOGGER_LEVEL level, const char *text) |
uint32_t | GWEN_Gui_CGui_ProgressStart (GWEN_GUI *gui, uint32_t progressFlags, const char *title, const char *text, uint64_t total, GWEN_UNUSED uint32_t guiid) |
void | GWEN_Gui_CGui_SetAcceptAllValidCerts (GWEN_GUI *gui, int i) |
void | GWEN_Gui_CGui_SetCertDb (GWEN_GUI *gui, GWEN_DB_NODE *dbCerts) |
void | GWEN_Gui_CGui_SetCharSet (GWEN_GUI *gui, const char *s) |
void | GWEN_Gui_CGui_SetIsNonInteractive (GWEN_GUI *gui, int i) |
void | GWEN_Gui_CGui_SetPasswordDb (GWEN_GUI *gui, GWEN_DB_NODE *dbPasswords, int persistent) |
int | GWEN_Gui_CGui_SetPasswordStatus (GWEN_GUI *gui, const char *token, const char *pin, GWEN_GUI_PASSWORD_STATUS status, GWEN_UNUSED uint32_t guiid) |
uint32_t | GWEN_Gui_CGui_ShowBox (GWEN_GUI *gui, GWEN_UNUSED uint32_t flags, const char *title, const char *text, GWEN_UNUSED uint32_t guiid) |
GWEN_GUI_CPROGRESS* GWEN_Gui_CGui__findProgress | ( | GWEN_GUI * | gui, |
uint32_t | id | ||
) |
Definition at line 555 of file cgui.c.
References GWEN_Gui_CProgress_GetId(), and GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_ProgressAdvance(), GWEN_Gui_CGui_ProgressEnd(), and GWEN_Gui_CGui_ProgressLog().
int GWEN_Gui_CGui__HashPair | ( | const char * | token, |
const char * | pin, | ||
GWEN_BUFFER * | buf | ||
) |
Definition at line 658 of file cgui.c.
References DBG_ERROR, GWEN_LOGDOMAIN, GWEN_MDigest_Begin(), GWEN_MDigest_End(), GWEN_MDigest_free(), GWEN_MDigest_GetDigestPtr(), GWEN_MDigest_GetDigestSize(), GWEN_MDigest_Md5_new(), GWEN_MDigest_Update(), and GWEN_Text_ToHexBuffer().
Referenced by GWEN_Gui_CGui_CheckCert(), GWEN_Gui_CGui_GetPassword(), and GWEN_Gui_CGui_SetPasswordStatus().
int GWEN_Gui_CGui__input | ( | GWEN_UNUSED GWEN_GUI * | gui, |
uint32_t | flags, | ||
char * | buffer, | ||
int | minLen, | ||
int | maxLen, | ||
uint32_t | guiid | ||
) |
Definition at line 215 of file cgui.c.
References DBG_INFO, GWEN_ERROR_DEFAULT_VALUE, GWEN_ERROR_USER_ABORTED, GWEN_GUI_INPUT_FLAGS_ALLOW_DEFAULT, GWEN_GUI_INPUT_FLAGS_NUMERIC, GWEN_GUI_INPUT_FLAGS_SHOW, GWEN_Gui_MessageBox(), GWEN_GUI_MSG_FLAGS_CONFIRM_B1, GWEN_GUI_MSG_FLAGS_SEVERITY_DANGEROUS, GWEN_GUI_MSG_FLAGS_TYPE_INFO, GWEN_LOGDOMAIN, and I18N.
Referenced by GWEN_Gui_CGui_InputBox().
char GWEN_Gui_CGui__readCharFromStdin | ( | int | waitFor | ) |
Definition at line 160 of file cgui.c.
Referenced by GWEN_Gui_CGui_MessageBox().
int GWEN_Gui_CGui_CheckCert | ( | GWEN_GUI * | gui, |
const GWEN_SSLCERTDESCR * | cd, | ||
GWEN_SYNCIO * | sio, | ||
uint32_t | guiid | ||
) |
Definition at line 689 of file cgui.c.
References DBG_ERROR, DBG_NOTICE, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_GetIntValue(), GWEN_DB_SetIntValue(), GWEN_ERROR_NOT_SUPPORTED, GWEN_ERROR_USER_ABORTED, GWEN_Gui_CGui__HashPair(), GWEN_GUI_FLAGS_ACCEPTVALIDCERTS, GWEN_GUI_FLAGS_NONINTERACTIVE, GWEN_Gui_GetFlags(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SSL_CERT_FLAGS_OK, GWEN_SslCertDescr_GetFingerPrint(), GWEN_SslCertDescr_GetStatusFlags(), and GWEN_SslCertDescr_GetStatusText().
Referenced by GWEN_Gui_CGui_new().
void GWENHYWFAR_CB GWEN_Gui_CGui_FreeData | ( | GWEN_UNUSED void * | bp, |
void * | p | ||
) |
Definition at line 105 of file cgui.c.
References GWEN_DB_Group_free(), GWEN_FREE_OBJECT, and GWEN_StringList_free().
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_GetPassword | ( | GWEN_GUI * | gui, |
uint32_t | flags, | ||
const char * | token, | ||
const char * | title, | ||
const char * | text, | ||
char * | buffer, | ||
int | minLen, | ||
int | maxLen, | ||
uint32_t | guiid | ||
) |
Definition at line 793 of file cgui.c.
References DBG_ERROR, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_GetCharValue(), GWEN_DB_SetCharValue(), GWEN_ERROR_USER_ABORTED, GWEN_Gui_CGui__HashPair(), GWEN_GUI_FLAGS_NONINTERACTIVE, GWEN_Gui_GetFlags(), GWEN_GUI_INPUT_FLAGS_CONFIRM, GWEN_GUI_INPUT_FLAGS_TAN, GWEN_Gui_InputBox(), GWEN_Gui_MessageBox(), GWEN_GUI_MSG_FLAGS_CONFIRM_B1, GWEN_GUI_MSG_FLAGS_SEVERITY_DANGEROUS, GWEN_GUI_MSG_FLAGS_TYPE_ERROR, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_StringList_HasString(), GWEN_StringList_RemoveString(), GWEN_Text_EscapeToBufferTolerant(), I18N, and NULL.
Referenced by GWEN_Gui_CGui_new().
void GWEN_Gui_CGui_HideBox | ( | GWEN_GUI * | gui, |
GWEN_UNUSED uint32_t | id | ||
) |
Definition at line 518 of file cgui.c.
References GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_InputBox | ( | GWEN_GUI * | gui, |
uint32_t | flags, | ||
const char * | title, | ||
const char * | text, | ||
char * | buffer, | ||
int | minLen, | ||
int | maxLen, | ||
uint32_t | guiid | ||
) |
Definition at line 430 of file cgui.c.
References DBG_ERROR, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_ERROR_INVALID, GWEN_Gui_CGui__input(), GWEN_Gui_GetRawText(), GWEN_GUI_INPUT_FLAGS_CONFIRM, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_MessageBox | ( | GWEN_GUI * | gui, |
uint32_t | flags, | ||
const char * | title, | ||
const char * | text, | ||
const char * | b1, | ||
const char * | b2, | ||
const char * | b3, | ||
GWEN_UNUSED uint32_t | guiid | ||
) |
Definition at line 348 of file cgui.c.
References DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_ERROR_USER_ABORTED, GWEN_Gui_CGui__readCharFromStdin(), GWEN_GUI_FLAGS_NONINTERACTIVE, GWEN_Gui_GetFlags(), GWEN_Gui_GetRawText(), GWEN_GUI_MSG_FLAGS_CONFIRM_BUTTON, GWEN_GUI_MSG_FLAGS_SEVERITY_IS_DANGEROUS, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_Print | ( | GWEN_UNUSED GWEN_GUI * | gui, |
GWEN_UNUSED const char * | docTitle, | ||
GWEN_UNUSED const char * | docType, | ||
GWEN_UNUSED const char * | descr, | ||
GWEN_UNUSED const char * | text, | ||
GWEN_UNUSED uint32_t | guiid | ||
) |
Definition at line 647 of file cgui.c.
References GWEN_ERROR_NOT_SUPPORTED.
int GWEN_Gui_CGui_ProgressAdvance | ( | GWEN_GUI * | gui, |
uint32_t | id, | ||
uint64_t | progress | ||
) |
Definition at line 577 of file cgui.c.
References DBG_DEBUG, GWEN_Gui_CGui__findProgress(), GWEN_Gui_CProgress_Advance(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_ProgressEnd | ( | GWEN_GUI * | gui, |
uint32_t | id | ||
) |
Definition at line 622 of file cgui.c.
References DBG_DEBUG, GWEN_Gui_CGui__findProgress(), GWEN_Gui_CProgress_End(), GWEN_Gui_CProgress_free(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_ProgressLog | ( | GWEN_GUI * | gui, |
uint32_t | id, | ||
GWEN_LOGGER_LEVEL | level, | ||
const char * | text | ||
) |
Definition at line 599 of file cgui.c.
References DBG_DEBUG, GWEN_Gui_CGui__findProgress(), GWEN_Gui_CProgress_Log(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Gui_CGui_new().
uint32_t GWEN_Gui_CGui_ProgressStart | ( | GWEN_GUI * | gui, |
uint32_t | progressFlags, | ||
const char * | title, | ||
const char * | text, | ||
uint64_t | total, | ||
GWEN_UNUSED uint32_t | guiid | ||
) |
Definition at line 530 of file cgui.c.
References GWEN_Gui_CProgress_GetId(), GWEN_Gui_CProgress_new(), and GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_new().
int GWEN_Gui_CGui_SetPasswordStatus | ( | GWEN_GUI * | gui, |
const char * | token, | ||
const char * | pin, | ||
GWEN_GUI_PASSWORD_STATUS | status, | ||
GWEN_UNUSED uint32_t | guiid | ||
) |
Definition at line 755 of file cgui.c.
References GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_ClearGroup(), GWEN_Gui_CGui__HashPair(), GWEN_Gui_PasswordStatus_Bad, GWEN_Gui_PasswordStatus_Ok, GWEN_Gui_PasswordStatus_Remove, GWEN_INHERIT_GETDATA, GWEN_StringList_AppendString(), GWEN_StringList_RemoveString(), and NULL.
Referenced by GWEN_Gui_CGui_new().
uint32_t GWEN_Gui_CGui_ShowBox | ( | GWEN_GUI * | gui, |
GWEN_UNUSED uint32_t | flags, | ||
const char * | title, | ||
const char * | text, | ||
GWEN_UNUSED uint32_t | guiid | ||
) |
Definition at line 493 of file cgui.c.
References GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Gui_GetRawText(), and GWEN_INHERIT_GETDATA.
Referenced by GWEN_Gui_CGui_new().