Index: diff/diff3.c =================================================================== RCS file: /cvs/ccvs/diff/diff3.c,v retrieving revision 1.14 diff -c -r1.14 diff3.c *** diff/diff3.c 7 Aug 2001 15:35:52 -0000 1.14 --- diff/diff3.c 22 Jul 2002 14:23:33 -0000 *************** *** 1326,1332 **** if (wstatus == 2) diff3_fatal ("subsidiary diff failed"); ! if (-1 == (fd = open (diffout, O_RDONLY))) diff3_fatal ("could not open temporary diff file"); current_chunk_size = 8 * 1024; --- 1326,1332 ---- if (wstatus == 2) diff3_fatal ("subsidiary diff failed"); ! if (-1 == (fd = open (diffout, O_RDONLY, 0))) /* Amiga */ diff3_fatal ("could not open temporary diff file"); current_chunk_size = 8 * 1024; Index: diff/system.h =================================================================== RCS file: /cvs/ccvs/diff/system.h,v retrieving revision 1.7 diff -c -r1.7 system.h *** diff/system.h 9 Aug 2001 19:55:58 -0000 1.7 --- diff/system.h 22 Jul 2002 14:23:34 -0000 *************** *** 27,32 **** --- 27,36 ---- #include #include + #ifdef AMIGA + typedef int ssize_t; + #endif /* AMIGA */ + /* Note that PARAMS is just internal to the diff library; diffrun.h has its own mechanism, which will hopefully be less likely to conflict with the library's caller's namespace. */ *************** *** 279,284 **** --- 283,292 ---- *(q)++ = '\''; \ } #endif + + #ifdef AMIGA + #include "amiga.h" + #endif /* AMIGA */ /* these come from CVS's lib/system.h, but I wasn't sure how to include that * properly or even if I really should Index: lib/getopt.c =================================================================== RCS file: /cvs/ccvs/lib/getopt.c,v retrieving revision 1.5 diff -c -r1.5 getopt.c *** lib/getopt.c 2 Jan 1997 19:07:41 -0000 1.5 --- lib/getopt.c 22 Jul 2002 14:23:38 -0000 *************** *** 66,71 **** --- 66,75 ---- #include #endif /* GNU C library. */ + #ifdef AMIGA + #include + #endif /* AMIGA */ + /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. Index: lib/getopt.h =================================================================== RCS file: /cvs/ccvs/lib/getopt.h,v retrieving revision 1.4 diff -c -r1.4 getopt.h *** lib/getopt.h 26 Mar 1999 15:47:21 -0000 1.4 --- lib/getopt.h 22 Jul 2002 14:23:38 -0000 *************** *** 97,103 **** --- 97,107 ---- exactly why), and there is no particular need to prototype it. We really shouldn't be trampling on the system's namespace at all by declaring getopt() but that is a bigger issue. */ + #ifdef AMIGA + extern int getopt (int argc, char * const *argv, const char *optstring); + #else extern int getopt (); + #endif extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); Index: lib/regex.c =================================================================== RCS file: /cvs/ccvs/lib/regex.c,v retrieving revision 1.11 diff -c -r1.11 regex.c *** lib/regex.c 19 Jun 2000 16:45:24 -0000 1.11 --- lib/regex.c 22 Jul 2002 14:23:58 -0000 *************** *** 145,151 **** static char re_syntax_table[CHAR_SET_SIZE]; static void ! init_syntax_once () { register int c; static int done = 0; --- 145,151 ---- static char re_syntax_table[CHAR_SET_SIZE]; static void ! init_syntax_once (void) { register int c; static int done = 0; *************** *** 358,364 **** #define false 0 #define true 1 ! static int re_match_2_internal (); /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A --- 358,366 ---- #define false 0 #define true 1 ! static int re_match_2_internal(struct re_pattern_buffer *bufp, const char *string1, ! int size1, const char *string2, int size2, int pos, ! struct re_registers *regs, int stop); /* AMiGA */ /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A *************** *** 540,548 **** #ifdef DEBUG static void ! extract_number (dest, source) ! int *dest; ! unsigned char *source; { int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; --- 542,548 ---- #ifdef DEBUG static void ! extract_number (int *dest, unsigned char *source) /* AMiGA */ { int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; *************** *** 567,575 **** #ifdef DEBUG static void ! extract_number_and_incr (destination, source) ! int *destination; ! unsigned char **source; { extract_number (destination, *source); *source += 2; --- 567,573 ---- #ifdef DEBUG static void ! extract_number_and_incr (int *destination, unsigned char **source) /* AMiGA */ { extract_number (destination, *source); *source += 2; *************** *** 1530,1540 **** /* Subroutine declarations and macros for regex_compile. */ ! static void store_op1 (), store_op2 (); ! static void insert_op1 (), insert_op2 (); ! static boolean at_begline_loc_p (), at_endline_loc_p (); ! static boolean group_in_compile_stack (); ! static reg_errcode_t compile_range (); /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant --- 1528,1541 ---- /* Subroutine declarations and macros for regex_compile. */ ! /* AMiGA */ ! static void store_op1(re_opcode_t op, unsigned char *loc, int arg); ! static void store_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2); ! static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end); ! static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end); ! static boolean at_begline_loc_p(const char *pattern, const char *p, reg_syntax_t syntax); ! static boolean at_endline_loc_p(const char *p, const char *pend, int syntax); ! static boolean group_in_compile_stack(struct compile_stack_type compile_stack, unsigned regnum); /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant *************** *** 1687,1693 **** } compile_stack_elt_t; ! typedef struct { compile_stack_elt_t *stack; unsigned size; --- 1688,1694 ---- } compile_stack_elt_t; ! typedef struct compile_stack_type { compile_stack_elt_t *stack; unsigned size; *************** *** 1809,1816 **** but don't make them smaller. */ static ! regex_grow_registers (num_regs) ! int num_regs; { if (num_regs > regs_allocated_size) { --- 1810,1816 ---- but don't make them smaller. */ static ! regex_grow_registers(int num_regs) /* AMiGA */ { if (num_regs > regs_allocated_size) { *************** *** 1857,1867 **** } while (0) static reg_errcode_t ! regex_compile (pattern, size, syntax, bufp) ! const char *pattern; ! int size; ! reg_syntax_t syntax; ! struct re_pattern_buffer *bufp; { /* We fetch characters from PATTERN here. Even though PATTERN is `char *' (i.e., signed), we declare these variables as unsigned, so --- 1857,1865 ---- } while (0) static reg_errcode_t ! regex_compile (const char *pattern, int size, ! reg_syntax_t syntax, ! struct re_pattern_buffer *bufp) /* AMiGA */ { /* We fetch characters from PATTERN here. Even though PATTERN is `char *' (i.e., signed), we declare these variables as unsigned, so *************** *** 3107,3117 **** const char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; ! return /* After a subexpression? */ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) /* After an alternative? */ ! || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); } --- 3105,3115 ---- const char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; ! return (boolean)( /* AMiGA */ /* After a subexpression? */ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) /* After an alternative? */ ! || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash))); } *************** *** 3127,3139 **** boolean next_backslash = *next == '\\'; const char *next_next = p + 1 < pend ? p + 1 : 0; ! return /* Before a subexpression? */ (syntax & RE_NO_BK_PARENS ? *next == ')' : next_backslash && next_next && *next_next == ')') /* Before an alternative? */ || (syntax & RE_NO_BK_VBAR ? *next == '|' ! : next_backslash && next_next && *next_next == '|'); } --- 3125,3137 ---- boolean next_backslash = *next == '\\'; const char *next_next = p + 1 < pend ? p + 1 : 0; ! return (boolean)( /* AMiGA */ /* Before a subexpression? */ (syntax & RE_NO_BK_PARENS ? *next == ')' : next_backslash && next_next && *next_next == ')') /* Before an alternative? */ || (syntax & RE_NO_BK_VBAR ? *next == '|' ! : next_backslash && next_next && *next_next == '|')); } *************** *** 3937,3946 **** /* Declarations and macros for re_match_2. */ ! static int bcmp_translate (); ! static boolean alt_match_null_string_p (), ! common_op_match_null_string_p (), ! group_match_null_string_p (); /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ --- 3935,3945 ---- /* Declarations and macros for re_match_2. */ ! /* AMiGA */ ! static int bcmp_translate(unsigned char *s1, unsigned char *s2, int len, RE_TRANSLATE_TYPE translate); ! static boolean alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info); ! static boolean common_op_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info); ! static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info); /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ Index: lib/regex.h =================================================================== RCS file: /cvs/ccvs/lib/regex.h,v retrieving revision 1.5 diff -c -r1.5 regex.h *** lib/regex.h 19 Jun 2000 16:45:24 -0000 1.5 --- lib/regex.h 22 Jul 2002 14:24:00 -0000 *************** *** 485,493 **** #ifdef _REGEX_RE_COMP /* 4.2 bsd compatibility. */ /* CVS: don't use prototypes: they may conflict with system headers. */ extern char *re_comp _RE_ARGS (()); extern int re_exec _RE_ARGS (()); ! #endif /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags)); --- 485,499 ---- #ifdef _REGEX_RE_COMP /* 4.2 bsd compatibility. */ /* CVS: don't use prototypes: they may conflict with system headers. */ + #ifdef AMIGA + extern char *re_comp _RE_ARGS((const char *s)); + extern int re_exec _RE_ARGS((const char *s)); + #else extern char *re_comp _RE_ARGS (()); extern int re_exec _RE_ARGS (()); ! #endif /* AMIGA */ ! ! #endif /* _REGEX_RE_COMP */ /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags)); Index: lib/sighandle.c =================================================================== RCS file: /cvs/ccvs/lib/sighandle.c,v retrieving revision 1.7 diff -c -r1.7 sighandle.c *** lib/sighandle.c 23 Feb 2000 10:11:25 -0000 1.7 --- lib/sighandle.c 22 Jul 2002 14:24:01 -0000 *************** *** 65,71 **** /* Define linked list of signal handlers structure */ struct SIG_hlist { ! RETSIGTYPE (*handler)(); struct SIG_hlist *next; }; --- 65,71 ---- /* Define linked list of signal handlers structure */ struct SIG_hlist { ! RETSIGTYPE (*handler)(int sig); /* AMiGA */ struct SIG_hlist *next; }; Index: lib/system.h =================================================================== RCS file: /cvs/ccvs/lib/system.h,v retrieving revision 1.42 diff -c -r1.42 system.h *** lib/system.h 15 Feb 2001 02:53:07 -0000 1.42 --- lib/system.h 22 Jul 2002 14:24:04 -0000 *************** *** 477,482 **** --- 477,490 ---- #endif /* defined (__CYGWIN32__) || defined (WIN32) */ + #ifdef AMIGA + #include "amiga.h" + + #define FOLD_FN_CHAR(c) amiga_fold_fn_char(c) + #define FILENAMES_CASE_INSENSITIVE 1 + #define ISDIRSEP(c) ((c) == ':' || (c) == '/') + #endif /* AMIGA */ + /* Some file systems are case-insensitive. If FOLD_FN_CHAR is #defined, it maps the character C onto its "canonical" form. In a case-insensitive system, it would map all alphanumeric characters Index: lib/xgetwd.c =================================================================== RCS file: /cvs/ccvs/lib/xgetwd.c,v retrieving revision 1.5 diff -c -r1.5 xgetwd.c *** lib/xgetwd.c 29 Nov 1997 22:52:35 -0000 1.5 --- lib/xgetwd.c 22 Jul 2002 14:24:04 -0000 *************** *** 29,36 **** --- 29,41 ---- /* Amount by which to increase buffer size when allocating more space. */ #define PATH_INCR 32 + #ifdef AMIGA + char *xmalloc(size_t); + char *xrealloc(void *ptr, size_t bytes); + #else char *xmalloc (); char *xrealloc (); + #endif /* AMIGA */ /* Return the current directory, newly allocated, arbitrarily long. Return NULL and set errno on error. */ Index: lib/xtime.h =================================================================== RCS file: /cvs/ccvs/lib/xtime.h,v retrieving revision 1.1 diff -c -r1.1 xtime.h *** lib/xtime.h 15 Feb 2001 02:53:07 -0000 1.1 --- lib/xtime.h 22 Jul 2002 14:24:05 -0000 *************** *** 27,32 **** --- 27,36 ---- # endif /* !HAVE_SYS_TIME_H */ # endif /* !TIME_WITH_SYS_TIME */ + # ifdef timezone + # undef timezone /* needed for sgi */ + # endif /* timezone */ + # ifdef HAVE_SYS_TIMEB_H # include # else /* HAVE_SYS_TIMEB_H */ *************** *** 45,54 **** short dstflag; /* Field not used */ }; # endif /* !HAVE_SYS_TIMEB_H */ - - # ifdef timezone - # undef timezone /* needed for sgi */ - # endif /* timezone */ # if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE) extern long timezone; --- 49,54 ---- Index: src/buffer.c =================================================================== RCS file: /cvs/ccvs/src/buffer.c,v retrieving revision 1.18 diff -c -r1.18 buffer.c *** src/buffer.c 9 Aug 2001 19:26:35 -0000 1.18 --- src/buffer.c 22 Jul 2002 14:24:08 -0000 *************** *** 1405,1411 **** --- 1405,1417 ---- } # ifdef SHUTDOWN_SERVER + #ifdef AMIGA + if (current_parsed_root->method == server_method) + SHUTDOWN_SERVER_INPUT(fileno(bc->fp)); + else + #else if (current_parsed_root->method != server_method) + #endif /* AMIGA */ # endif # ifndef NO_SOCKET_TO_FD { *************** *** 1433,1439 **** --- 1439,1449 ---- * SHUTDOWN_SERVER_OUTPUT */ if (current_parsed_root->method == server_method) + #ifdef AMIGA + SHUTDOWN_SERVER_OUTPUT(fileno(bc->fp)); + #else SHUTDOWN_SERVER ( fileno (bc->fp) ); + #endif /* AMIGA */ else # endif # ifndef NO_SOCKET_TO_FD Index: src/checkout.c =================================================================== RCS file: /cvs/ccvs/src/checkout.c,v retrieving revision 1.106 diff -c -r1.106 checkout.c *** src/checkout.c 19 Jul 2001 16:35:32 -0000 1.106 --- src/checkout.c 22 Jul 2002 14:24:12 -0000 *************** *** 337,343 **** } send_to_server (m_type == EXPORT ? "export\012" : "co\012", 0); ! return get_responses_and_close (); } #endif /* CLIENT_SUPPORT */ --- 337,343 ---- } send_to_server (m_type == EXPORT ? "export\012" : "co\012", 0); ! return get_responses_and_close(); } #endif /* CLIENT_SUPPORT */ Index: src/client.c =================================================================== RCS file: /cvs/ccvs/src/client.c,v retrieving revision 1.309 diff -c -r1.309 client.c *** src/client.c 9 Aug 2001 20:27:26 -0000 1.309 --- src/client.c 22 Jul 2002 14:24:31 -0000 *************** *** 699,705 **** a time. */ nbytes = recv (sb->socket, data, size, 0); ! if (nbytes < 0) error (1, 0, "reading from server: %s", SOCK_STRERROR (SOCK_ERRNO)); if (nbytes == 0) { --- 699,705 ---- a time. */ nbytes = recv (sb->socket, data, size, 0); ! if (nbytes < 0) error (1, 0, "reading from server: %s", SOCK_STRERROR (SOCK_ERRNO)); if (nbytes == 0) { *************** *** 798,804 **** --- 798,810 ---- /* shutdown() socket */ # ifdef SHUTDOWN_SERVER + #ifdef AMIGA + if (current_parsed_root->method == server_method) + SHUTDOWN_SERVER_INPUT(n->socket); + else + #else if (current_parsed_root->method != server_method) + #endif /* AMIGA */ # endif if (shutdown (n->socket, 0) < 0) { *************** *** 809,821 **** } else if (buf->output) { - /* shutdown() socket */ # ifdef SHUTDOWN_SERVER /* FIXME: Should have a SHUTDOWN_SERVER_INPUT & * SHUTDOWN_SERVER_OUTPUT */ if (current_parsed_root->method == server_method) SHUTDOWN_SERVER (n->socket); else # endif if (shutdown (n->socket, 1) < 0) --- 815,830 ---- } else if (buf->output) { # ifdef SHUTDOWN_SERVER /* FIXME: Should have a SHUTDOWN_SERVER_INPUT & * SHUTDOWN_SERVER_OUTPUT */ if (current_parsed_root->method == server_method) + #ifdef AMIGA + SHUTDOWN_SERVER_OUTPUT(n->socket); + #else SHUTDOWN_SERVER (n->socket); + #endif /* AMIGA */ else # endif if (shutdown (n->socket, 1) < 0) *************** *** 3484,3490 **** memcpy (buf, data, nread); ! return nread; } /* --- 3493,3499 ---- memcpy (buf, data, nread); ! return (size_t)nread; /* AMiGA */ } /* *************** *** 3789,3797 **** --- 3798,3810 ---- same. */ if (tofd == fromfd) { + #ifdef AMIGA + fprintf(stderr,"HELP! dup() called!\n"); + #else fromfd = dup (tofd); if (fromfd < 0) error (1, errno, "cannot dup net connection"); + #endif /* AMIGA */ } /* These will use binary mode on systems which have it. */ *************** *** 3815,3821 **** } - /* Connect to a forked server process. */ void --- 3828,3833 ---- *************** *** 5019,5025 **** else fd = CVS_OPEN (file, O_RDONLY | OPEN_BINARY); #else ! fd = CVS_OPEN (file, O_RDONLY | (bin ? OPEN_BINARY : 0)); #endif if (fd < 0) --- 5031,5037 ---- else fd = CVS_OPEN (file, O_RDONLY | OPEN_BINARY); #else ! fd = CVS_OPEN (file, O_RDONLY | (bin ? OPEN_BINARY : 0), 0); /* AMiGA */ #endif if (fd < 0) Index: src/cvs.h =================================================================== RCS file: /cvs/ccvs/src/cvs.h,v retrieving revision 1.225 diff -c -r1.225 cvs.h *** src/cvs.h 24 Aug 2001 17:47:02 -0000 1.225 --- src/cvs.h 22 Jul 2002 14:24:36 -0000 *************** *** 58,63 **** --- 58,67 ---- #include #endif + #ifdef AMIGA + #include "amiga.h" + #endif /* AMIGA */ + #ifdef SERVER_SUPPORT /* If the system doesn't provide strerror, it won't be declared in string.h. */ Index: src/filesubr.c =================================================================== RCS file: /cvs/ccvs/src/filesubr.c,v retrieving revision 1.54 diff -c -r1.54 filesubr.c *** src/filesubr.c 25 May 2001 18:43:15 -0000 1.54 --- src/filesubr.c 22 Jul 2002 14:24:39 -0000 *************** *** 63,69 **** else { /* Not a link or a device... probably a regular file. */ ! if ((fdin = open (from, O_RDONLY)) < 0) error (1, errno, "cannot open %s for copying", from); if (fstat (fdin, &sb) < 0) error (1, errno, "cannot fstat %s", from); --- 63,69 ---- else { /* Not a link or a device... probably a regular file. */ ! if ((fdin = open (from, O_RDONLY, 0)) < 0) /* AMiGA */ error (1, errno, "cannot open %s for copying", from); if (fstat (fdin, &sb) < 0) error (1, errno, "cannot fstat %s", from); *************** *** 110,115 **** --- 110,119 ---- t.actime = sb.st_atime; t.modtime = sb.st_mtime; (void) utime (to, &t); + + #ifdef AMIGA + (void) chmod (to, sb.st_mode); + #endif /* AMIGA */ } /* FIXME-krp: these functions would benefit from caching the char * & *************** *** 426,431 **** --- 430,436 ---- * removal of all of the files in the directory. Return -1 on error * (in which case errno is set). */ + #ifndef AMIGA int unlink_file_dir (f) const char *f; *************** *** 466,471 **** --- 471,477 ---- return CVS_UNLINK (f); } + #endif /* AMIGA */ /* Remove a directory and everything it contains. Returns 0 for * success, -1 for failure (in which case errno is set). *************** *** 579,585 **** nchars -= nread; } while (nchars != 0); ! return bp - buf; } --- 585,591 ---- nchars -= nread; } while (nchars != 0); ! return (size_t)(bp - buf); /* AMiGA */ } *************** *** 620,625 **** --- 626,632 ---- return result; } + #ifndef AMIGA /* If FILE1 and FILE2 are devices, they are equal if their device numbers match. */ if (S_ISBLK (sb1.st_mode) || S_ISCHR (sb1.st_mode)) *************** *** 634,644 **** file1, file2); #endif } ! if ((fd1 = open (file1, O_RDONLY)) < 0) ! error (1, errno, "cannot open file %s for comparing", file1); ! if ((fd2 = open (file2, O_RDONLY)) < 0) ! error (1, errno, "cannot open file %s for comparing", file2); /* A generic file compare routine might compare st_dev & st_ino here to see if the two files being compared are actually the same file. --- 641,652 ---- file1, file2); #endif } + #endif /* AMIGA */ ! if ((fd1 = open (file1, O_RDONLY, 0 )) < 0) /* AMiGA */ ! error (1, errno, "cannot open file %s for comparing", file1); ! if ((fd2 = open (file2, O_RDONLY, 0)) < 0) /* AMiGA */ ! error (1, errno, "cannot open file %s for comparing", file2); /* A generic file compare routine might compare st_dev & st_ino here to see if the two files being compared are actually the same file. *************** *** 683,688 **** --- 691,697 ---- return (ret); } + #ifndef AMIGA /* Generate a unique temporary filename. Returns a pointer to a newly * malloc'd string containing the name. Returns successfully or not at * all. *************** *** 706,711 **** --- 715,721 ---- error (0, errno, "Failed to close temporary file %s", fn); return fn; } + #endif /* AMIGA */ /* Generate a unique temporary filename and return an open file stream * to the truncated file by that name *************** *** 738,743 **** --- 748,754 ---- * NFS locking thing, but until I hear of more problems, I'm not going to * bother. */ + #ifndef AMIGA FILE *cvs_temp_file (filename) char **filename; { *************** *** 844,850 **** --- 855,863 ---- *filename = fn; return fp; } + #endif /* AMIGA */ + #ifndef AMIGA /* Return non-zero iff FILENAME is absolute. Trivial under Unix, but more complicated under other systems. */ int *************** *** 853,858 **** --- 866,872 ---- { return filename[0] == '/'; } + #endif /* AMIGA */ /* * Return a string (dynamically allocated) with the name of the file to which *************** *** 892,898 **** return tfile; } ! /* Return a pointer into PATH's last component. */ char * last_component (path) --- 906,912 ---- return tfile; } ! #ifndef AMIGA /* Return a pointer into PATH's last component. */ char * last_component (path) *************** *** 905,910 **** --- 919,925 ---- else return path; } + #endif /* AMIGA */ /* Return the home directory. Returns a pointer to storage managed by this function or its callees (currently getenv). *************** *** 954,959 **** --- 969,975 ---- return home; } + #ifndef AMIGA /* See cvs.h for description. On unix this does nothing, because the shell expands the wildcards. */ void *************** *** 969,974 **** --- 985,991 ---- for (i = 0; i < argc; ++i) (*pargv)[i] = xstrdup (argv[i]); } + #endif /* AMIGA */ #ifdef SERVER_SUPPORT /* Case-insensitive string compare. I know that some systems Index: src/hash.c =================================================================== RCS file: /cvs/ccvs/src/hash.c,v retrieving revision 1.32 diff -c -r1.32 hash.c *** src/hash.c 9 Jun 2000 20:54:01 -0000 1.32 --- src/hash.c 22 Jul 2002 14:24:40 -0000 *************** *** 21,28 **** /* hash function */ static int ! hashp (key) ! const char *key; { unsigned int h = 0; unsigned int g; --- 21,27 ---- /* hash function */ static int ! hashp (const char *key) /* AMiGA */ { unsigned int h = 0; unsigned int g; *************** *** 38,44 **** h = (h ^ (g >> 24)) ^ g; } ! return (h % HASHSIZE); } /* --- 37,43 ---- h = (h ^ (g >> 24)) ^ g; } ! return (int)(h % HASHSIZE); /* AMiGA */ } /* *************** *** 184,190 **** freenode_mem (p) Node *p; { ! if (p->delproc != (void (*) ()) NULL) p->delproc (p); /* call the specified delproc */ else { --- 183,189 ---- freenode_mem (p) Node *p; { ! if (p->delproc != (void (*) (void *)) NULL) /* AMiGA */ p->delproc (p); /* call the specified delproc */ else { *************** *** 196,202 **** /* to be safe, re-initialize these */ p->key = p->data = (char *) NULL; ! p->delproc = (void (*) ()) NULL; } /* --- 195,201 ---- /* to be safe, re-initialize these */ p->key = p->data = (char *) NULL; ! p->delproc = (void (*) (void *)) NULL; /* AMiGA */ } /* Index: src/hash.h =================================================================== RCS file: /cvs/ccvs/src/hash.h,v retrieving revision 1.14 diff -c -r1.14 hash.h *** src/hash.h 9 Jun 2000 20:54:01 -0000 1.14 --- src/hash.h 22 Jul 2002 14:24:40 -0000 *************** *** 11,16 **** --- 11,20 ---- */ #define HASHSIZE 151 + #ifdef AMIGA + #undef NT_UNKNOWN + #endif /* AMIGA */ + /* * Types of nodes */ *************** *** 31,37 **** struct node *hashprev; char *key; char *data; ! void (*delproc) (); }; typedef struct node Node; --- 35,41 ---- struct node *hashprev; char *key; char *data; ! void (*delproc) (void *); /* AMiGA */ }; typedef struct node Node; Index: src/history.c =================================================================== RCS file: /cvs/ccvs/src/history.c,v retrieving revision 1.57 diff -c -r1.57 history.c *** src/history.c 3 May 2001 19:35:16 -0000 1.57 --- src/history.c 22 Jul 2002 14:24:46 -0000 *************** *** 1060,1066 **** int fd; struct stat st_buf; ! if ((fd = CVS_OPEN (fname, O_RDONLY | OPEN_BINARY)) < 0) error (1, errno, "cannot open history file: %s", fname); if (fstat (fd, &st_buf) < 0) --- 1060,1066 ---- int fd; struct stat st_buf; ! if ((fd = CVS_OPEN (fname, O_RDONLY | OPEN_BINARY, 0)) < 0) /* AMiGA */ error (1, errno, "cannot open history file: %s", fname); if (fstat (fd, &st_buf) < 0) Index: src/main.c =================================================================== RCS file: /cvs/ccvs/src/main.c,v retrieving revision 1.170 diff -c -r1.170 main.c *** src/main.c 13 Mar 2002 19:31:14 -0000 1.170 --- src/main.c 22 Jul 2002 14:24:50 -0000 *************** *** 18,24 **** --- 18,26 ---- #ifdef HAVE_WINSOCK_H #include #else + #ifndef AMIGA extern int gethostname (); + #endif /* AMIGA */ #endif char *program_name; *************** *** 99,105 **** char *nick1; char *nick2; ! int (*func) (); /* Function takes (argc, argv) arguments. */ unsigned long attr; /* Attributes. */ } cmds[] = --- 101,107 ---- char *nick1; char *nick2; ! int (*func) (int argc, char ** argv); /* Function takes (argc, argv) arguments. */ /* AMiGA */ unsigned long attr; /* Attributes. */ } cmds[] = *************** *** 544,552 **** --- 546,562 ---- (void) fputs ("\n", stdout); version (0, (char **) NULL); (void) fputs ("\n", stdout); + #ifndef AMIGA (void) fputs ("\ Copyright (c) 1989-2001 Brian Berliner, david d `zoo' zuhn, \n\ Jeff Polk, and other authors\n", stdout); + #else + (void) fputs ("\ + Copyright (c) 1989-2001 Brian Berliner, david d `zoo' zuhn, \n\ + Jeff Polk, and other authors\n\ + ported by:\n\ + Copyright (c) 2001-2002 Olaf `olsen' Barthel and Jens Langner\n", stdout); + #endif /* AMIGA */ (void) fputs ("\n", stdout); (void) fputs ("CVS may be copied only under the terms of the GNU General Public License,\n", stdout); (void) fputs ("a copy of which can be found with the CVS distribution kit.\n", stdout); Index: src/parseinfo.c =================================================================== RCS file: /cvs/ccvs/src/parseinfo.c,v retrieving revision 1.36 diff -c -r1.36 parseinfo.c *** src/parseinfo.c 24 Aug 2001 17:47:02 -0000 1.36 --- src/parseinfo.c 22 Jul 2002 14:24:54 -0000 *************** *** 44,49 **** --- 44,61 ---- return (1); } + /* This should be interesting. If this is a remote repository, + * then trying to open it locally is not going to provide for + * a lot of useful information. So we're going to skip it. It's + * causing trouble with the Amiga implementation, too. + */ + #ifdef AMIGA + { + if (current_parsed_root->isremote) + return (1); + } + #endif /* AMIGA */ + /* find the info file and open it */ infopath = xmalloc (strlen (current_parsed_root->directory) + strlen (infofile) Index: src/run.c =================================================================== RCS file: /cvs/ccvs/src/run.c,v retrieving revision 1.33 diff -c -r1.33 run.c *** src/run.c 24 Jan 2001 03:35:10 -0000 1.33 --- src/run.c 22 Jul 2002 14:24:55 -0000 *************** *** 98,103 **** --- 98,182 ---- const char *sterr; int flags; { + #ifdef AMIGA + int len,total_len,quotes,escape,result,i,j; + char * s; + char * arg; + char * command; + + if (noexec && (flags & RUN_REALLY) == 0) + return (0); + + total_len = 0; + for (i = 0; i < run_argc; i++) + { + arg = run_argv[i]; + len = strlen(arg); + quotes = 0; + + for(j = 0 ; j < len ; j++) + { + if(arg[j] == ' ' && quotes == 0) + quotes = 2; + else if (arg[j] == '\"') + total_len++; + } + + total_len += len + quotes + 1; + } + + command = malloc(total_len+1); + if(command == NULL) + { + errno = ENOMEM; + return(-1); + } + + s = command; + + for (i = 0; i < run_argc; i++) + { + arg = run_argv[i]; + len = strlen(arg); + quotes = escape = 0; + + for(j = 0 ; j < len ; j++) + { + if(arg[j] == ' ') + quotes = 1; + else if (arg[j] == '\"') + escape = 1; + + if(quotes == 1 && escape == 1) + break; + } + + if(quotes) + (*s++) = '\"'; + + for(j = 0 ; j < len ; j++) + { + if(arg[j] == '\"') + (*s++) = '*'; + + (*s++) = arg[j]; + } + + if(quotes) + (*s++) = '\"'; + + if(i < run_argc-1) + (*s++) = ' '; + } + + (*s) = '\0'; + + result = system(command); + free(command); + + return(0); + + #else int shin, shout, sherr; int mode_out, mode_err; int status; *************** *** 345,350 **** --- 424,431 ---- if (rerrno) errno = rerrno; return (rc); + + #endif /* AMIGA */ } void *************** *** 402,407 **** --- 483,495 ---- int *tofdp; int *fromfdp; { + #ifdef AMIGA + int pid; + + pid = amiga_piped_child(command,tofdp,fromfdp); + + return(pid); + #else int pid; int to_child_pipe[2]; int from_child_pipe[2]; *************** *** 447,452 **** --- 535,541 ---- *tofdp = to_child_pipe[1]; *fromfdp = from_child_pipe[0]; return pid; + #endif /* AMIGA */ } *************** *** 454,461 **** close_on_exec (fd) int fd; { #ifdef F_SETFD if (fcntl (fd, F_SETFD, 1)) ! error (1, errno, "can't set close-on-exec flag on %d", fd); #endif } --- 543,552 ---- close_on_exec (fd) int fd; { + #ifndef AMIGA #ifdef F_SETFD if (fcntl (fd, F_SETFD, 1)) ! error (1, errno, "can't set close-on-exec flag on %d", fd); #endif + #endif /* AMIGA */ } Index: src/subr.c =================================================================== RCS file: /cvs/ccvs/src/subr.c,v retrieving revision 1.71 diff -c -r1.71 subr.c *** src/subr.c 7 Aug 2001 15:35:32 -0000 1.71 --- src/subr.c 22 Jul 2002 14:24:57 -0000 *************** *** 742,748 **** But that would require editing each filesubr.c and so the expedient hack seems to be looking at HAVE_READLINK. */ newname = xreadlink (*filename); ! if (isabsolute (newname)) { free (*filename); --- 742,748 ---- But that would require editing each filesubr.c and so the expedient hack seems to be looking at HAVE_READLINK. */ newname = xreadlink (*filename); ! if (isabsolute (newname)) { free (*filename); Index: zlib/zconf.h =================================================================== RCS file: /cvs/ccvs/zlib/zconf.h,v retrieving revision 1.1.1.3 diff -c -r1.1.1.3 zconf.h *** zlib/zconf.h 11 Mar 2002 22:11:55 -0000 1.1.1.3 --- zlib/zconf.h 22 Jul 2002 14:24:59 -0000 *************** *** 276,279 **** --- 276,283 ---- # pragma map(inflate_trees_free,"INTRFR") #endif + #ifdef AMIGA + #include "amiga.h" + #endif /* AMIGA */ + #endif /* _ZCONF_H */