]> git.draconx.ca Git - liblbx.git/commitdiff
liblbx: Rename LBX_ENOENT to LBX_EINVAL.
authorNick Bowler <nbowler@draconx.ca>
Thu, 23 Jan 2014 01:54:33 +0000 (20:54 -0500)
committerNick Bowler <nbowler@draconx.ca>
Thu, 23 Jan 2014 03:14:50 +0000 (22:14 -0500)
General invalid argument makes more sense to have.

src/error.c
src/error.h
src/image.c
src/lbx.c

index 3e47204c76716ea6cd075a80e3423420af77270f..e46c28faf1b5bb696c4caeed86c169f54f7bb5ec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  2ooM: The Master of Orion II Reverse Engineering Project
  *  Utilities for out-of-band error propagation.
- *  Copyright © 2010, 2013 Nick Bowler
+ *  Copyright © 2010, 2013-2014 Nick Bowler
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -105,8 +105,8 @@ static void getmsg(int error, const char **msg)
        case LBX_EFORMAT:
                *msg = _("Invalid file format");
                break;
-       case LBX_ENOENT:
-               *msg = _("Specified item does not exist");
+       case LBX_EINVAL:
+               *msg = _("Invalid argument");
                break;
        case LBX_ENOMEM:
                *msg = _("Memory allocation failed");
index 577078aa651fded8ef0ef10af16635295685c7d5..1e78688861d540ec6cd762244be2c0ca7109746d 100644 (file)
@@ -5,7 +5,7 @@ enum {
        LBX_EOK,
        LBX_EMAGIC,
        LBX_EFORMAT,
-       LBX_ENOENT,
+       LBX_EINVAL,
        LBX_ENOMEM,
        LBX_EEOF,
        LBX_EMAX,
index e0ee129c1dcd3dc3b047ed792be8036dabc086a3..b30f165f159e4345449a4b6dc2ab50bef17d3d11 100644 (file)
@@ -331,7 +331,7 @@ unsigned char **lbx_img_getframe(struct lbx_image *pub, int frame)
        unsigned char buf[4];
 
        if (frame >= pub->frames || frame < 0) {
-               lbx_error_raise(LBX_ENOENT);
+               lbx_error_raise(LBX_EINVAL);
                return NULL;
        }
 
index a2d37961a77d33b95d8761a5a1216913ce4e9d33..30cd156c957e747392046f5c9f9b7637f0580fdc 100644 (file)
--- a/src/lbx.c
+++ b/src/lbx.c
@@ -1,7 +1,7 @@
 /*
  *  2ooM: The Master of Orion II Reverse Engineering Project
  *  Library for working with LBX archive files.
- *  Copyright © 2006-2010, 2013 Nick Bowler
+ *  Copyright © 2006-2010, 2013-2014 Nick Bowler
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -191,7 +191,7 @@ int lbx_file_stat(struct lbx *pub, unsigned fileno, struct lbx_statbuf *buf)
        static char str[256]; /* FIXME */
 
        if (fileno >= lbx->pub.nfiles) {
-               lbx_error_raise(LBX_ENOENT);
+               lbx_error_raise(LBX_EINVAL);
                buf->name = NULL;
                return -1;
        }
@@ -221,7 +221,7 @@ struct lbx_file_state *lbx_file_open(struct lbx *pub, unsigned fileno)
        struct lbx_file_state *state;
 
        if (fileno >= lbx->pub.nfiles) {
-               lbx_error_raise(LBX_ENOENT);
+               lbx_error_raise(LBX_EINVAL);
                return NULL;
        }