C preprocessor macros beginning/ending with underscores are
reserved for system use as well as macros containing a double
underscore anywhere, so application software macros are
supposed to be named differently.
For a header file gphoto2-abilities-list.h, this
consistently uses a macro name
LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H
for the usual
#ifndef LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H
#define LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H
... content of the header file ...
#endif /* !defined(LIBGPHOTO2_GPHOTO2_ABILITIES_LIST_H) */
Found using "clang -Weverything".
This should work, unless when run with an ancient C preprocessor
which might only the first 8 or 10 characters to distinguish
macro names and ignores the remainder of the name.
56 lines
1.9 KiB
C
56 lines
1.9 KiB
C
/* lowlevel.h
|
|
*
|
|
* Copyright 2001 Lutz Mueller <lutz@users.sourceforge.net>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef CAMLIBS_KONICA_LOWLEVEL_H
|
|
#define CAMLIBS_KONICA_LOWLEVEL_H
|
|
|
|
#include <gphoto2/gphoto2-port.h>
|
|
#include <gphoto2/gphoto2-context.h>
|
|
|
|
int l_ping (GPPort *, GPContext *);
|
|
int l_init (GPPort *, GPContext *);
|
|
|
|
/*
|
|
* Some comments on the structure of send_buffer, image_buffer,
|
|
* and receive_buffer:
|
|
*
|
|
* send_buffer: The first two bytes are low order and high
|
|
* byte of the command, followed by at least two
|
|
* more bytes. The number of sent bytes has to be
|
|
* even.
|
|
*
|
|
* image_buffer: This buffer will contain raw data like
|
|
* jpeg or exif data.
|
|
*
|
|
* receive_buffer: The first two bytes will be the same as
|
|
* in send_buffer. This will be checked
|
|
* here. Then will follow low and high
|
|
* order byte of the return status. After
|
|
* that, depending on command and return
|
|
* status, other bytes will follow.
|
|
*/
|
|
int l_send_receive (GPPort *, GPContext *,
|
|
unsigned char *send_buffer, unsigned int send_buffer_size,
|
|
unsigned char **receive_buffer, unsigned int *receive_buffer_size,
|
|
unsigned int timeout,
|
|
unsigned char **image_buffer, unsigned int *image_buffer_size);
|
|
|
|
#endif /* !defined(CAMLIBS_KONICA_LOWLEVEL_H) */
|