IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 6, 2008, 10:30:49 AM (18 years ago)
Author:
Paul Price
Message:

Changing behaviour of psMessageDestination so that a protocol is not
required to be specified. "file" is the default protocol (it's still
the only protocol).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psLogMsg.c

    r15384 r16337  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2007-10-26 02:40:24 $
     13 *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2008-02-06 20:30:49 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    197197    // Destination is protocol:location
    198198    psList *protocolLocation = psStringSplit(dest, ":", false); // A list containing the protocol and location
    199     if (protocolLocation->n != 2) {
     199    const char *protocol, *location;    // Protocol and location for message
     200    if (protocolLocation->n == 1) {
     201        // "file" is the default protocol --- use it if no protocol is specified.
     202        protocol = "file";
     203        location = psListGet(protocolLocation, PS_LIST_TAIL); // The location
     204    } else if (protocolLocation->n != 2) {
    200205        psFree(protocolLocation);
    201206        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to parse protocol:location from: %s\n", dest);
    202207        return -1;
    203     }
    204     const char *protocol = psListGet(protocolLocation, PS_LIST_HEAD); // The protocol
    205     const char *location = psListGet(protocolLocation, PS_LIST_TAIL); // The location
     208    } else {
     209        protocol = psListGet(protocolLocation, PS_LIST_HEAD);
     210        location = psListGet(protocolLocation, PS_LIST_TAIL);
     211    }
    206212
    207213    if (strcasecmp(protocol, "file") == 0) {
    208         //        FILE *file = fopen(location, "w");
    209214        int fileD = creat(location, 0666);
    210215
Note: See TracChangeset for help on using the changeset viewer.