~ubuntu-branches/ubuntu/maverick/speech-tools/maverick

« back to all changes in this revision

Viewing changes to siod/slib.cc

  • Committer: Bazaar Package Importer
  • Author(s): Kumar Appaiah, Kartik Mistry, Kumar Appaiah
  • Date: 2010-07-17 11:32:04 UTC
  • mfrom: (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100717113204-mnse3jo236j107q8
Tags: 1:2.0.95~beta-1
[ Kartik Mistry ]
* debian/control:
  + [Lintian] Added missing ${misc:Depends}
  + Updated Standards-Version to 3.8.4 (no changes needed)
* debian/patches/const_char.diff:
  + Added missing patch header
* Removed unused patch invalid_const_char_conversion_fixes.diff

[ Kumar Appaiah ]
* New upstream release.
* Standards Version is now 3.9.0 (No changes needed)
* Update debian/rules to specify version numbers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
  500000;
190
190
#endif
191
191
 
 
192
void NNEWCELL(LISP *_into,long _type)
 
193
{if NULLP(freelist)               
 
194
        {
 
195
             gc_for_newcell();              
 
196
        }
 
197
    *_into = freelist;                
 
198
    freelist = CDR(freelist);        
 
199
    ++gc_cells_allocated;
 
200
    
 
201
    (*_into)->gc_mark = 0;               
 
202
    (*_into)->type = (short) _type;
 
203
}
 
204
 
 
205
void need_n_cells(int n)
 
206
{
 
207
    /* Check there are N cells available, and force gc if not */
 
208
    LISP x = NIL;
 
209
    int i;
 
210
 
 
211
    for (i=0; i<n; i++)
 
212
        x = cons(NIL,x);
 
213
 
 
214
    return;
 
215
}
 
216
 
192
217
static void start_rememberring_dead(void)
193
218
{
194
219
  num_dead_pointers=0;
1087
1112
 gc_ms_stats_start();
1088
1113
 setjmp(save_regs_gc_mark);
1089
1114
 mark_locations((LISP *) save_regs_gc_mark,
1090
 
                (LISP *) (((char *) save_regs_gc_mark) + sizeof(save_regs_gc_mark)));
 
1115
                (LISP *) (((char *) save_regs_gc_mark) + sizeof(save_regs_gc_mark)));
1091
1116
 mark_protected_registers();
1092
1117
 mark_locations((LISP *) stack_start_ptr,
1093
1118
                (LISP *) &stack_end);
1257
1282
 errjmp_ok = 0;
1258
1283
 old_status_flag = gc_status_flag;
1259
1284
 if NNULLP(args)
1260
 
   if NULLP(car(args)) gc_status_flag = 0; else gc_status_flag = 1;
 
1285
 {
 
1286
   if NULLP(car(args)) 
 
1287
       gc_status_flag = 0; 
 
1288
   else 
 
1289
       gc_status_flag = 1;
 
1290
 }
1261
1291
 gc_mark_and_sweep();
1262
1292
 gc_status_flag = old_status_flag;
1263
1293
 errjmp_ok = ej_ok;
1278
1308
{LISP l;
1279
1309
 int n;
1280
1310
 if NNULLP(args) 
 
1311
 {
1281
1312
   if NULLP(car(args)) gc_status_flag = 0; else gc_status_flag = 1;
 
1313
 }
1282
1314
 if (gc_kind_copying == 1)
1283
1315
   {if (gc_status_flag)
1284
1316
      fput_st(fwarn,"garbage collection is on\n");
1312
1344
 return(result);}
1313
1345
 
1314
1346
LISP extend_env(LISP actuals,LISP formals,LISP env)
1315
 
{if SYMBOLP(formals)
1316
 
   return(cons(cons(cons(formals,NIL),cons(actuals,NIL)),env));
1317
 
 return(cons(cons(formals,actuals),env));}
 
1347
{
 
1348
    if SYMBOLP(formals)
 
1349
        return(cons(cons(cons(formals,NIL),cons(actuals,NIL)),env));
 
1350
    else
 
1351
        return(cons(cons(formals,actuals),env));
 
1352
}
1318
1353
 
1319
1354
#define ENVLOOKUP_TRICK 1
 
1355
LISP global_var = NIL;
 
1356
LISP global_env = NIL;
1320
1357
 
1321
1358
LISP envlookup(LISP var,LISP env)
1322
1359
{LISP frame,al,fl,tmp;
 
1360
    global_var = var;
 
1361
    global_env = env;
1323
1362
 for(frame=env;CONSP(frame);frame=CDR(frame))
1324
1363
   {tmp = CAR(frame);
1325
1364
    if NCONSP(tmp) err("damaged frame",tmp);
1332
1371
    if (SYMBOLP(fl) && EQ(fl, var)) return(cons(al, NIL));
1333
1372
#endif
1334
1373
  }
1335
 
 if NNULLP(frame) err("damaged env",env);
 
1374
 if NNULLP(frame) 
 
1375
              err("damaged env",env);
1336
1376
 return(NIL);}
1337
1377
 
1338
1378
void set_eval_hooks(long type,LISP (*fcn)(LISP, LISP *,LISP *))
1340
1380
 p = get_user_type_hooks(type);
1341
1381
 p->leval = fcn;}
1342
1382
 
1343
 
LISP leval(LISP x,LISP env)
 
1383
LISP leval(LISP x,LISP qenv)
1344
1384
{LISP tmp,arg1,rval;
 
1385
    LISP env;
1345
1386
 struct user_type_hooks *p;
 
1387
 env = qenv;
1346
1388
 STACK_CHECK(&x);
1347
1389
 backtrace = cons(x,backtrace);
1348
1390
 loop:
1422
1464
           }
1423
1465
           goto loop;
1424
1466
         case tc_closure:
1425
 
           env = extend_env(leval_args(CDR(x),env),
 
1467
           env = extend_env(leval_args(CDR(x),env),
1426
1468
                            car((*tmp).storage_as.closure.code),
1427
1469
                            (*tmp).storage_as.closure.env);
1428
1470
           x = cdr((*tmp).storage_as.closure.code);
1443
1485
                 goto loop;}
1444
1486
           err("bad function",tmp);}
1445
1487
    default:
1446
 
      backtrace = cdr(backtrace);
1447
 
      return(x);}}
 
1488
        backtrace = cdr(backtrace);
 
1489
        return(x);}}
1448
1490
 
1449
1491
void set_print_hooks(long type,
1450
1492
                     void (*prin1)(LISP, FILE *),
1542
1584
 commentp = 0;
1543
1585
 while(1)
1544
1586
   {c = GETC_FCN(f);
1545
 
    if (c == EOF) if (eoferr) err(eoferr,NIL); else return(c);
 
1587
    if (c == EOF) { if (eoferr) err(eoferr,NIL); else return(c); }
1546
1588
    if (commentp) {if (c == '\n') commentp = 0;}
1547
1589
    else if (c == ';') commentp = 1;
1548
1590
    else if (!isspace(c)) return(c);}}