/* -*-c-*-
*
- * $Id: mptext-dstr.c,v 1.1 1999/11/17 18:02:16 mdw Exp $
+ * $Id: mptext-dstr.c,v 1.2 1999/12/22 15:56:21 mdw Exp $
*
* Reading and writing large integers on strings
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mptext-dstr.c,v $
+ * Revision 1.2 1999/12/22 15:56:21 mdw
+ * Make the buffer passed to `put' op constant.
+ *
* Revision 1.1 1999/11/17 18:02:16 mdw
* New multiprecision integer arithmetic suite.
*
c->i--;
}
-static int put(char *s, size_t sz, void *p)
+static int put(const char *s, size_t sz, void *p)
{
mptext_dstrctx *c = p;
DPUTM(c->d, s, sz);
/* -*-c-*-
*
- * $Id: mptext-file.c,v 1.1 1999/11/17 18:02:16 mdw Exp $
+ * $Id: mptext-file.c,v 1.2 1999/12/22 15:56:21 mdw Exp $
*
* Reading and writing large integers on files
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mptext-file.c,v $
+ * Revision 1.2 1999/12/22 15:56:21 mdw
+ * Make the buffer passed to `put' op constant.
+ *
* Revision 1.1 1999/11/17 18:02:16 mdw
* New multiprecision integer arithmetic suite.
*
static void unget(int ch, void *p) { FILE *fp = p; ungetc(ch, fp); }
-static int put(char *s, size_t sz, void *p)
+static int put(const char *s, size_t sz, void *p)
{
FILE *fp = p;
return (fwrite(s, 1, sz, fp) != sz);
/* -*-c-*-
*
- * $Id: mptext-string.c,v 1.1 1999/11/17 18:02:16 mdw Exp $
+ * $Id: mptext-string.c,v 1.2 1999/12/22 15:56:21 mdw Exp $
*
* Reading and writing large integers on strings
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mptext-string.c,v $
+ * Revision 1.2 1999/12/22 15:56:21 mdw
+ * Make the buffer passed to `put' op constant.
+ *
* Revision 1.1 1999/11/17 18:02:16 mdw
* New multiprecision integer arithmetic suite.
*
c->buf--;
}
-static int put(char *s, size_t sz, void *p)
+static int put(const char *s, size_t sz, void *p)
{
mptext_stringctx *c = p;
int rc = 0;
/* -*-c-*-
*
- * $Id: mptext.h,v 1.2 1999/12/10 23:29:48 mdw Exp $
+ * $Id: mptext.h,v 1.3 1999/12/22 15:56:30 mdw Exp $
*
* Textual representation of multiprecision numbers
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mptext.h,v $
+ * Revision 1.3 1999/12/22 15:56:30 mdw
+ * Make the buffer passed to `put' op constant.
+ *
* Revision 1.2 1999/12/10 23:29:48 mdw
* Change header file guard names.
*
typedef struct mptext_ops {
int (*get)(void */*p*/);
void (*unget)(int /*ch*/, void */*p*/);
- int (*put)(char */*s*/, size_t /*len*/, void */*p*/);
+ int (*put)(const char */*s*/, size_t /*len*/, void */*p*/);
} mptext_ops;
/*----- Functions provided ------------------------------------------------*/