Changeset 602bd4b in git for MP/MP


Ignore:
Timestamp:
Oct 14, 1998, 6:44:41 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
194ca37bba844b51d3966412de37838789120260
Parents:
7dd1eb69f369db2af3361bc75dca312c9b13fd5a
Message:
1998-10-14  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
    * MP_Error.c: Added prefix MP: to error strings, added skip & init
     message errors, added procedure MP_StatusErrorStr


git-svn-id: file:///usr/local/Singular/svn/trunk@2570 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
MP/MP
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • MP/MP/ChangeLog

    r7dd1eb r602bd4b  
    111998-10-14  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
     2        * MP_Error.c: Added prefix MP: to error strings, added skip & init
     3        message errors, added procedure MP_StatusErrorStr
    24
    35        * MP_PariBigInt.[c,h]: Added memory management functions for Pari
  • MP/MP/MP.h

    r7dd1eb r602bd4b  
    487487                 MP_WrongBasicVectorType,
    488488                 MP_DummyBigNum,
     489                 MP_CantSkipMsg,
     490                 MP_CantInitMsg,
    489491                 MP_MaxError };
    490492
     
    983985
    984986EXTERN char* MP_ErrorStr _ANSI_ARGS_((MP_Link_pt link));
     987
     988EXTERN char* MP_StatusErrorStr _ANSI_ARGS_((MP_Link_pt link, MP_Status_t status));
    985989
    986990EXTERN char *IMP_GetCmdlineArg _ANSI_ARGS_((int argc, char **argv, char *cmd));
  • MP/MP/MP_Error.c

    r7dd1eb r602bd4b  
    4747
    4848#ifndef lint
    49 static char vcid[] = "@(#) $Id: MP_Error.c,v 1.1.1.1 1997-05-25 20:31:46 obachman Exp $";
     49static char vcid[] = "@(#) $Id: MP_Error.c,v 1.2 1998-10-14 16:44:38 obachman Exp $";
    5050#endif /* lint */
    5151
     
    5353
    5454char *MP_errlist[]={
    55         "MP_Failure",
    56         "MP_Success",
    57         "Unknown type",
    58         "Unknown annotation",
    59         "Unknown required annotation",
    60         "Null link",   
    61         "Null transport device",
    62         "Can't open file link",
    63         "Can't make connection",
    64         "Can't allocate memory",
    65         "Can't convert",
    66         "Value is out of the legal range for this type",
    67         "Can't put node header", 
    68         "Can't put the requested node packet",
    69         "Can't put data packet",
    70         "Can't put annotation ",
     55        "MP: MP_Failure",
     56        "MP: MP_Success",
     57        "MP: Unknown type",
     58        "MP: Unknown annotation",
     59        "MP: Unknown required annotation",
     60        "MP: Null link",   
     61        "MP: Null transport device",
     62        "MP: Can't open file link",
     63        "MP: Can't make connection",
     64        "MP: Can't allocate memory",
     65        "MP: Can't convert",
     66        "MP: Value is out of the legal range for this type",
     67        "MP: Can't put node header", 
     68        "MP: Can't put the requested node packet",
     69        "MP: Can't put data packet",
     70        "MP: Can't put annotation ",
    7171
    72         "Can't get node header", 
    73         "Can't get node packet",
    74         "Can't get data packet",
    75         "Can't get annotation ",
     72        "MP: Can't get node header", 
     73        "MP: Can't get node packet",
     74        "MP: Can't get data packet",
     75        "MP: Can't get annotation ",
    7676
    77         "Packet type not of the type requested",
    78         "Can't convert, bad string",
    79         "Can't write link",
    80         "Can't read link",
    81         "Identifier is not common (longer than one character)",
    82         "Illegal element type for a Basic Vector",
    83         "Can't put/get dummy bignum"
     77        "MP: Packet type not of the type requested",
     78        "MP: Can't convert, bad string",
     79        "MP: Can't write link",
     80        "MP: Can't read link",
     81        "MP: Identifier is not common (longer than one character)",
     82        "MP: Illegal element type for a Basic Vector",
     83        "MP: Can't put/get dummy bignum",
     84        "MP: Can't skip message (end of stream)",
     85        "MP: Can't init message (end of stream)"
    8486        };
    8587
  • MP/MP/MP_Link.c

    r7dd1eb r602bd4b  
    139139
    140140#ifndef lint
    141 static char vcid[] = "@(#) $Id: MP_Link.c,v 1.3 1998-10-14 10:18:11 obachman Exp $";
     141static char vcid[] = "@(#) $Id: MP_Link.c,v 1.4 1998-10-14 16:44:38 obachman Exp $";
    142142#endif /* lint */
    143143
     
    959959    if (link->fbtbc > 0 || link->last_frag)
    960960        ERR_CHK(MP_SkipMsg(link));
    961     ERR_CHK(set_input_fragment(link));
    962 
    963     return MP_Success;
     961    if(!set_input_fragment(link))
     962      return MP_SetError(link, MP_CantInitMsg);
     963
     964    return MP_ClearError(link);
    964965}
    965966
     
    987988#endif
    988989
    989     if (link == NULL || link->env == NULL) return MP_Failure;
     990    if (link == NULL || link->env == NULL) return MP_NullLink;
    990991    while (link->fbtbc > 0 || !link->last_frag) {
    991992        if (!skip_input_bytes(link, link->fbtbc))
    992             return MP_Failure;
     993            return MP_SetError(link, MP_CantSkipMsg);
    993994
    994995        link->fbtbc = 0;
    995996        if (!link->last_frag && !set_input_fragment(link))
    996             return MP_Failure;
     997            return MP_SetError(link, MP_CantSkipMsg);
    997998    }
    998999
     
    10071008#endif
    10081009
    1009     return MP_Success;
     1010    return MP_ClearError(link);
    10101011}
    10111012
  • MP/MP/MP_Util.c

    r7dd1eb r602bd4b  
    3838
    3939#ifndef lint
    40 static char vcid[] = "@(#) $Id: MP_Util.c,v 1.3 1998-10-14 10:18:20 obachman Exp $";
     40static char vcid[] = "@(#) $Id: MP_Util.c,v 1.4 1998-10-14 16:44:39 obachman Exp $";
    4141#endif /* lint */
    4242
     
    167167
    168168}
     169
     170#ifdef __STDC__
     171char* MP_StatusErrorStr(MP_Link_pt link, MP_Status_t status)
     172#else
     173char* MP_ErrorStr(link, status)
     174  MP_Link_pt link;
     175  MP_Status_t status;
     176#endif
     177{
     178  if (link->errno != MP_Success && link->errno != MP_Failure
     179      && link->errno < MP_MaxError && link->errno >= 0)
     180    return MP_ErrorStr(link);
     181  if (status != MP_Success && status != MP_Failure &&
     182      status < MP_MaxError && status >= 0)
     183    return MP_errlist[status];
     184 
     185  if (status == MP_Failure || link->errno == MP_Failure)
     186    return MP_errlist[MP_Failure];
     187
     188  if (status == MP_Success && link->errno == MP_Success)
     189    return MP_errlist[MP_Success];
     190 
     191  return "MP: Unknown Error number";
     192}
     193
    169194
    170195
  • MP/MP/h/MP_Error.h

    r7dd1eb r602bd4b  
    5555                 MP_WrongBasicVectorType,
    5656                 MP_DummyBigNum,
     57                 MP_CantSkipMsg,
     58                 MP_CantInitMsg,
    5759                 MP_MaxError };
    5860
  • MP/MP/h/MP_Util.h

    r7dd1eb r602bd4b  
    5050EXTERN char* MP_ErrorStr _ANSI_ARGS_((MP_Link_pt link));
    5151
     52EXTERN char* MP_StatusErrorStr _ANSI_ARGS_((MP_Link_pt link, MP_Status_t status));
     53
    5254EXTERN char *IMP_GetCmdlineArg _ANSI_ARGS_((int argc, char **argv, char *cmd));
    5355
Note: See TracChangeset for help on using the changeset viewer.