Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix builds on Linux (no strlcpy), and reorganize some of the private …
…definitions to a new base-private.h header.
- Loading branch information
1 parent
e54f0f5
commit c61b3c8
Showing
15 changed files
with
247 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Private base definitions for the Printer Application Framework | ||
// | ||
// Copyright © 2019-2020 by Michael R Sweet. | ||
// | ||
// Licensed under Apache License v2.0. See the file "LICENSE" for more | ||
// information. | ||
// | ||
|
||
#ifndef _PAPPL_BASE_PRIVATE_H_ | ||
# define _PAPPL_BASE_PRIVATE_H_ | ||
|
||
|
||
// | ||
// Include necessary headers... | ||
// | ||
|
||
# include <config.h> | ||
# include <limits.h> | ||
# include <poll.h> | ||
# include <sys/fcntl.h> | ||
# include <sys/stat.h> | ||
# include <sys/wait.h> | ||
# include "base.h" | ||
|
||
extern char **environ; | ||
|
||
|
||
// | ||
// Macros... | ||
// | ||
|
||
# ifdef DEBUG | ||
# define _PAPPL_DEBUG(...) fprintf(stderr, __VA_ARGS__) | ||
# else | ||
# define _PAPPL_DEBUG(...) | ||
# endif // DEBUG | ||
|
||
# define _PAPPL_LOOKUP_STRING(bit,strings) _papplLookupString(bit, sizeof(strings) / sizeof(strings[0]), strings) | ||
# define _PAPPL_LOOKUP_VALUE(keyword,strings) _papplLookupValue(keyword, sizeof(strings) / sizeof(strings[0]), strings) | ||
|
||
# ifndef HAVE_STRLCPY | ||
# define strlcpy(dst,src,dstsize) _pappl_strlcpy(dst,src,dstsize) | ||
# endif // !HAVE_STRLCPY | ||
|
||
|
||
// | ||
// Utility functions... | ||
// | ||
|
||
# ifndef HAVE_STRLCPY | ||
extern size_t _pappl_strlcpy(char *dst, const char *src, size_t dstsize) _PAPPL_EXTERN; | ||
# endif // !HAVE_STRLCPY | ||
extern void _papplCopyAttributes(ipp_t *to, ipp_t *from, cups_array_t *ra, ipp_tag_t group_tag, int quickcopy) _PAPPL_PRIVATE; | ||
extern unsigned _papplGetRand(void) _PAPPL_PRIVATE; | ||
extern const char *_papplLookupString(unsigned bit, size_t num_strings, const char * const *strings) _PAPPL_PRIVATE; | ||
extern unsigned _papplLookupValue(const char *keyword, size_t num_strings, const char * const *strings) _PAPPL_PRIVATE; | ||
|
||
|
||
#endif // !_PAPPL_BASE_PRIVATE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.