#include #include #include #include #include "lceb.h" static char **combs; static int ncombs=0; void print_comb(n) int n; { printf("comb %d/%d=[%s]\n", n, ncombs, combs[n]); } void print_combs() { int i; printf("op combs: "); for (i=0; i 0){ if(len & 1) result *= nops; nops *= nops; len >>=1; } return result; } static char *combine(ops, len, n) char *ops; /* string to combine */ int len; /* len of result */ int n; /* iteration # */ { static char *res=NULL; static int len_ops; int i; if (!res) { // 1st call len_ops=strlen(ops); # ifdef DEBUG_MEM printf("mem: allocating operators working area (%d bytes)\n", len+1); # endif res=malloc(len * sizeof(char) + 1); } for(i=0; i