Lely core libraries
2.2.5
|
#include "co.h"
#include <lely/co/sdev.h>
#include <lely/libc/stdio.h>
#include <lely/util/errnum.h>
#include <lely/util/lex.h>
#include <lely/util/print.h>
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
#include <lely/co/def/type.def>
Go to the source code of this file.
Functions | |
co_dev_t * | co_dev_create_from_sdev (const struct co_sdev *sdev) |
Creates a CANopen device from a static device description. More... | |
int | snprintf_c99_sdev (char *s, size_t n, const co_dev_t *dev) |
Prints a C99 static initializer code fragment for a static device description (struct co_sdev) to a string buffer. More... | |
int | asprintf_c99_sdev (char **ps, const co_dev_t *dev) |
Equivalent to snprintf_c99_sdev(), except that it allocates a string large enough to hold the output, including the terminating null byte. More... | |
This file is part of the CANopen library; it contains the implementation of the static device description functions.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file sdev.c.
Creates a CANopen device from a static device description.
int snprintf_c99_sdev | ( | char * | s, |
size_t | n, | ||
const co_dev_t * | dev | ||
) |
Prints a C99 static initializer code fragment for a static device description (struct co_sdev) to a string buffer.
s | the address of the output buffer. If s is not NULL, at most n - 1 characters are written, plus a terminating null byte. |
n | the size (in bytes) of the buffer at s. If n is zero, nothing is written. |
dev | a pointer to a CANopen device description to be printed. |
errno
. int asprintf_c99_sdev | ( | char ** | ps, |
const co_dev_t * | dev | ||
) |
Equivalent to snprintf_c99_sdev(), except that it allocates a string large enough to hold the output, including the terminating null byte.
ps | the address of a value which, on success, contains a pointer to the allocated string. This pointer SHOULD be passed to free() to release the allocated storage. |
dev | a pointer to a CANopen device description to be printed. |
errno
.