daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Feb 19th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /usr/local/bin/python3 /Users/fshauge/Development/Private/crawl/crawl.py
  2. /: ['ram', 'flash', 'rom']
  3. /ram/: []
  4. /flash/: []
  5. /rom/: ['puc', 'web']
  6. /rom/puc/: ['include', 'sample_1.c', 'unp.h']
  7. /rom/puc/include/: ['assert.h', 'ctype.h', 'dirent.h', 'errno.h', 'fcntl.h', 'limits.h', 'math.h', 'netdb.h', 'netinet', 'pucapi.h', 'startpuc.h', 'stdarg.h', 'stdio.h', 'stdlib.h', 'string.h', 'sys', 'termios.h', 'time.h', 'unistd.h', 'unp.h']
  8. disk cat assert.h
  9. /* Copyright (C) 1999 Gordian */
  10. #ifndef _ASSERTH
  11. #define _ASSERTH
  12.  
  13.  
  14. void _Assert(char *msg);
  15.  
  16. #undef assert
  17. #ifdef NDEBUG
  18. #define assert(test)
  19. #else
  20. #define __Str(x)  __Val(x)
  21. #define __Val(x)  #x
  22. #define assert(test)  ((test) ? (void) 0 : _Assert(/*"In "__FILE__ ", line " __Str(__LINE__)  ": "*/ #test ))
  23. #endif
  24.  
  25. #endif /* end _ASSERTH */
  26.  
  27. Local_2>
  28. disk cat ctype.h
  29. /* Copyright (C) 1999 Gordian */
  30. /* ctype.h
  31. */
  32. #ifndef _CTYPEH
  33. #define _CTYPEH
  34.  
  35. #define _C_SPA 1                       /* space */
  36. #define _C_DIG 2                       /* digit indicator */
  37. #define _C_UPP 4                       /* upper case */
  38. #define _C_LOW 8                       /* lower case */
  39. #define _C_HEX 16                      /* [A-F or [a-f] */
  40. #define _C_CTL 32                      /* Control */
  41. #define _C_PUN 64                      /* punctuation */
  42. #define _C_OTH 128                     /* other */
  43.  
  44.  
  45. #define isalnum(c)  (_CtYpE[(int)(c)] & (_C_DIG|_C_UPP|_C_LOW))
  46. #define isalpha(c)  (_CtYpE[(int)(c)] & (_C_UPP|_C_LOW))
  47. #define iscntrl(c)  (_CtYpE[(int)(c)] & (_C_CTL|_C_OTH))
  48. #define isdigit(c)  (_CtYpE[(int)(c)] & _C_DIG)
  49. #define isgraph(c)  (_CtYpE[(int)(c)] & (_C_DIG|_C_LOW|_C_UPP|_C_PUN))
  50. #define islower(c)  (_CtYpE[(int)(c)] & _C_LOW)
  51. #define isprint(c)  (_CtYpE[(int)(c)] & (_C_DIG|_C_LOW|_C_UPP|_C_PUN|_C_SPA))
  52. #define ispunct(c)  (_CtYpE[(int)(c)] & _C_PUN)
  53. #define isspace(c)  (_CtYpE[(int)(c)] & (_C_SPA|_C_CTL))
  54. #define isupper(c)  (_CtYpE[(int)(c)] & _C_UPP)
  55. #define isxdigit(c) (_CtYpE[(int)(c)] & _C_HEX)
  56.  
  57. /*
  58. * The next two macros work, but they are unsafe.
  59. * They must eventually be REPLACED.
  60. */
  61. #define tolower(c)       (isupper(c) ? (c)+32:c)
  62. #define toupper(c)       (islower(c) ? (c)-32:c)
  63.  
  64. unsigned short *_CtYpE;
  65. unsigned short *_get_ctype(void);
  66. _CtYpE = _get_ctype();
  67.  
  68. #endif
  69.  
  70.  
  71.  
  72.  
  73. Local_2>
  74. disk cat dirent.h
  75. /* Copyright (C) 1999 Gordian */
  76. #ifndef _DIRENTH
  77. #define _DIRENTH
  78.  
  79. typedef struct dirent          /* data from getdents()/readdir() */
  80. {
  81.    ino_t          d_ino;      /* inode number of entry */
  82.    unsigned short d_reclen;   /* length of this record */
  83.    char       d_name[255+1];  /* name of file */  /* non-POSIX */
  84. } Dirent;
  85.  
  86. typedef struct
  87. {
  88.    int     dd_loc;                 /* offset in block */
  89. } DIR;                    /* stream data from opendir() */
  90.  
  91. /* POSIX.1 */
  92. int closedir(DIR *dirp);
  93. DIR *opendir(const char *filename);
  94. struct dirent *readdir(DIR *dirp);
  95. void rewinddir(DIR *dirp);
  96.  
  97. /* MISC */
  98. void seekdir(DIR *dirp, long loc);
  99. long telldir(DIR *dirp);
  100.  
  101. #endif /* end _DIRENTH */
  102.  
  103.  
  104.  
  105.  
  106. Local_2>
  107. except for the absence of
  108. *          _POSIX_SOURCE.  Includes changes mandated by
  109. *     Standard C Normative Addendum 1.
  110. */
  111. #ifndef _H_ERRNO
  112. Local_2>
  113. except for the absence of
  114. *          _POSIX_SOURCE.  Includes changes mandated by
  115. *     Standard C Normative Addendum 1.
  116. */
  117. #ifndef _H_ERRNO
  118. #define _H_ERRNO
  119.  
  120. /* The only Standard C values for errno are EDOM and ERANGE. */
  121. #define EDOM       1
  122. #define ERANGE     2
  123. #define EFPOS      3   /* used for failures in fseek(),
  124.                  but never named */
  125. #define EILSEQ     39  /* added by Normative Addendum 1 */
  126.  
  127. /* POSIX values */
  128. #define E2BIG      4
  129. #define EACCES     5
  130. #define EAGAIN     6
  131. #define EBADF      7
  132. #define EBUSY      8
  133. #define ECHILD     9
  134. #define EDEADLK        10
  135. #define EEXIST     11
  136. #define EFAULT     12
  137. #define EFBIG      13
  138. #define EINTR      14
  139. #define EINVAL     15
  140. #define EIO        16
  141. #define EISDIR     17
  142. #define EMFILE     18
  143. #define EMLINK     19
  144. #define ENAMETOOLONG   20
  145. #define ENFILE     21
  146. #define ENODEV     22
  147. #define ENOENT     23
  148. #define ENOEXEC        24
  149. #define ENOLCK     25
  150. #define ENOMEM     26
  151. #define ENOSPC     27
  152. #define ENOSYS     28
  153. #define ENOTDIR        29
  154. #define ENOTEMPTY  30
  155. #define ENOTTY     31
  156. #define ENXIO      32
  157. #define EPERM      33
  158. #define EPIPE      34
  159. #define EROFS      35
  160. #define ESPIPE     36
  161. #define ESRCH      37
  162. #define EXDEV      38
  163.  
  164. /* Network errors, not part of Posix standard */
  165.   /* argument errors */
  166. #define    EWOULDBLOCK EAGAIN      /* Operation would block */
  167. #define    ENOTSOCK    40      /* Socket operation on non-socket */
  168. #define    EDESTADDRREQ    41      /* Destination address required */
  169. #define    EMSGSIZE    42      /* Message too long */
  170. #define    EPROTOTYPE  43      /* Protocol wrong type for socket */
  171. #define    ENOPROTOOPT 44      /* Protocol not available */
  172. #define    EPROTONOSUPPORT 45      /* Protocol not supported */
  173. #define    ESOCKTNOSUPPORT 46      /* Socket type not supported */
  174. #define    EOPNOTSUPP  47      /* Operation not supported on socket */
  175. #define    EPFNOSUPPORT    48      /* Protocol family not supported */
  176. #define    EAFNOSUPPORT    49      /* Address family not supported by protocol family */
  177. #define    EADDRINUSE  50      /* Address already in use */
  178. #define    EADDRNOTAVAIL   51      /* Can't assign requested address */
  179.  
  180.   /* operational errors */
  181. #define    ENETDOWN    52      /* Network is down */
  182. #define    ENETUNREACH 53      /* Network is unreachable */
  183. #define    ENETRESET   54      /* Network dropped connection on reset */
  184. #define    ECONNABORTED    55      /* Software caused connection abort */
  185. #define    ECONNRESET  56      /* Connection reset by peer */
  186. #define    ENOBUFS     57      /* No buffer space available */
  187. #define    EISCONN     58      /* Socket is already connected */
  188. #define    ENOTCONN    59      /* Socket is not connected */
  189. #define    ESHUTDOWN   60      /* Can't send after socket shutdown */
  190. #define    ETOOMANYREFS    61      /* Too many references: can't splice */
  191. #define    ETIMEDOUT   62      /* Connection timed out */
  192. #define    ECONNREFUSED    63      /* Connection refused */
  193.  
  194.   /* filesystem error */
  195. #define    ELOOP       64      /* Too many levels of symbolic links */
  196.  
  197. /* should be rearranged */
  198. #define    EHOSTDOWN   65      /* Host is down */
  199. #define    EHOSTUNREACH    66      /* No route to host */
  200.  
  201. /* quotas & mush */
  202. #define    EPROCLIM    67      /* Too many processes */
  203. #define    EUSERS      68      /* Too many users */
  204. #define    EDQUOT      69      /* Disc quota exceeded */
  205.  
  206. /* errno must be a modifiable lvalue,
  207.   and must exist separately in each
  208.   process */
  209.  
  210. #ifdef __PUC__
  211. extern int *_ErRnNo_;
  212. int * _get_errno(void);
  213. _ErRnNo_ = _get_errno();
  214. #define errno   (*_ErRnNo_)
  215. #else /* not __PUC__ */
  216. #ifdef PUNIX34
  217. extern int errno;
  218. #else
  219. extern int *_Errno(void);
  220. #define errno (*(_Errno()))
  221. #endif /* PUNIX34 */
  222. #endif /* __PUC__ */
  223.  
  224. #define ERRSET(err) (errno = (err))
  225. #define ERRRET(err) { errno = (err); return -1; }
  226. #define OKRET(rv) { errno = 0; return (rv); }
  227.  
  228.  
  229. #endif /* _H_ERRNO */
  230.  
  231. Local_2>
  232. disk cat limits.h
  233. /* Copyright (C) 1999 Gordian */
  234. #ifndef _LIMITS
  235. #define _LIMITS
  236.  
  237. #define _C2_  1
  238.  
  239. #define CHAR_BIT        8
  240. #define MB_LEN_MAX      1
  241.  
  242. #define UCHAR_MAX       0xff
  243. #define USHRT_MAX       0xffff
  244. #define UINT_MAX        (~0U)
  245. #define ULONG_MAX       (~0UL)
  246.  
  247. #define CHAR_MAX        SCHAR_MAX
  248. #define SCHAR_MAX       0x7f
  249. #define SHRT_MAX        0x7fff
  250. #define INT_MAX         0x7fffffff
  251. #define LONG_MAX        0x7fffffffL
  252.  
  253. #define CHAR_MIN        SCHAR_MIN
  254. #define SCHAR_MIN       (-SCHAR_MAX-_C2_)
  255. #define SHRT_MIN        (-SHRT_MAX-_C2_)
  256. #define INT_MIN         (-INT_MAX-_C2_)
  257. #define LONG_MIN        (-LONG_MAX-_C2_)
  258.  
  259. #endif /* end _LIMITS */
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269. Local_2>
  270. disk cat math.h
  271. /* Copyright (C) 1999 Gordian */
  272. #ifndef _MATH
  273. #define _MATH
  274.  
  275. #define random rand
  276. #define srandom(a) srand(a)
  277.  
  278. #endif /* _MATH */
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285. Local_2>
  286. disk cat netdb.h
  287. /* Copyright (C) 1999 Gordian */
  288. #if !defined(_NETDBH) && defined(_SOCKETH) // socket.h must be the includer!
  289. #define _NETDBH
  290.  
  291. /*
  292. * Structures returned by network
  293. * data base library.  All addresses
  294. * are supplied in host order, and
  295. * returned in network order (suitable
  296. * for use in system calls).
  297. */
  298. typedef struct hostent {
  299.   char    * h_name;   /* official name of host */
  300.   char    **h_aliases;    /* alias list */
  301.   int h_addrtype; /* host address type */
  302.   int h_length;   /* length of address */
  303.   char    ** h_addr_list; /* list of addresses from name server */
  304. #define    h_addr  h_addr_list[0]  /* address, for backward compatiblity */
  305. } HOSTENT;
  306.  
  307. /*
  308. * Assumption here is that a network number
  309. * fits in 32 bits -- probably a poor one.
  310. */
  311. typedef struct netent {
  312.   char        *n_name;    /* official name of net */
  313.   char        **n_aliases;    /* alias list */
  314.   int     n_addrtype; /* net address type */
  315.   unsigned long   n_net;      /* network # */
  316. } NETENT;
  317.  
  318. typedef struct servent {
  319.   char    *s_name;    /* official service name */
  320.   char    **s_aliases;    /* alias list */
  321.   int s_port;     /* port # */
  322.   char    *s_proto;   /* protocol to use */
  323. } SERVENT;
  324.  
  325. typedef struct protoent {
  326.   char    *p_name;    /* official protocol name */
  327.   char    **p_aliases;    /* alias list */
  328.   int p_proto;    /* protocol # */
  329. } PROTOENT;
  330.  
  331. /*
  332. * Error return codes from gethostbyname() and gethostbyaddr()
  333. */
  334.  
  335. extern  int h_errno;  
  336.  
  337. #define    HOST_NOT_FOUND  1 /* Authoritive Answer Host not found */
  338. #define    TRY_AGAIN   2 /* Non-Authoritive Host not found, or SERVERFAIL */
  339. #define    NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  340. #define NO_ADDRESS 4 /* Valid host name, no address, look for MX record */
  341.  
  342. #endif
  343. Local_2>
  344. /rom/puc/include/netinet/: ['in.h']
  345. disk cat in.h
  346. /* Copyright (C) 1999 - 2000 Gordian */
  347. #ifndef _INH
  348. #define _INH
  349.  
  350. /*
  351. * Constants and structures defined by the internet system,
  352. * Per RFC 790, September 1981.
  353. */
  354.  
  355. /*
  356. * Protocols
  357. */
  358. #define    IPPROTO_IP      0       /* dummy for IP */
  359. #define    IPPROTO_ICMP        1       /* control message protocol */
  360. #define    IPPROTO_GGP     2       /* gateway^2 (deprecated) */
  361. #define    IPPROTO_TCP     6       /* tcp */
  362. #define    IPPROTO_EGP     8       /* exterior gateway protocol */
  363. #define    IPPROTO_PUP     12      /* pup */
  364. #define    IPPROTO_UDP     17      /* user datagram protocol */
  365. #define    IPPROTO_IDP     22      /* xns idp */
  366.  
  367. #define    IPPROTO_RAW     255     /* raw IP packet */
  368. #define    IPPROTO_MAX     256
  369.  
  370.  
  371. /*
  372. * Ports < IPPORT_RESERVED are reserved for
  373. * privileged processes (e.g. root).
  374. * Ports >
  375. /rom/puc/include/pucapi.h/: ['in.h']
  376. disk cat in.h
  377. /* Copyright (C) 1999 - 2000 Gordian */
  378. #ifndef _INH
  379. #define _INH
  380.  
  381. /*
  382. * Constants and structures defined by the internet system,
  383. * Per RFC 790, September 1981.
  384. */
  385.  
  386. /*
  387. * Protocols
  388. */
  389. #define    IPPROTO_IP      0       /* dummy for IP */
  390. #define    IPPROTO_ICMP        1       /* control message protocol */
  391. #define    IPPROTO_GGP     2       /* gateway^2 (deprecated) */
  392. #define    IPPROTO_TCP     6       /* tcp */
  393. #define    IPPROTO_EGP     8       /* exterior gateway protocol */
  394. #define    IPPROTO_PUP     12      /* pup */
  395. #define    IPPROTO_UDP     17      /* user datagram protocol */
  396. #define    IPPROTO_IDP     22      /* xns idp */
  397.  
  398. #define    IPPROTO_RAW     255     /* raw IP packet */
  399. #define    IPPROTO_MAX     256
  400.  
  401.  
  402. /*
  403. * Ports < IPPORT_RESERVED are reserved for
  404. * privileged processes (e.g. root).
  405. * Ports >
  406. /rom/puc/include/startpuc.h/: ['in.h']
  407. disk cat in.h
  408. /* Copyright (C) 1999 - 2000 Gordian */
  409. #ifndef _INH
  410. #define _INH
  411.  
  412. /*
  413. * Constants and structures defined by the internet system,
  414. * Per RFC 790, September 1981.
  415. */
  416.  
  417. /*
  418. * Protocols
  419. */
  420. #define    IPPROTO_IP      0       /* dummy for IP */
  421. #define    IPPROTO_ICMP        1       /* control message protocol */
  422. #define    IPPROTO_GGP     2       /* gateway^2 (deprecated) */
  423. #define    IPPROTO_TCP     6       /* tcp */
  424. #define    IPPROTO_EGP     8       /* exterior gateway protocol */
  425. #define    IPPROTO_PUP     12      /* pup */
  426. #define    IPPROTO_UDP     17      /* user datagram protocol */
  427. #define    IPPROTO_IDP     22      /* xns idp */
  428.  
  429. #define    IPPROTO_RAW     255     /* raw IP packet */
  430. #define    IPPROTO_MAX     256
  431.  
  432.  
  433. /*
  434. * Ports < IPPORT_RESERVED are reserved for
  435. * privileged processes (e.g. root).
  436. * Ports >
  437. /rom/puc/include/stdarg.h/: ['in.h']
  438. disk cat in.h
  439. /* Copyright (C) 1999 - 2000 Gordian */
  440. #ifndef _INH
  441. #define _INH
  442.  
  443. /*
  444. * Constants and structures defined by the internet system,
  445. * Per RFC 790, September 1981.
  446. */
  447.  
  448. /*
  449. * Protocols
  450. */
  451. #define    IPPROTO_IP      0       /* dummy for IP */
  452. #define    IPPROTO_ICMP        1       /* control message protocol */
  453. #define    IPPROTO_GGP     2       /* gateway^2 (deprecated) */
  454. #define    IPPROTO_TCP     6       /* tcp */
  455. #define    IPPROTO_EGP     8       /* exterior gateway protocol */
  456. #define    IPPROTO_PUP     12      /* pup */
  457. #define    IPPROTO_UDP     17      /* user datagram protocol */
  458. #define    IPPROTO_IDP     22      /* xns idp */
  459.  
  460. #define    IPPROTO_RAW     255     /* raw IP packet */
  461. #define    IPPROTO_MAX     256
  462.  
  463.  
  464. /*
  465. * Ports < IPPORT_RESERVED are reserved for
  466. * privileged processes (e.g. root).
  467. * Ports >
  468. /rom/puc/include/stdio.h/: ['in.h']
  469. disk cat in.h
  470. /* Copyright (C) 1999 - 2000 Gordian */
  471. #ifndef _INH
  472. #define _INH
  473.  
  474. /*
  475. * Constants and structures defined by the internet system,
  476. * Per RFC 790, September 1981.
  477. */
  478.  
  479. /*
  480. * Protocols
  481. */
  482. #define    IPPROTO_IP      0       /* dummy for IP */
  483. #define    IPPROTO_ICMP        1       /* control message protocol */
  484. #define    IPPROTO_GGP     2       /* gateway^2 (deprecated) */
  485. #define    IPPROTO_TCP     6       /* tcp */
  486. #define    IPPROTO_EGP     8       /* exterior gateway protocol */
  487. #define    IPPROTO_PUP     12      /* pup */
  488. #define    IPPROTO_UDP     17      /* user datagram protocol */
  489. #define    IPPROTO_IDP     22      /* xns idp */
  490.  
  491. #define    IPPROTO_RAW     255     /* raw IP packet */
  492. #define    IPPROTO_MAX     256
  493.  
  494.  
  495. /*
  496. * Ports < IPPORT_RESERVED are reserved for
  497. * privileged processes (e.g. root).
  498. * Ports >
  499. /rom/puc/include/stdlib.h/: ['in.h']
  500. disk cat in.h
  501. /* Copyright (C) 1999 - 2000 Gordian */
  502. #ifndef _INH
  503. #define _INH
  504.  
  505. /*
  506. * Constants and structures defined by the internet system,
  507. * Per RFC 790, September 1981.
  508. */
  509.  
  510. /*
  511. * Protocols
  512. */
  513. #define    IPPROTO_IP      0       /* dummy for IP */
  514. #define    IPPROTO_ICMP        1       /* control message protocol */
  515. #define    IPPROTO_GGP     2       /* gateway^2 (deprecated) */
  516. #define    IPPROTO_TCP     6       /* tcp */
  517. #define    IPPROTO_EGP     8       /* exterior gateway protocol */
  518. #define    IPPROTO_PUP     12      /* pup */
  519. #define    IPPROTO_UDP     17      /* user datagram protocol */
  520. #define    IPPROTO_IDP     22      /* xns idp */
  521.  
  522. #define    IPPROTO_RAW     255     /* raw IP packet */
  523. #define    IPPROTO_MAX     256
  524.  
  525.  
  526. /*
  527. * Ports < IPPORT_RESERVED are reserved for
  528. * privileged processes (e.g. root).
  529. * Ports >
  530. disk head string.h
  531. /* Copyright (C) 1999 Gordian */
  532. #ifndef _STRINGH
  533. #define _STRINGH
  534.  
  535. #define _need_size_t
  536. #define _need_NULL
  537.  
  538. #include <sys/stdtypes.h>
  539.  
  540. #undef _need_NULL
  541. Local_2>
  542. /rom/puc/include/sys/: ['socket.h', 'stat.h', 'stdtypes.h', 'types.h']
  543. disk cat socket.h
  544. /* Copyright (C) 1999 - 2000 Gordian */
  545. #ifndef _SOCKETH
  546. #define _SOCKETH
  547.  
  548. #include <sys/types.h>
  549.  
  550. #define    SOCK_STREAM 1       /* stream socket */
  551. #define    SOCK_DGRAM  2       /* datagram socket */
  552. #define    SOCK_RAW    3       /* raw-protocol interface */
  553. #define    SOCK_RDM    4       /* reliably-delivered message */
  554. #define    SOCK_SEQPACKET  5       /* sequenced packet stream */
  555.  
  556. #define    SO_DEBUG    0x0001      /* turn on debugging info recording */
  557. #define    SO_ACCEPTCONN   0x0002      /* socket has had listen() */
  558. #define    SO_REUSEADDR    0x0004      /* allow local address reuse */
  559. #define    SO_KEEPALIVE    0x0008      /* keep connections alive */
  560. #define    SO_DONTROUTE    0x0010      /* just use interface addresses */
  561. #define    SO_BROADCAST    0x0020      /* permit sending of broadcast msgs */
  562. #define    SO_USELOOPBACK  0x0040      /* bypass hardware when possible */
  563. #define    SO_LINGER   0x0080      /* linger on close if data present */
  564. #define    SO_OOBINLINE    0x0100      /* leave received OOB data in line */
  565.  
  566. #define SO_SNDBUF  0x1001      /* send buffer size */
  567. #define SO_RCVBUF  0x1002      /* receive buffer size */
  568. #define SO_SNDLOWAT    0x1003      /* send low-water mark */
  569. #define SO_RCVLOWAT    0x1004      /* receive low-water mark */
  570. #define SO_SNDTIMEO    0x1005      /* send timeout */
  571. #define SO_RCVTIMEO    0x1006      /* receive timeout */
  572. #define    SO_ERROR    0x1007      /* get error status and clear */
  573. #define    SO_TYPE     0x1008      /* get socket type */
  574.  
  575. struct linger {
  576.   int l_onoff;        /* option on/off */
  577.   int l_linger;       /* linger time */
  578. };
  579.  
  580. /*
  581. * Level number for (get/set)sockopt() to apply to socket itself.
  582. */
  583. #define    SOL_SOCKET  0xffff      /* options for socket level */
  584.  
  585. /*
  586. * Address families.
  587. */
  588. #define    AF_UNSPEC   0       /* unspecified */
  589. #define    AF_UNIX     1       /* local to host (pipes, portals) */
  590. #define    AF_INET     2       /* internetwork: UDP, TCP, etc. */
  591. #define    AF_IMPLINK  3       /* arpanet imp addresses */
  592. #define    AF_PUP      4       /* pup protocols: e.g. BSP */
  593. #define    AF_CHAOS    5       /* mit CHAOS protocols */
  594. #define    AF_NS       6       /* XEROX NS protocols */
  595. #define    AF_NBS      7       /* nbs protocols */
  596. #define    AF_ECMA     8       /* european computer manufacturers */
  597. #define    AF_DATAKIT  9       /* datakit protocols */
  598. #define    AF_CCITT    10      /* CCITT protocols, X.25 etc */
  599. #define    AF_SNA      11      /* IBM SNA */
  600. #define AF_DECnet  12      /* DECnet */
  601. #define AF_DLI     13      /* Direct data link interface */
  602. #define AF_LAT     14      /* LAT */
  603. #define    AF_HYLINK   15      /* NSC Hyperchannel */
  604. #define    AF_APPLETALK    16      /* Apple Talk */
  605.  
  606. #define    AF_MAX      17
  607.  
  608. /*
  609. * Structure used by kernel to store most
  610. * addresses.
  611. */
  612. struct sockaddr {
  613.   u_short sa_family;      /* address family */
  614.   char    sa_data[14];        /* up to 14 bytes of direct address */
  615. };
  616.  
  617. /*
  618. * Structure used by kernel to pass protocol
  619. * information in raw sockets.
  620. */
  621. struct sockproto {
  622.   u_short sp_family;      /* address family */
  623.   u_short sp_protocol;        /* protocol */
  624. };
  625.  
  626. /*
  627. * Protocol families, same as address families for now.
  628. */
  629. #define    PF_UNSPEC   AF_UNSPEC
  630. #define    PF_UNIX     AF_UNIX
  631. #define    PF_INET     AF_INET
  632. #define    PF_IMPLINK  AF_IMPLINK
  633. #define    PF_PUP      AF_PUP
  634. #define    PF_CHAOS    AF_CHAOS
  635. #define    PF_NS       AF_NS
  636. #define    PF_NBS      AF_NBS
  637. #define    PF_ECMA     AF_ECMA
  638. #define    PF_DATAKIT  AF_DATAKIT
  639. #define    PF_CCITT    AF_CCITT
  640. #define    PF_SNA      AF_SNA
  641. #define PF_DECnet  AF_DECnet
  642. #define PF_DLI     AF_DLI
  643. #define PF_LAT     AF_LAT
  644. #define    PF_HYLINK   AF_HYLINK
  645. #define    PF_APPLETALK    AF_APPLETALK
  646.  
  647. #define    PF_MAX      AF_MAX
  648.  
  649. /*
  650. * Maximum queue length specifiable by listen.
  651. */
  652. #define    SOMAXCONN   5
  653.  
  654. /*
  655. * Message header for recvmsg and sendmsg calls.
  656. */
  657. struct msghdr {
  658.   caddr_t msg_name;       /* optional address */
  659.   int msg_namelen;        /* size of address */
  660.   struct  iovec *msg_iov;     /* scatter/gather array */
  661.   int msg_iovlen;     /* # elements in msg_iov */
  662.   caddr_t msg_accrights;      /* access rights sent/received */
  663.   int msg_accrightslen;
  664. };
  665.  
  666. #define    MSG_OOB     0x1     /* process out-of-band data */
  667. #define    MSG_PEEK    0x2     /* peek at incoming message */
  668. #define    MSG_DONTROUTE   0x4     /* send without using routing tables */
  669.  
  670. #define    MSG_MAXIOVLEN   16
  671.  
  672. #define    NBBY    8       /* number of bits in a byte */
  673.  
  674.  
  675. /* include remaining socket-related crud */
  676. #pragma push_unsafeptr
  677. #include <netdb.h>
  678. #pragma pop_ptr
  679.  
  680. /* protos */
  681.  
  682. int accept (int fd, struct sockaddr_in *addr, int *addrlen);
  683. int bind (int fd, struct sockaddr *name, int namelen);
  684. int connect (int fd, struct sockaddr *name, int namelen);
  685. int listen (int fd, int backlog);
  686. int recv (int fd, char *buf, int len, int flags);
  687. int recvfrom (int fd, char *buf, int len, int flags,
  688.     struct sockaddr_in *from, int *fromlen);
  689. int send (int fd, char *msg, int len, int flags);
  690. int sendto (int fd, char *msg, int len, int flags,
  691.     struct sockaddr_in *to, int tolen);
  692. int setsockopt (int fd, int level, int optname,
  693.     char *optval, int optlen);
  694. int shutdown (int s, int how);
  695. int socket (int domain, int type, int protocol);
  696. char *inet_ntoa (unsigned long /* struct in_addr*/ in);
  697. unsigned long inet_addr (char *cp);
  698. int getsockname (int sockfd, struct sockaddr *name, int *namelen);
  699. int gethostname (char *name, int namelen);
  700. HOSTENT *gethostbyname (char *name);
  701. SERVENT *getservbyname (const char *servname, const char *protoname);
  702. PROTOENT *getprotobyname (const char *protoname);
  703.  
  704. #endif
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711. Local_2>
  712. disk cat stat.h
  713. /* Copyright (C) 1999 Gordian */
  714. #ifndef SYSSTATH_
  715. #define SYSSTATH_
  716.  
  717. #include <sys/types.h>
  718. #define _need_time_t
  719. #include <sys/stdtypes.h>
  720. #undef _need_time_t
  721.  
  722. struct  stat {
  723.    unsigned long  st_dev;     /* struct disk* */
  724.    ino_t      st_ino;     /* inode->inon */
  725.    unsigned short st_mode;    /* inode->dsk.mode */
  726.    unsigned char  st_nlink;   /* inode->dsk.linkcount */
  727.    unsigned short st_uid;     /* inode->dsk.uid */
  728.    unsigned short st_gid;     /* inode->dsk.gid */
  729.    unsigned long  st_size;    /* inode->dsk.totallen */
  730.    time_t         st_atime;   /* inode->dsk.atime */
  731.    time_t         st_mtime;   /* inode->dsk.mtime */
  732.    time_t         st_ctime;   /* inode->dsk.ctime */
  733.    unsigned short st_blksize; /* inode->on_disk->dsk.blocksize */
  734.    unsigned long  st_blocks;  /* inode->dsk.totallen / 512 */
  735.   /* Beware st_blocks is always 512-byte blocks... dunno why, but
  736.      that seems to be ares/delphi standard.  We'd have to calculate
  737.      the real info anyway. */
  738. };
  739.  
  740. #define S_IFMT          0xf000  /* type of file */
  741. #define S_IFDIR         0x4000  /* directory */
  742. #define S_IFREG         0x8000  /* regular */
  743. #define S_IFLNK         0xa000  /* symbolic link */
  744.  
  745. #define S_IRGRP 00040           /* read permission: group */
  746. #define S_IROTH 00004           /* read permission: other */
  747. #define S_IRUSR 00400           /* read permission: owner */
  748. #define S_IRWXG 00070           /* read, write, execute: group */
  749. #define S_IRWXO 00007           /* read, write, execute: other */
  750. #define S_IRWXU 00700           /* read, write, execute: owner */
  751. #define S_ISDIR(mode)   ((mode & S_IFMT) == S_IFDIR)
  752. #define S_ISREG(mode)   ((mode & S_IFMT) == S_IFREG)
  753. #define S_ISLNK(mode)   ((mode & S_IFMT) == S_IFLNK)
  754. #define S_ISGID         0x400   /* set group id on execution */
  755. #define S_ISUID         0x800   /* set user id on execution */
  756. #define S_IWGRP 00020           /* write permission: group */
  757. #define S_IWOTH 00002           /* write permission: other */
  758. #define S_IWUSR 00200           /* write permission: owner */
  759. #define S_IXGRP 00010           /* execute permission: group */
  760. #define S_IXOTH 00001           /* execute permission: other */
  761. #define S_IXUSR 00100           /* execute permission: owner */
  762.  
  763. #define S_IREAD         S_IRUSR /* read permission, owner */
  764. #define S_IWRITE        S_IWUSR /* write permission, owner */
  765. #define S_IEXEC         S_IXUSR /* execute/search permission, owner */
  766.  
  767. int chmod(const char * path, mode_t mode);  
  768. int fstat(int filedes, struct stat *buf);
  769. int mkdir(const char *path, mode_t mode);
  770. //int mkfifo(const char * path, mode_t mode);
  771. int stat(const char *file_name, struct stat *buf);
  772. //mode_t umask(mode_t cmask);
  773.  
  774. #endif
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782. Local_2>
  783. disk cat stdtypes.h
  784. /* Copyright (C) 1999 - 2002 Gordian */
  785. #if defined(_need_size_t) && !defined(_SIZE_T)
  786. #define _SIZE_T
  787. typedef unsigned long size_t;         /*  */
  788. #endif
  789.  
  790. #if defined( _need_ptrdiff_t) && !defined(_PTRDIFF_T)
  791. #define _PTRDIFF_T
  792. typedef long ptrdiff_t;      /* result of subtracting two pointers */
  793. #endif
  794.  
  795. #if  defined( _need_wchar_t) &&  !defined(_WCHAR_T)
  796. #define _WCHAR_T
  797. typedef unsigned short  wchar_t;        /* big enough for biggest char set */
  798. #endif
  799.  
  800. #if  defined( _need_NULL) && !defined (NULL)
  801. #define NULL ((void*)0)
  802. #endif
  803.  
  804. #if defined( _need_clock_t) && !defined(_CLOCK_T)
  805. #define _CLOCK_T
  806. typedef unsigned long  clock_t;        /* units=ticks (typically 60/sec) */
  807. #endif
  808.  
  809. #if defined(_need_time_t) && !defined(_TIME_T)
  810. #define _TIME_T
  811. typedef long  time_t;         /* value = secs since epoch */
  812. #endif
  813.  
  814.  
  815.  
  816.  
  817.  
  818. Local_2>
  819. disk cat types.h
  820. /* Copyright (C) 1999 - 2002 Gordian */
  821. #ifndef _SYS_TYPES
  822. #define _SYS_TYPES
  823.  
  824. #define _need_size_t
  825. #include <sys/stdtypes.h>
  826. #undef _need_size_t
  827.  
  828. typedef char *caddr_t;
  829. typedef int pid_t;          /* process id variable */
  830. typedef int ssize_t;
  831. typedef unsigned long ino_t;
  832. typedef long off_t;
  833. typedef unsigned short uid_t;
  834. typedef unsigned short gid_t;
  835. typedef unsigned short dev_t;
  836. typedef unsigned short mode_t;
  837. typedef unsigned short umode_t;
  838. typedef unsigned char nlink_t;
  839.  
  840. typedef unsigned long  ULong,  *UlongP;
  841. typedef unsigned short UShort, *UShortP;
  842. typedef unsigned char  UChar,  *UCharP;
  843.  
  844. typedef unsigned char   uchar;
  845. typedef unsigned short  ushort;
  846. typedef unsigned int    uint;
  847. typedef unsigned long   ulong;
  848.  
  849. typedef unsigned char   u_char;
  850. typedef unsigned short  u_short;
  851. typedef unsigned int    u_int;
  852. typedef unsigned long   u_long;
  853.  
  854.  
  855. typedef long   fd_mask;
  856. #define NFDBITS    32
  857. #define    FD_SETSIZE  32
  858.  
  859. typedef    struct _fd_set {
  860.   fd_mask fds_bits[1];
  861. } fd_set;
  862.  
  863. /* Use these macros for select's mask manipulations */
  864. #define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  865. #define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  866. #define    FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  867. #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
  868.  
  869.  
  870. #endif
  871. Local_2>
  872. disk cat termios.h
  873. /* Copyright (C) 1999 - 2000 Gordian */
  874. #ifndef _TERMIOSH
  875. #define _TERMIOSH
  876.  
  877. #include <sys/stdtypes.h>
  878.  
  879. #define SERIAL_DTRON 1          /* for IO_SETDTR */
  880. #define SERIAL_DTROFF 0
  881.  
  882. #ifndef B75 // don't collide with sgtty.h
  883.  
  884. /* WARNING: DO NOT RELY ON THESE NUMBERS REMAINING THE SAME */
  885. /* THEY _WILL_ CHANGE IN THE FUTURE - USE THE #defines!!! */
  886.  
  887. /* flow control information bits */
  888.  
  889. #define SERIAL_IGAG   0x1  /* input is gagged */
  890. #define SERIAL_OGAG   0x2  /* output is gagged */
  891. #define SERIAL_IDTR   0x4  /* DSR state (1 = asserted) */
  892. #define SERIAL_ODTR   0x8  /* DTR state (1 = asserted) */
  893. #define SERIAL_CD     0x10 /* Carrier Detect */
  894. #define SERIAL_RI     0x20 /* Ring Indicate */
  895. #define SERIAL_IRTS   0x40 /* CTS state (1 = asserted) */
  896. #define SERIAL_ORTS   0x80 /* RTS state (1 = asserted) */
  897.  
  898. /* serial flags - if you add/delete, be sure to change SER_MASK below */
  899.  
  900. #define SER_ECHO   (2<<16)       /* if set echo input */
  901. #define SER_PASSFLOW    (0x40<<16)    /* if set, add xon/xoff to stream */
  902.  
  903. /* supported baud rates (mileage may vary) */
  904.  
  905. #define B300   0x4
  906. #define B600   0x5
  907. #define B1200  0x6
  908. #define B2400  0x8
  909. #define B4800  0x9
  910. #define B9600  0xb
  911. #define B19200 0xc
  912. #define B38400 0x2
  913. #define B57600 0xe
  914. #define B115200  0x10
  915. #define B230400  0x11
  916. #endif
  917.  
  918. #define SER_MASK         (0x42<<16)   /* valid flag bits */
  919.  
  920. #define CBAUD    0x1f
  921.  
  922. #define CS7    0x20
  923. #define CS8    0x40
  924. #define CSIZE  0x60
  925.  
  926. #define CSTOPB 0x80
  927. #define PARENB 0x100
  928. #define PARODD 0x200
  929. #define PAREXT  0x400 // for mark/space
  930.  
  931. #define CRTSCTS 0x800
  932. #define CXONXOFF 0x1000
  933. #define CDTRDSR 0x2000
  934.  
  935. #if 0
  936. int tcgetattr(int, struct termios *);
  937. int tcsetattr(int, int, const struct termios *);
  938.  
  939. speed_t cfgetispeed(const struct termios *);
  940. int cfsetispeed(struct termios *, speed_t);
  941.  
  942. speed_t cfgetospeed(const struct termios *);
  943. int cfsetospeed(struct termios *, speed_t);
  944.  
  945. int tcdrain(int);
  946. int tcflow(int, int);
  947. int tcsendbreak(int, int);
  948. int tcflush(int, int);
  949.  
  950. //pid_t tcgetpgrp(int);
  951. //int tcsetpgrp (int, pid_t);
  952. #endif
  953.  
  954. #endif
  955. Local_2>
  956. disk cat time.h
  957. /* Copyright (C) 1999 - 2000 Gordian */
  958. #ifndef _TIMEH
  959. #define _TIMEH
  960.  
  961. #define _need_clock_t
  962. #define _need_time_t
  963. #define _need_size_t
  964. #define _need_NULL
  965.  
  966. #include <sys/stdtypes.h>
  967.  
  968. #undef _need_clock_t
  969. #undef _need_time_t
  970. #undef _need_size_t
  971. #undef _need_NULL
  972.  
  973. #define CLOCKS_PER_SEC 100
  974. #define CLOCKS_PER_SECOND CLOCKS_PER_SEC
  975.  
  976. struct tm {
  977.        int     tm_sec;
  978.        int     tm_min;
  979.        int     tm_hour;
  980.        int     tm_mday;
  981.        int     tm_mon;
  982.        int     tm_year;
  983.        int     tm_wday;
  984.        int     tm_yday;
  985.        int     tm_isdst;
  986. };
  987.  
  988. struct timeval {
  989.   long    tv_sec;     /* seconds */
  990.   long    tv_usec;    /* and microseconds */
  991. };
  992.  
  993. char *asctime(struct tm * tm);
  994. clock_t clock(void);
  995. char *ctime(time_t * clock);
  996. // difftime did return a double (which we don't support)
  997. long difftime(time_t t1, time_t t2);
  998. struct tm *gmtime(time_t *clock);
  999. struct tm *localtime(time_t *clock);
  1000. time_t mktime(struct tm * tm);
  1001. //size_t strftime(char * buf, size_t bufsize,char * fmt,struct tm *tm);
  1002. time_t time(time_t * tloc);
  1003.  
  1004. #endif /* _TIMEH */
  1005. Local_2>
  1006. disk cat unistd.h
  1007. /* Copyright (C) 1999 - 2000 Gordian */
  1008. #ifndef UNISTDH_
  1009. #define UNISTDH_
  1010.  
  1011. #include <sys/types.h>
  1012.  
  1013. /* Symbolic constants for the "access" routine: */
  1014. #define R_OK    4       /* Test for Read permission */
  1015. #define W_OK    2       /* Test for Write permission */
  1016. #define X_OK    1       /* Test for eXecute permission */
  1017. #define F_OK    0       /* Test for existence of File */
  1018.  
  1019. /* Standard file descriptors.  */
  1020. #define STDIN_FILENO    0       /* Standard input.  */
  1021. #define STDOUT_FILENO   1       /* Standard output.  */
  1022. #define STDERR_FILENO   2       /* Standard error output.  */
  1023.  
  1024.  
  1025. #ifndef SEEK_SET
  1026. #define SEEK_SET        0       /* Set file pointer to "offset" */
  1027. #endif
  1028.  
  1029. #ifndef SEEK_CUR
  1030. #define SEEK_CUR        1       /* Set file pointer to current plus "offset" */
  1031. #endif
  1032.  
  1033. #ifndef SEEK_END
  1034. #define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
  1035. #endif
  1036.  
  1037. #ifndef NULL
  1038. #define NULL    (void*)0
  1039. #endif
  1040.  
  1041.  
  1042. /* Not implemented:
  1043.   int access(const char *path, int mode);
  1044.   int dup2(int oldfd, int newfd);
  1045. */
  1046. int    chdir(const char *path);
  1047. int    close(int handle);
  1048. int    dup(int fd);
  1049. char   *getcwd (char *buf, int size);
  1050. int    ioctl (int fd, int request, void *arg);
  1051. int    link(const char *oldpath, const char *newpath);
  1052. off_t  lseek(int fildes, off_t offset, int whence);
  1053. ssize_t    read(int fd, void  *buf, size_t count);
  1054. int    rmdir(const char * path);
  1055. int    select(int nfds, fd_set *readfds, fd_set *writefds,
  1056.          fd_set *exceptfds, struct timeval *timeout);
  1057. unsigned int sleep(unsigned int seconds);
  1058. unsigned int sleepMS(unsigned int millisec);
  1059. void   sync(void);
  1060. int    unlink(const char *fname);
  1061. ssize_t write(int fd, const void *buf, size_t count);
  1062.  
  1063.  
  1064. /* ioctl requests */
  1065. enum {IO_STTY,IO_GTTY,IO_GSTATUS,IO_INPPEND,IO_OUTPEND,
  1066.      IO_SETDTR,IO_SETRTS,IO_OUTAVAIL};
  1067.  
  1068. #endif  /* end  UNISTDH_ */
  1069.  
  1070.  
  1071.  
  1072.  
  1073. Local_2>
  1074. disk cat unp.h
  1075. /* Copyright (C) 1999 Gordian */
  1076. /*******************************************************************
  1077. *
  1078. *     Copyright (c) 1999, Lantronix
  1079. *
  1080. * Module: unp.h
  1081. * Date: Wed Aug 11 14:34:11 1999
  1082. * Description:
  1083. *        General-purpose networking header file.
  1084. *
  1085. *******************************************************************/
  1086.  
  1087. #ifndef    __unp_h
  1088. #define    __unp_h
  1089.  
  1090. #include        <startpuc.h>
  1091. #include   <netdb.h>
  1092. #include   <netinet/in.h>  /* sockaddr_in{} and other Internet defns */
  1093. #include   <sys/socket.h>  /* basic socket definitions */
  1094.  
  1095. /* Some common ports.  RFC's can be found at http://www.faqs.org/rfcs/ */
  1096. #define SOCK_ECHO            7   /* rfc 862 */
  1097. #define SOCK_DAYTIME        13   /* rfc 867 ascii time */
  1098. #define SOCK_QOTD           17   /* quote of the day */
  1099. #define SOCK_CHARGEN        19   /* rfc 864 character generator */
  1100. #define SOCK_FTPDATA        20   /* rfc 959 */
  1101. #define SOCK_FTP            21   /* rfc 959 */
  1102. #define SOCK_TELNET         23   /* rfc 854 */
  1103. #define SOCK_SMTP           25   /* rfc 821 mail */
  1104. #define SOCK_TIMESERVER     37   /* rfc 868 seconds since 1/1/1900 */
  1105. #define SOCK_DNS            53   /* rfc 1034 */
  1106. #define SOCK_TFTP           69   /* rfc 783 */
  1107. #define SOCK_FINGER         79   /* rfc 866 active users */
  1108. #define SOCK_HTTP           80   /* rfc 2068 */
  1109.  
  1110.  
  1111. #define EPROTO     71  /* never set, but defined for Stevens */
  1112. /* 2nd argument to listen().  SOMAXCONN defined in <sys/socket.h>
  1113. disk head sample_1.c
  1114. HEAD: SAMPLE_1.C: No such file or directory
  1115. Local_2>
  1116. /rom/puc/unp.h/: ['CD: UNP.H: Not a directory']
  1117. disk head CD: UNP.H: Not a directory
  1118. HEAD: CD:: No such file or directory
  1119. HEAD: UNP.H:: No such file or directory
  1120. HEAD: NOT: No such file or directory
  1121. HEAD: A: No such file or directory
  1122. HEAD: DIRECTORY: No such file or directory
  1123. Local_2>
  1124. disk head web
  1125. HEAD: WEB: Is directory
  1126. Local_2>
  1127.  
  1128. Process finished with exit code 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top