return;
}
-
-void hug_num_to_ascii(uint64 val, char *buf, int32 radix, BOOL is_neg)
-{
- char *p;
- char *firstdig;
- char temp;
- uint64 digval;
-
- PEGASUS_ASSERT(buf != NULL);
- p = buf;
- /* safeguard against a div by zero fault ! */
- if (val == 0)
- {
- *p++ = '0';
- *p = 0x00;
- return;
- }
-
- /* default to a decimal radix */
- if (radix <= 0)
- {
- radix = 10;
- }
- /* negate two's complement, print a minus sign */
- if (is_neg == TRUE)
- {
- *p++ = '-';
- val = (uint64)(-(int64)val);
- }
-
- firstdig = p;
-
- do
- {
- digval = (uint64)(val % radix);
- val /= radix;
- if (digval > 9)
- {
- *p++ = (char)(digval - 10 + 'a');
- }
- else
- {
- *p++ = (char)(digval + '0');
- }
- }while (val > 0);
-
- /* by getting the mod value before the div value, the digits are
- reversed in the buffer
- terminate the string
- */
- *p-- = '\0';
- do
- {
- temp = *p;
- *p = *firstdig;
- *firstdig = temp;
- --p;
- ++firstdig;
- }while (firstdig < p);
- return;
-}
-
-
-/* signal handler */
-void _lslp_term(int sig)
-{
- static int dieNow;
-
- if (dieNow)
- {
- raise(sig); /* recurse into oblivion */
- }
- dieNow = 1;
- /* kill threads */
- signal(sig, SIG_DFL);
- raise(sig);
-}
-
#ifdef PEGASUS_OS_ZOS
SOCKETD _lslp_socket(int domain, int type, int protocol)
{
# include "lslp-hpux.h"
#endif
-void _lslp_term(int sig) ;
void num_to_ascii(uint32 val, char *buf, int32 radix, BOOL is_neg);
-void hug_num_to_ascii(uint64 val, char *buf, int32 radix, BOOL is_neg);
typedef int SOCKETD;
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
-#define SD_BOTH SHUT_RDWR
-
-#define FAR
-
-#define LSLP_SEM_T sem_t
-#define LSLP_THREAD_T pthread_t
/** void *(*start)(void *), ustacksize, void *arg **/
# define _LSLP_STRTOK(n, d, s) strtok((n), (d) )
#endif
-
-
-
#define SOCKADDR_IN struct sockaddr_in
#define SOCKADDR struct sockaddr
#define SOCKET int
-
#ifndef TRUE
# define TRUE 1
#endif
# define FALSE 0
#endif
-#define _ultoa(v, b, r) num_to_ascii((uint32)(v), (b), (r), FALSE)
#define _itoa(v, b, r) num_to_ascii((uint32)(v), (b), (r), (((r) == 10) \
&& ((int32)(v) < 0)))
-#define _ltoa(v, b, r) num_to_ascii((uint32)(v), (b), (r), (((r) == 10) \
- && ((int32)(v) < 0)))
-#define _ul64toa(v, b, r) huge_num_to_ascii((uint64)(v), (b), (r), FALSE)
-#define _i64toa(v, b, r) huge_num_to_ascii((uint64)(v), (b), (r), (((r) == 10)\
- && ((int64)(v) < 0)))
-
-
-#define LSLP_HEXDUMP(c) ((((c) > 31) && ((c) < 128)) ? (c) : '.')
-#define LSLP_MSG_STRINGS 4
-#define LSLP_STRINGS_HEXDUMP 1
-#define LSLP_STRINGS_WORKDUMP 2
-#define LSLP_STRINGS_NADUMP 3
-
#define _LSLP_CLOSESOCKET close
#ifdef PEGASUS_OS_ZOS