GRU - Generic Reusable Utilities
Loading...
Searching...
No Matches
Macros | Functions
gru_base.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
#include <unistd.h>
#include <sys/types.h>
#include "gru_portable.h"

Go to the source code of this file.

Macros

#define GRU_OPT_MAX_STR_SIZE   256
 Copyright 2016 Otavio Rodolfo Piske. More...
 
#define GRU_OPT_MAX_STR_SIZE_MASK   "%256s"
 
#define GRU_OPT_MAX_CHAR_SIZE_MASK   "%256c"
 

Functions

gru_export const char * gru_base_app_home (const char *appname)
 Returns the base directory for the application given an application name For Unix-like, that would be: $HOME/.appname. More...
 

Macro Definition Documentation

◆ GRU_OPT_MAX_CHAR_SIZE_MASK

#define GRU_OPT_MAX_CHAR_SIZE_MASK   "%256c"

◆ GRU_OPT_MAX_STR_SIZE

#define GRU_OPT_MAX_STR_SIZE   256

Copyright 2016 Otavio Rodolfo Piske.

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.

◆ GRU_OPT_MAX_STR_SIZE_MASK

#define GRU_OPT_MAX_STR_SIZE_MASK   "%256s"

Function Documentation

◆ gru_base_app_home()

gru_export const char * gru_base_app_home ( const char *  appname)

Returns the base directory for the application given an application name For Unix-like, that would be: $HOME/.appname.

Parameters
appnameApplication name
Returns
a pointer to a static buffer that will be automatically free'd at exit