home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / unix / gawk.sit / source / gnufuncts.c < prev    next >
Text File  |  1990-09-29  |  2KB  |  120 lines

  1. /* 
  2.  * Copyright (C) 1986, 1988, 1989 the Free Software Foundation, Inc.
  3.  * 
  4.  * This file is part of GAWK, the GNU implementation of the
  5.  * AWK Progamming Language.
  6.  * 
  7.  * GAWK is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 1, or (at your option)
  10.  * any later version.
  11.  * 
  12.  * GAWK is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with GAWK; see the file COPYING.  If not, write to
  19.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  */
  21.  
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <string.h>
  25. #include <math.h>
  26. #include "awk.h"
  27.  
  28. void *memcpy();
  29.  
  30.  
  31.  
  32. void bzero(p,n)
  33. void *p;
  34. int n;
  35. {
  36.     memset(p,'\0',n);
  37. }
  38.  
  39.  
  40. FILE *popen(s,mode)
  41. char *s,*mode;
  42. {
  43.     fprintf(stderr,"Sorry, pipes are not implemented.\n");
  44.     exit(20);
  45. }
  46.  
  47. pclose(fp)
  48. FILE *fp;
  49. {
  50.     fprintf(stderr, "Sorry, pipes are not implemented.\n");
  51.     exit(21);
  52. }
  53.  
  54. int bcmp(d,d2,mcnt)
  55. char *d,*d2;
  56. int  mcnt;
  57. {
  58.     if (strncmp(d,d2,mcnt))
  59.          return(1);
  60.      else return(0);
  61. }
  62.      
  63. char *index(s, c)
  64. char *s,c;
  65. {
  66.  
  67.     return (strchr(s,c));
  68. }
  69.  
  70. int pipe(fildes)
  71. int fildes[2];
  72. {
  73.  
  74.     fprintf(stderr,"Sorry, pipes are not implemented.\n");
  75.     exit(22);
  76.  
  77. }
  78.  
  79. int fork()
  80. {
  81.  
  82.     fprintf(stderr,"Sorry, can't fork.\n");
  83.     exit(23);
  84.     
  85. }
  86.  
  87. int wait(junk)
  88. void * junk;
  89. {
  90.  
  91.     fprintf(stderr,"Sorry, can't wait.\n");
  92.     exit(24);
  93. }
  94.  
  95. int
  96. dup2 (old, new)
  97. int old, new;
  98. {
  99.  
  100.     fprintf(stderr,"Sorry, no dup2.\n");
  101.     exit(25);
  102.  
  103. }
  104.  
  105. pointer xmalloc(n)
  106. unsigned int n;
  107. {
  108.   extern pointer malloc();
  109.   pointer cp;
  110.   static char mesg[] = "xmalloc: no memory!\n";
  111.  
  112.   cp = malloc(n);
  113.   if (! cp) {
  114.     write (2, mesg, sizeof(mesg) - 1);
  115.     exit(1);
  116.   }
  117.   return cp;
  118. }
  119.  
  120.