Back to index

plt-scheme  4.2.1
Functions
mzlonglong.c File Reference
#include "escheme.h"

Go to the source code of this file.

Functions

static Scheme_Objectllsize (int argc, Scheme_Object **argv)
static Scheme_Objecttoll (int argc, Scheme_Object **argv)
static Scheme_Objecttoull (int argc, Scheme_Object **argv)
static Scheme_Objectfromll (int argc, Scheme_Object **argv)
static Scheme_Objectfromull (int argc, Scheme_Object **argv)
Scheme_Objectscheme_reload (Scheme_Env *env)
Scheme_Objectscheme_initialize (Scheme_Env *env)
Scheme_Objectscheme_module_name ()

Function Documentation

static Scheme_Object* fromll ( int  argc,
Scheme_Object **  argv 
) [static]

Definition at line 29 of file mzlonglong.c.

{
  mzlonglong l;

  if (!SCHEME_BYTE_STRINGP(argv[0])
      || (SCHEME_BYTE_STRTAG_VAL(argv[0]) != sizeof(mzlonglong)))
    scheme_wrong_type("long-long-bytes->integer", 
                    "byte string of mzlonglong size",
                    0, argc, argv);


  l = *(mzlonglong *)SCHEME_BYTE_STR_VAL(argv[0]);

  return scheme_make_integer_value_from_long_long(l);
}

Here is the caller graph for this function:

static Scheme_Object* fromull ( int  argc,
Scheme_Object **  argv 
) [static]

Definition at line 45 of file mzlonglong.c.

{
  umzlonglong l;

  if (!SCHEME_BYTE_STRINGP(argv[0])
      || (SCHEME_BYTE_STRTAG_VAL(argv[0]) != sizeof(umzlonglong)))
    scheme_wrong_type("unsigned-long-long-bytes->integer", 
                    "byte string of mzlonglong size",
                    0, argc, argv);


  l = *(umzlonglong *)SCHEME_BYTE_STR_VAL(argv[0]);

  return scheme_make_integer_value_from_unsigned_long_long(l);
}

Here is the caller graph for this function:

static Scheme_Object* llsize ( int  argc,
Scheme_Object **  argv 
) [static]

Definition at line 4 of file mzlonglong.c.

{
  return scheme_make_integer(sizeof(mzlonglong));
}

Here is the caller graph for this function:

Definition at line 86 of file mzlonglong.c.

{
  /* First load is same as every load: */
  return scheme_reload(env);
}

Here is the call graph for this function:

Definition at line 92 of file mzlonglong.c.

{
  /* This extension doesn't define a module: */
  return scheme_false;
}

Definition at line 63 of file mzlonglong.c.

{
  scheme_add_global("long-long-size", 
                  scheme_make_prim_w_arity(llsize, "long-long-size", 0, 0),
                  env);

  scheme_add_global("integer->long-long-bytes", 
                  scheme_make_prim_w_arity(toll, "integer->long-long-bytes", 1, 1),
                  env);
  scheme_add_global("integer->unsigned-long-long-bytes", 
                  scheme_make_prim_w_arity(toull, "integer->unsigned-long-long-bytes", 1, 1),
                  env);

  scheme_add_global("long-long-bytes->integer", 
                  scheme_make_prim_w_arity(fromll, "long-long-bytes->integer", 1, 1),
                  env);
  scheme_add_global("unsigned-long-long-bytes->integer", 
                  scheme_make_prim_w_arity(fromull, "unsigned-long-long-bytes->integer", 1, 1),
                  env);

  return scheme_void;
}

Here is the call graph for this function:

static Scheme_Object* toll ( int  argc,
Scheme_Object **  argv 
) [static]

Definition at line 9 of file mzlonglong.c.

{
  mzlonglong l;

  if (scheme_get_long_long_val(argv[0], &l))
    return scheme_make_sized_byte_string((char *)&l, sizeof(mzlonglong), 1);
  else
    return scheme_false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static Scheme_Object* toull ( int  argc,
Scheme_Object **  argv 
) [static]

Definition at line 19 of file mzlonglong.c.

{
  umzlonglong l;

  if (scheme_get_unsigned_long_long_val(argv[0], &l))
    return scheme_make_sized_byte_string((char *)&l, sizeof(umzlonglong), 1);
  else
    return scheme_false;
}

Here is the call graph for this function:

Here is the caller graph for this function: