LCOV - code coverage report
Current view: top level - sql/common - exception_buffer.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 11 11 100.0 %
Date: 2024-04-25 20:03:45 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /*
       2             :  * SPDX-License-Identifier: MPL-2.0
       3             :  *
       4             :  * This Source Code Form is subject to the terms of the Mozilla Public
       5             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       6             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       7             :  *
       8             :  * Copyright 2024 MonetDB Foundation;
       9             :  * Copyright August 2008 - 2023 MonetDB B.V.;
      10             :  * Copyright 1997 - July 2008 CWI.
      11             :  */
      12             : 
      13             : #include "monetdb_config.h"
      14             : #include "exception_buffer.h"
      15             : #include <string.h>
      16             : 
      17             : exception_buffer *
      18      675623 : eb_init(exception_buffer *eb)
      19             : {
      20      675623 :         if (eb) {
      21      675623 :                 eb->enabled = 0;
      22      675623 :                 eb->code = 0;
      23      675623 :                 eb->msg = NULL;
      24             :         }
      25      675623 :         return eb;
      26             : }
      27             : 
      28             : void
      29           4 : eb_error( exception_buffer *eb, char *msg, int val )
      30             : {
      31           4 :         eb->code = val;
      32           4 :         eb->msg = msg;
      33           4 :         eb->enabled = 0;                     /* not any longer... */
      34             : #ifdef HAVE_SIGLONGJMP
      35           4 :         siglongjmp(eb->state, eb->code);
      36             : #else
      37             :         longjmp(eb->state, eb->code);
      38             : #endif
      39             : }

Generated by: LCOV version 1.14