Browse Source

AP_HAL_Linux: document functions to write file

Document function and add attributes to mark then as printf- and
scanf-like functions.
master
Lucas De Marchi 9 years ago committed by Andrew Tridgell
parent
commit
392879112e
  1. 17
      libraries/AP_HAL_Linux/Util.h

17
libraries/AP_HAL_Linux/Util.h

@ -2,7 +2,9 @@
#ifndef __AP_HAL_LINUX_UTIL_H__ #ifndef __AP_HAL_LINUX_UTIL_H__
#define __AP_HAL_LINUX_UTIL_H__ #define __AP_HAL_LINUX_UTIL_H__
#include <AP_Common/AP_Common.h>
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#include "AP_HAL_Linux_Namespace.h" #include "AP_HAL_Linux_Namespace.h"
#include "ToneAlarmDriver.h" #include "ToneAlarmDriver.h"
@ -40,8 +42,19 @@ public:
uint32_t available_memory(void) override; uint32_t available_memory(void) override;
int write_file(const char *path, const char *fmt, ...); /*
int read_file(const char *path, const char *fmt, ...); * Write a string as specified by @fmt to the file in @path. Note this
* should not be used on hot path since it will open, write and close the
* file for each call.
*/
int write_file(const char *path, const char *fmt, ...) FORMAT(3, 4);
/*
* Read a string as specified by @fmt from the file in @path. Note this
* should not be used on hot path since it will open, read and close the
* file for each call.
*/
int read_file(const char *path, const char *fmt, ...) FMT_SCANF(3, 4);
private: private:
static Linux::ToneAlarm _toneAlarm; static Linux::ToneAlarm _toneAlarm;

Loading…
Cancel
Save