Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_password.c ewl_password.h
Log Message:
Allow for using arbitrary characters for obscuring the password characters.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_password.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_password.c 7 Dec 2003 07:33:19 -0000 1.1
+++ ewl_password.c 7 Dec 2003 21:34:21 -0000 1.2
@@ -39,6 +39,7 @@
w = EWL_WIDGET(e);
ewl_entry_init(EWL_ENTRY(w), NULL);
+ e->obscure = '*';
/*
* Attach necessary callback mechanisms
@@ -86,7 +87,7 @@
len = strlen(t);
e->real_text = strdup(t);
vis = NEW(char, len + 1);
- memset(vis, '*', len);
+ memset(vis, e->obscure, len);
}
ewl_entry_set_text(EWL_ENTRY(e), vis);
@@ -109,6 +110,34 @@
w = EWL_WIDGET(e);
DRETURN_PTR(strdup(e->real_text), DLEVEL_STABLE);
+}
+
+/**
+ * @param e: the password to retrieve the obscuring character
+ * @return Returns the character value of the obscuring character.
+ * @brief Retrieves the character used to obscure the text for a password.
+ */
+char ewl_password_get_obscure(Ewl_Password * e)
+{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("e", e, 0);
+
+ DRETURN_INT(e->obscure, DLEVEL_STABLE);
+}
+
+/**
+ * @param e: set the obscuring character for a passwords text
+ * @return Returns no value.
+ * @brief Sets the character used to obscure the text for a password.
+ */
+void ewl_password_set_obscure(Ewl_Password * e, char o)
+{
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("e", e);
+
+ e->obscure = o;
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
}
void ewl_password_insert_text(Ewl_Password * e, char *s)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_password.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ewl_password.h 7 Dec 2003 07:33:19 -0000 1.1
+++ ewl_password.h 7 Dec 2003 21:34:21 -0000 1.2
@@ -39,6 +39,8 @@
void ewl_password_init(Ewl_Password * e, char *text);
void ewl_password_set_text(Ewl_Password * e, char *t);
char *ewl_password_get_text(Ewl_Password * e);
+void ewl_password_set_obscure(Ewl_Password * e, char o);
+char ewl_password_get_obscure(Ewl_Password * e);
void ewl_password_insert_text(Ewl_Password * e, char *s);
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs