#include <stdio.h>
+#include <stdbool.h>
-#include <atalk/boolean.h>
#include <atalk/logger.h>
int main(int argc, char *argv[])
if (!(fce_ev_enabled & (1 << FCE_FILE_DELETE)))
return ret;
- ret = register_fce( path->u_name, FALSE, FCE_FILE_DELETE );
+ ret = register_fce( path->u_name, false, FCE_FILE_DELETE );
return ret;
}
if (!(fce_ev_enabled & (1 << FCE_DIR_DELETE)))
return ret;
- ret = register_fce( name, TRUE, FCE_DIR_DELETE);
+ ret = register_fce( name, true, FCE_DIR_DELETE);
return ret;
}
if (!(fce_ev_enabled & (1 << FCE_DIR_CREATE)))
return ret;
- ret = register_fce( path->u_name, TRUE, FCE_DIR_CREATE );
+ ret = register_fce( path->u_name, true, FCE_DIR_CREATE );
return ret;
}
if (!(fce_ev_enabled & (1 << FCE_FILE_CREATE)))
return ret;
- ret = register_fce( path->u_name, FALSE, FCE_FILE_CREATE );
+ ret = register_fce( path->u_name, false, FCE_FILE_CREATE );
return ret;
}
return AFPERR_MISC;
}
- ret = register_fce( u_name, FALSE, FCE_FILE_MODIFY );
+ ret = register_fce( u_name, false, FCE_FILE_MODIFY );
return ret;
}
return ret;
tm_used = used; /* oh what a hack */
- ret = register_fce(vol, FALSE, FCE_TM_SIZE);
+ ret = register_fce(vol, false, FCE_TM_SIZE);
return ret;
}
#ifndef _FCE_API_INTERNAL_H
#define _FCE_API_INTERNAL_H
+#include <stdbool.h>
+
#define FCE_MAX_UDP_SOCKS 5 /* Allow a maximum of udp listeners for file change events */
#define FCE_SOCKET_RETRY_DELAY_S 600 /* Pause this time in s after socket was broken */
#define FCE_PACKET_VERSION 1
#define PACKET_HDR_LEN (sizeof(struct fce_packet) - FCE_MAX_PATH_LEN)
-int fce_handle_coalescation( char *path, int is_dir, int mode );
+bool fce_handle_coalescation( char *path, int is_dir, int mode );
void fce_initialize_history();
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
-
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <time.h>
-
-
+#include <stdbool.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
}
}
-int fce_handle_coalescation( char *path, int is_dir, int mode )
+bool fce_handle_coalescation( char *path, int is_dir, int mode )
{
/* These two are used to eval our next index in history */
/* the history is unsorted, speed should not be a problem, length is 10 */
struct timeval tv;
if (coalesce == 0)
- return FALSE;
+ return false;
/* After a file creation *ALWAYS* a file modification is produced */
if ((mode == FCE_FILE_CREATE) && (coalesce & FCE_COALESCE_CREATE))
- return TRUE;
+ return true;
/* get timestamp */
gettimeofday(&tv, 0);
if ((coalesce & FCE_COALESCE_CREATE) && (fh->mode == FCE_DIR_CREATE)) {
/* Parent dir ? */
if (!strncmp(fh->path, path, strlen(fh->path)))
- return TRUE;
+ return true;
}
/* If we find a parent dir we should be DELETED we are done */
&& (mode == FCE_FILE_DELETE || mode == FCE_DIR_DELETE)) {
/* Parent dir ? */
if (!strncmp(fh->path, path, strlen(fh->path)))
- return TRUE;
+ return true;
}
/* Detect oldest entry for next new entry */
strncpy( fce_history_list[oldest_entry_idx].path, path, MAXPATHLEN);
/* we have to handle this event */
- return FALSE;
+ return false;
}
/*
atalkincludedir = $(includedir)/atalk
atalkinclude_HEADERS = \
- adouble.h vfs.h aep.h afp.h asp.h atp.h boolean.h \
+ adouble.h vfs.h aep.h afp.h asp.h atp.h \
cnid.h compat.h ddp.h dsi.h ldapconfig.h list.h logger.h \
nbp.h netddp.h pap.h paths.h queue.h rtmp.h server_child.h \
server_ipc.h tdb.h uam.h unicode.h util.h uuid.h volinfo.h \
+++ /dev/null
-#ifndef _ATALK_BOOLEAN_H
-#define _ATALK_BOOLEAN_H 1
-
-/*
- * bool is a standard type in c++. In theory its one bit in size.
- * In reality just use the quickest standard type.
- */
-
-# ifndef __cplusplus
-# ifndef bool
-typedef char bool;
-
-/*
- * bool, true and false
- *
- */
-
-# endif /* ndef bool */
-# endif /* not C++ */
-# ifndef true
-# define true ((bool) 1)
-# endif
-# ifndef false
-# define false ((bool) 0)
-# endif
-typedef bool *BoolPtr;
-
-# ifndef TRUE
-# define TRUE 1
-# endif /* TRUE */
-
-# ifndef FALSE
-# define FALSE 0
-# endif /* FALSE */
-
-#endif
#include <limits.h>
#include <stdio.h>
-
-#include <atalk/boolean.h>
+#include <stdbool.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <time.h>
#include <ctype.h>
#include <errno.h>
+#include <stdbool.h>
-#include <atalk/boolean.h>
#include <atalk/util.h>
-
#include <atalk/logger.h>
#define OPEN_LOGS_AS_UID 0