#include "dynP.h"
-int DynAppend(obj, els, num)
- DynObject obj;
- DynPtr els;
- int num;
+int
+DynAppend(DynObject obj,
+ DynPtr els,
+ int num)
{
if (obj->debug)
fprintf(stderr, "dyn: append: Writing %d bytes from %p to %p + %d\n",
static int default_increment = DEFAULT_INC;
-DynObject DynCreate(el_size, inc)
- int el_size, inc;
+DynObject
+DynCreate(int el_size,
+ int inc)
{
DynObject obj;
return obj;
}
-int DynDestroy(obj)
- DynObject obj;
+int
+DynDestroy(DynObject obj)
{
free(obj->array);
free(obj);
#include "dynP.h"
-int DynDebug(obj, state)
- DynObject obj;
- int state;
+int
+DynDebug(DynObject obj,
+ int state)
{
obj->debug = state;
* Checkers! Get away from that "hard disk erase" button!
* (Stupid dog. He almost did it to me again ...)
*/
-int DynDelete(obj, idx)
- DynObject obj;
- int idx;
+int
+DynDelete(DynObject obj,
+ int idx)
{
if (idx < 0) {
if (obj->debug)
#include "dynP.h"
-int DynInsert(obj, idx, els, num)
- DynObject obj;
- DynPtr els;
- int idx, num;
+int
+DynInsert(DynObject obj,
+ int idx,
+ DynPtr els,
+ int num)
+
{
int ret;
#include "dynP.h"
-int DynParanoid(obj, state)
- DynObject obj;
- int state;
+int
+DynParanoid(DynObject obj, int state)
{
obj->paranoid = state;
static int DynPut __P((DynObject obj, DynPtr el, int index));
-DynPtr DynGet(obj, num)
- DynObject obj;
- int num;
+DynPtr
+DynGet(DynObject obj,
+ int num)
{
if (num < 0) {
if (obj->debug)
return (DynPtr) obj->array + obj->el_size*num;
}
-int DynAdd(obj, el)
- DynObject obj;
- DynPtr el;
+int
+DynAdd(DynObject obj,
+ DynPtr el)
{
int ret;
* obj->num_el) will not be updated properly and many other functions
* in the library will lose. Have a nice day.
*/
-static int DynPut(obj, el, index)
- DynObject obj;
- DynPtr el;
- int index;
+static int
+DynPut(DynObject obj,
+ DynPtr el,
+ int index)
{
int ret;
* Ideally, this function should not be called from outside the
* library. However, nothing will break if it is.
*/
-int _DynRealloc(obj, num_incs)
- DynObject obj;
- int num_incs;
+int
+_DynRealloc(DynObject obj,
+ int num_incs)
{
DynPtr temp;
int new_size_in_bytes;
#include "dynP.h"
-int DynSize(obj)
- DynObject obj;
+int
+DynSize(DynObject obj)
{
if (obj->debug)
fprintf(stderr, "dyn: size: returning size %d.\n", obj->num_el);
static char insert2[] = "(parenthetical remark!) ";
static char insert3[] = " This follows the random string.";
-int main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc,
+ char **argv)
{
DynObject obj;
int i, s;