| 
            Last change
 on this file since 517 was             502, checked in by frichard, 15 years ago           | 
        
        
          | 
             
-BAOControl : petite interface permettant de contrôler les antennes via le pilote indi_BAO 
-Le pilote indi_BAO utilise désormais indilib v 0.7 
 
           | 
        
        
          | 
            File size:
            660 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | /* exception.c */
 | 
|---|
| 2 | /* fonctions de manipulation de la pile */
 | 
|---|
| 3 | 
 | 
|---|
| 4 | #include "exception.h"
 | 
|---|
| 5 | 
 | 
|---|
| 6 | except *_exceptions = NULL;
 | 
|---|
| 7 | 
 | 
|---|
| 8 | /* empile */
 | 
|---|
| 9 | 
 | 
|---|
| 10 | void push_exc(){
 | 
|---|
| 11 |   except* layer;
 | 
|---|
| 12 |   layer = (except*) malloc(sizeof(except));
 | 
|---|
| 13 |   if(layer == NULL){
 | 
|---|
| 14 |     fprintf(stderr,"[push_exc()]Erreur d'allocation memoire pour la pile");
 | 
|---|
| 15 |   }
 | 
|---|
| 16 |   layer->super = _exceptions;
 | 
|---|
| 17 |   _exceptions = layer;
 | 
|---|
| 18 | }
 | 
|---|
| 19 | 
 | 
|---|
| 20 | /* depile */
 | 
|---|
| 21 | 
 | 
|---|
| 22 | void pop_exc(int ex){
 | 
|---|
| 23 |   except* super;
 | 
|---|
| 24 |   super = _exceptions->super;
 | 
|---|
| 25 |   free(_exceptions);
 | 
|---|
| 26 |   _exceptions = super;
 | 
|---|
| 27 |   if(ex){
 | 
|---|
| 28 |     if(_exceptions){
 | 
|---|
| 29 |       longjmp(_exceptions->ctx, ex);
 | 
|---|
| 30 |     }
 | 
|---|
| 31 |     else{
 | 
|---|
| 32 |       fprintf(stderr, "Exception non geree : %d\n", ex);
 | 
|---|
| 33 |       exit(-1);
 | 
|---|
| 34 |     }
 | 
|---|
| 35 |   }
 | 
|---|
| 36 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.