/* -*-c-*-
*
- * $Id: servutil.c,v 1.3 2001/06/19 22:08:11 mdw Exp $
+ * $Id: servutil.c,v 1.5 2004/04/08 01:36:17 mdw Exp $
*
* Various handy server-only utilities
*
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: servutil.c,v $
- * Revision 1.3 2001/06/19 22:08:11 mdw
- * Use magic number for packet size.
- *
- * Revision 1.2 2001/02/16 21:41:06 mdw
- * Use new spare buffer for building MP textual representations. Add a
- * function for making human-readable time strings.
- *
- * Revision 1.1 2001/02/03 20:26:37 mdw
- * Initial checkin.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include "tripe.h"
return ((const char *)buf_t);
}
+/* --- @gestr@ --- *
+ *
+ * Arguments: @group *g@ = a group
+ * @ge *x@ = a group element
+ *
+ * Returns: A pointer to the element's textual representation.
+ *
+ * Use: Converts a group element to a string. Corrupts
+ * @buf_t@.
+ */
+
+const char *gestr(group *g, ge *x)
+{
+ if (group_writestring(g, x, (char *)buf_t, sizeof(buf_t)))
+ return ("<failed>");
+ return ((const char *)buf_t);
+}
+
/* --- @timestr@ --- *
*
* Arguments: @time_t t@ = a time to convert