version 1.28, 2005/03/03 04:40:51 |
version 1.35, 2008/08/01 08:29:40 |
|
|
/* -*- mode: C -*- */ |
/* -*- mode: C -*- */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox_toolkit.h,v 1.27 2003/11/12 15:20:18 iwane Exp $ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox_toolkit.h,v 1.34 2007/03/14 10:30:54 ohara Exp $ */ |
|
|
#ifndef _OX_TOOLKIT_H_ |
#ifndef _OX_TOOLKIT_H_ |
|
|
#define _OX_TOOLKIT_H_ |
#define _OX_TOOLKIT_H_ |
|
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <gmp.h> |
#include <gmp.h> |
|
|
/* #define FREE(x) free((x)) */ |
/* #define FREE(x) free((x)) */ |
#define FREE(x) |
#define FREE(x) |
|
|
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
#if !defined(__GNUC__) && !defined(__inline__) |
#if !defined(__GNUC__) && !defined(__inline__) |
#define __inline__ |
#define __inline__ |
#endif |
#endif |
Line 51 typedef struct OXFILE{ |
|
Line 51 typedef struct OXFILE{ |
|
int wbuf_size; |
int wbuf_size; |
int wbuf_count; |
int wbuf_count; |
int (*send_double)(struct OXFILE *oxfp, double int64); |
int (*send_double)(struct OXFILE *oxfp, double int64); |
int (*receive_double)(struct OXFILE *oxfp); |
double (*receive_double)(struct OXFILE *oxfp); |
} OXFILE; |
} OXFILE; |
|
|
typedef struct cmo { |
typedef struct cmo { |
Line 115 typedef struct { |
|
Line 115 typedef struct { |
|
|
|
typedef struct { |
typedef struct { |
int tag; |
int tag; |
cmo *num; /* Bunshi (cmo_zz) */ |
mpq_t mpq; |
cmo *den; /* Bunbo (cmo_zz) */ |
|
} cmo_qq; |
} cmo_qq; |
|
|
typedef struct { |
typedef struct { |
Line 180 cmo_int32* new_cmo_int32(int i); |
|
Line 179 cmo_int32* new_cmo_int32(int i); |
|
cmo_string* new_cmo_string(char* s); |
cmo_string* new_cmo_string(char* s); |
cmo_mathcap* new_cmo_mathcap(cmo* ob); |
cmo_mathcap* new_cmo_mathcap(cmo* ob); |
cmo_list* new_cmo_list(); |
cmo_list* new_cmo_list(); |
|
cmo_list* new_cmo_list_array(void *a[], int n); |
|
cmo_list* new_cmo_list_array_map(void *a[], int n, void *(* mapf)(void *)); |
cmo_monomial32* new_cmo_monomial32(); |
cmo_monomial32* new_cmo_monomial32(); |
cmo_monomial32* new_cmo_monomial32_size(int size); |
cmo_monomial32* new_cmo_monomial32_size(int size); |
cmo_zz* new_cmo_zz(); |
cmo_zz* new_cmo_zz(); |
Line 188 cmo_zz* new_cmo_zz_set_si(int integer); |
|
Line 189 cmo_zz* new_cmo_zz_set_si(int integer); |
|
cmo_zz* new_cmo_zz_set_mpz(mpz_ptr z); |
cmo_zz* new_cmo_zz_set_mpz(mpz_ptr z); |
cmo_zz* new_cmo_zz_noinit(); |
cmo_zz* new_cmo_zz_noinit(); |
cmo_zz* new_cmo_zz_set_string(char* s); |
cmo_zz* new_cmo_zz_set_string(char* s); |
|
cmo_qq* new_cmo_qq(); |
|
cmo_qq* new_cmo_qq_set_mpq(mpq_ptr q); |
|
cmo_qq* new_cmo_qq_set_mpz(mpz_ptr num, mpz_ptr den); |
cmo_zero* new_cmo_zero(); |
cmo_zero* new_cmo_zero(); |
cmo_double* new_cmo_double(double d); |
cmo_double* new_cmo_double(double d); |
cmo_distributed_polynomial* new_cmo_distributed_polynomial(); |
cmo_distributed_polynomial* new_cmo_distributed_polynomial(); |
Line 208 char* new_string_set_cmo(cmo* m); |
|
Line 212 char* new_string_set_cmo(cmo* m); |
|
|
|
cmo_error2* make_error_object(int err_code, cmo* ob); |
cmo_error2* make_error_object(int err_code, cmo* ob); |
|
|
|
cmo* ox_parse_lisp(char *s); |
|
|
/* Low level API */ |
/* Low level API */ |
cmo* receive_cmo(OXFILE *fp); |
cmo* receive_cmo(OXFILE *fp); |
cmo* receive_cmo_tag(OXFILE *fp, int tag); |
cmo* receive_cmo_tag(OXFILE *fp, int tag); |
Line 266 int add_hook_after_send_cmo(hook_t func); |
|
Line 272 int add_hook_after_send_cmo(hook_t func); |
|
#define PFLAG_ADDREV 1 |
#define PFLAG_ADDREV 1 |
|
|
typedef struct symbol *symbol_t; |
typedef struct symbol *symbol_t; |
|
|
void setflag_parse(int flag); |
|
cmo *parse(); |
|
void init_parser(char *s); |
|
|
|
symbol_t lookup_by_symbol(char *key); |
symbol_t lookup_by_symbol(char *key); |
symbol_t lookup_by_token(int tok); |
symbol_t lookup_by_token(int tok); |