Skip to content
Snippets Groups Projects
Select Git revision
  • 36ec36fcb2ae00213f34657fb25815296d4d111c
  • master default
  • labcomm2006
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
16 results

labcomm_error.h

Blame
  • Forked from Anders Blomdell / LabComm
    313 commits behind the upstream repository.
    labcomm_error.h 2.13 KiB
    /*
      labcomm_error.h -- labcomm error declarations
    
      Copyright 2013 Anders Blomdell <anders.blomdell@control.lth.se>
    
      This file is part of LabComm.
    
      LabComm is free software: you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation, either version 3 of the License, or
      (at your option) any later version.
    
      LabComm is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.
    
      You should have received a copy of the GNU General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */
    
    #ifndef __LABCOMM_ERROR_H__
    #define __LABCOMM_ERROR_H__
    
    enum labcomm_error {
    #define LABCOMM_ERROR(name, description) name ,
    #include "labcomm_error.h"
    #undef LABCOMM_ERROR
    };
    
    struct labcomm_error_handler;
    
    void labcomm_error_warning(struct labcomm_error_handler *e,
    			   enum labcomm_error,
    			   char *format,
    			   ...);
    			 
    void labcomm_error_fatal_global(enum labcomm_error error,
    				char *format,
    				...);
    			 
    #endif
    
    #ifdef LABCOMM_ERROR
    
    LABCOMM_ERROR(LABCOMM_ERROR_SIGNATURE_ALREADY_SET, 
    	      "Signature has already been set")
    LABCOMM_ERROR(LABCOMM_ERROR_SIGNATURE_NOT_SET, 
    	      "Signature has not been set")
    
    LABCOMM_ERROR(LABCOMM_ERROR_ENC_NO_REG_SIGNATURE, 
    	      "Encoder has no registration for this signature")
    LABCOMM_ERROR(LABCOMM_ERROR_ENC_BUF_FULL,
    	      "The labcomm buffer is full")
    LABCOMM_ERROR(LABCOMM_ERROR_DEC_UNKNOWN_DATATYPE,
    	      "Decoder: Unknown datatype")
    LABCOMM_ERROR(LABCOMM_ERROR_DEC_INDEX_MISMATCH, 
    	      "Decoder: index mismatch")
    LABCOMM_ERROR(LABCOMM_ERROR_DEC_TYPE_NOT_FOUND,
    	      "Decoder: type not found")
    LABCOMM_ERROR(LABCOMM_ERROR_UNIMPLEMENTED_FUNC,
    	      "This function is not yet implemented")
    LABCOMM_ERROR(LABCOMM_ERROR_MEMORY,
    	      "Could not allocate memory")
    LABCOMM_ERROR(LABCOMM_ERROR_USER_DEF,     
    	      "User defined error")
    LABCOMM_ERROR(LABCOMM_ERROR_BAD_WRITER,
    	      "Decoder: writer_ioctl() failed")
    
    #endif