23 #include "../libsheepyObject.h" 27 #define internal static 137 self->type =
"smallDouble";
145 self->f = smallDoubleF;;
203 #if (recycleContainers) 220 #if (recycleContainers) 291 s = malloc(256*
sizeof(
char));
295 snprintf(s,256,
"%e", self->value->value);
320 #if (NFreeStackCheck) 323 register u64 rsp
asm(
"rsp");
324 if ((
u64)*
self > rsp) {
325 logW(
"Probably trying to free a smallDouble on stack: "BLD PRIx64
RST" sp: "BLD PRIx64
RST, *
self, rsp);
329 #if (recycleContainers) 343 #if (recycleContainers) 365 return(self->value->value);
374 self->value->value =
value;
385 self->value->value = (double)p2;
396 self->value->value = (double)p2;
407 self->value->value = (double)p2;
418 self->value->value = (double)p2;
429 self->value->value = (double)p2;
455 value = p2->
f->get(p2);
461 self->value->value = (double)value;
476 self->value->value = p2->
f->get(p2);
491 self->value->value = (double)p2->
f->get(p2);
504 if (!type ||
eqS(type,
"undefined") ||
eqS(type,
"dict") ||
eqS(type,
"array")) {
508 if (
eqS(type,
"bool")) {
511 else if (
eqS(type,
"double")) {
514 else if (
eqS(type,
"int")) {
517 else if (
eqS(type,
"string")) {
543 return(&(self->value->value));
560 return(self->value->value == value);;
565 if (!self->value || !p2) {
575 return(self->value->value == value);;
580 if (!self->value || !p2) {
594 if (self->value->value == value) {
611 return(self->value->value == p2);;
620 return(self->value->value == p2);;
629 return(self->value->value == p2);;
638 return(self->value->value == p2);;
647 return(self->value->value == p2);;
656 return(self->value->value == p2);;
661 if (!self->value || !p2 || !p2->
value) {
665 return(self->value->value == p2->
value->
value);;
670 if (!self->value || !p2 || !p2->
B) {
694 return(p2Value == self->value->value);;
700 if (!self->value || !p2 || !p2->
value) {
704 return(self->value->value == p2->
value->
value);;
709 if (!self->value || !p2 || !p2->
value) {
713 return(self->value->value == p2->
value->
value);;
726 return(p2->
f->equalSmallDouble(p2,
self));
731 if (!self->value || !p2 || !p2->
data) {
741 return(self->value->value == value);;
749 if (!filePath ||
isBlankS(filePath)) {
757 f = fopen(filePath,
"r");
760 shEPrintfS(
"The path was: \"%s\"\n", filePath);
763 readStatus = fread(&self->value->value, 1,
sizeof(
double) , f);
766 if (readStatus !=
sizeof(
double)) {
768 shEPrintfS(
"The path was: \"%s\"\n", filePath);
787 if (!
eqS(type,
"string")) {
819 readStatus = fread(&self->value->value, 1,
sizeof(
double) , fp);
821 if (readStatus !=
sizeof(
double)) {
834 if (!filePath ||
isBlankS(filePath) || !self->value) {
838 f = fopen(filePath,
"w");
841 shEPrintfS(
"The path was: \"%s\"\n", filePath);
844 writeStatus = fwrite(&self->value->value, 1,
sizeof(
double) , f);
847 if (writeStatus !=
sizeof(
double)) {
849 shEPrintfS(
"The path was: \"%s\"\n", filePath);
868 if (!
eqS(type,
"string")) {
892 if (!fp || !self->value) {
896 writeStatus = fwrite(&self->value->value, 1,
sizeof(
double) , fp);
898 if (writeStatus !=
sizeof(
double)) {
911 if (!filePath ||
isBlankS(filePath) || !self->value) {
915 f = fopen(filePath,
"a");
918 shEPrintfS(
"The path was: \"%s\"\n", filePath);
921 writeStatus = fwrite(&self->value->value, 1,
sizeof(
double) , f);
924 if (writeStatus !=
sizeof(
double)) {
926 shEPrintfS(
"The path was: \"%s\"\n", filePath);
945 return(self->f->duplicate(
self));
952 return(self->f->get(
self));
957 return(self->f->setBool(
self, p2));
962 return(self->f->set(
self, p2));
967 return(self->f->setInt64(
self, p2));
972 return(self->f->setInt32(
self, p2));
977 return(self->f->setUint32(
self, p2));
982 return(self->f->setUint64(
self, p2));
987 return(self->f->setS(
self, p2));
992 return(self->f->setSmallBool(
self, p2));
997 return(self->f->setSmallDouble(
self, p2));
1002 return(self->f->setSmallInt(
self, p2));
1007 return(self->f->setSmallJson(
self, p2));
1012 return(self->f->setSmallString(
self, p2));
1018 return(self->f->getP(
self));
1023 return(self->f->equalCha(
self, p2));
1028 return(self->f->equalChar(
self, p2));
1033 return(self->f->equalBase(
self, p2));
1038 return(self->f->equalBool(
self, p2));
1043 return(self->f->equalDouble(
self, p2));
1048 return(self->f->equalInt64(
self, p2));
1053 return(self->f->equalInt32(
self, p2));
1058 return(self->f->equalUint32(
self, p2));
1063 return(self->f->equalUint64(
self, p2));
1068 return(self->f->equalSmallBool(
self, p2));
1073 return(self->f->equalSmallBytes(
self, p2));
1078 return(self->f->equal(
self, p2));
1083 return(self->f->equalSmallInt(
self, p2));
1088 return(self->f->equalSmallJson(
self, p2));
1093 return(self->f->equalSmallString(
self, p2));
1098 return(self->f->readFile(
self, filePath));
1103 return(self->f->readFileSmallJson(
self,filePath));
1108 return(self->f->readFileSmallString(
self,filePath));
1113 return(self->f->readStream(
self, fp));
1118 return(self->f->writeFile(
self, filePath));
1123 return(self->f->writeFileSmallJson(
self,filePath));
1128 return(self->f->writeFileSmallString(
self,filePath));
1133 return(self->f->writeStream(
self, fp));
1138 return(self->f->appendFile(
self, filePath));
1143 return(self->f->appendFileSmallString(
self,filePath));
#define getTopDoubleO(self)
smallDoublet * readFileSmallDoubleG(smallDoublet *self, const char *filePath)
internal bool equalSmallDoubleSmallBool(smallDoublet *self, smallBoolt *p2)
#define getTopBoolO(self)
bool eqS(const char *string1, const char *string2)
string Equal compare string1 to string2
internal int appendFileSmallDouble(smallDoublet *self, const char *filePath)
bool isBlankS(const char *string)
is Blank String
bool equalSmallDoubleSmallBoolG(smallDoublet *self, smallBoolt *p2)
bool equalSmallDoubleBoolG(smallDoublet *self, bool p2)
internal smallDoublet * setBoolSmallDouble(smallDoublet *self, bool p2)
internal smallDoublet * setSmallDoubleSmallDouble(smallDoublet *self, smallDoublet *p2)
int writeFileSmallJsonSmallDoubleG(smallDoublet *self, smallJsont *filePath)
#define ssGet(obj)
get a pointer to the string in the smallString object
#define rangeDown(index, maxCount)
range down loop, index is ssize_t
internal bool equalSmallDoubleSmallString(smallDoublet *self, smallStringt *p2)
internal int writeFileSmallJsonSmallDouble(smallDoublet *self, smallJsont *filePath)
internal smallDoublet * setUint64SmallDouble(smallDoublet *self, uint64_t p2)
#define RST
reset for color function
int writeStreamSmallDoubleG(smallDoublet *self, FILE *fp)
internal bool equalSmallDoubleInt64(smallDoublet *self, int64_t p2)
toStringSmallDoubleFt toString
internal smallDoublet * readFileSmallStringSmallDouble(smallDoublet *self, smallStringt *filePath)
internal bool equalSmallDoubleDouble(smallDoublet *self, double p2)
internal double getSmallDouble(smallDoublet *self)
duplicateSmallDoubleFt duplicate
bool equalSmallDoubleSmallJsonG(smallDoublet *self, smallJsont *p2)
void initiateAllocateSmallDouble(smallDoublet **self)
bool equalSmallDoubleFG(smallDoublet *self, smallDoublet *p2)
smallDoublet * readStreamSmallDoubleG(smallDoublet *self, FILE *fp)
int appendFileSmallStringSmallDoubleG(smallDoublet *self, smallStringt *filePath)
#define pFuncError
print function name and system error
internal smallDoublet * setInt32SmallDouble(smallDoublet *self, int32_t p2)
internal bool equalSmallDoubleUint32(smallDoublet *self, uint32_t p2)
smallDoublet * setSmallJsonSmallDoubleG(smallDoublet *self, smallJsont *p2)
double getDoubleSmallDoubleG(smallDoublet *self, double retType UNUSED, int64_t index UNUSED)
int appendFileSmallDoubleFG(smallDoublet *self, const char *filePath)
bool equalSmallDoubleSmallBytesG(smallDoublet *self, smallBytest *p2)
void cleanUpSmallDoubleFreeLocalG(smallDoublet *val)
internal smallDoublet * setSmallIntSmallDouble(smallDoublet *self, smallIntt *p2)
internal double * getPSmallDouble(smallDoublet *self)
bool equalSmallDoubleSmallIntG(smallDoublet *self, smallIntt *p2)
#define isError(assigned, left)
is Assigment Error catch error when assigned is false, 0 or NULL after being assigned with left ...
smallDoublet * setSmallStringSmallDoubleG(smallDoublet *self, smallStringt *p2)
internal bool equalSmallDoubleInt32(smallDoublet *self, int32_t p2)
internal void smashSmallDouble(smallDoublet **self)
void registerMethodsSmallDouble(smallDoubleFunctionst *f)
internal int appendFileSmallStringSmallDouble(smallDoublet *self, smallStringt *filePath)
internal void terminateSmallDouble(smallDoublet **self)
#define getTopTypeO(self)
#define isOSmallJson(obj)
test if obj type is smallJson
internal int writeFileSmallStringSmallDouble(smallDoublet *self, smallStringt *filePath)
smallDoublet * readFileSmallStringSmallDoubleG(smallDoublet *self, smallStringt *filePath)
smallDoublet * setSmallBoolSmallDoubleG(smallDoublet *self, smallBoolt *p2)
void finalizeSmallDouble(void)
#define terminateO(obj)
free buffers and obj itself
internal int writeFileSmallDouble(smallDoublet *self, const char *filePath)
bool equalSmallDoubleSmallStringG(smallDoublet *self, smallStringt *p2)
smallDoublet * setUint32SmallDoubleG(smallDoublet *self, uint32_t p2)
bool equalSmallDoubleInt32G(smallDoublet *self, int32_t p2)
internal smallDoublet * setSmallJsonSmallDouble(smallDoublet *self, smallJsont *p2)
smallDoublet * setBoolSmallDoubleG(smallDoublet *self, bool p2)
void cleanUpSmallDoubleFreeG(smallDoublet **val)
void initiateSmallDouble(smallDoublet *self)
smallDoublet * setSmallIntSmallDoubleG(smallDoublet *self, smallIntt *p2)
internal smallDoublet * setSmallStringSmallDouble(smallDoublet *self, smallStringt *p2)
internal int writeStreamSmallDouble(smallDoublet *self, FILE *fp)
internal bool equalSmallDoubleBool(smallDoublet *self, bool p2)
internal void freeSmallDouble(smallDoublet *self)
smallDoublet * setSSmallDoubleG(smallDoublet *self, const char *p2)
bool equalSmallDoubleCharG(smallDoublet *self, const char *p2)
void cleanUpSmallDoubleTerminateG(smallDoublet **val)
#define parseDoubleO(self)
internal smallDoublet * setSSmallDouble(smallDoublet *self, const char *p2)
smallDoublet * setInt64SmallDoubleG(smallDoublet *self, int64_t p2)
#define toStringO(obj)
convert data in obj to string
bool isNumber(const char *string)
is Number (integer or float) String
internal void finishSmallDouble(smallDoublet **self)
internal smallDoublet * duplicateSmallDouble(smallDoublet *self)
smallDoublet * duplicateSmallDoubleG(smallDoublet *self)
internal const char * helpSmallDouble(smallDoublet UNUSED *self)
internal smallDoublet * readFileSmallJsonSmallDouble(smallDoublet *self, smallJsont *filePath)
smallDoublet * setSmallDoubleSmallDoubleG(smallDoublet *self, smallDoublet *p2)
bool equalSmallDoubleDoubleG(smallDoublet *self, double p2)
internal smallDoublet * setUint32SmallDouble(smallDoublet *self, uint32_t p2)
bool isInt(const char *string)
is Integer String
finishSmallDoubleFt finish
bool equalSmallDoubleChaG(smallDoublet *self, char p2)
void * sBytesGet(sBytest *bytes)
get buffer in small bytes
double parseDouble(const char *string)
convert string to double
sDoublet * allocSDouble(double value)
allocate a small double
internal bool equalSmallDoubleSmallInt(smallDoublet *self, smallIntt *p2)
#define BLD
bold for color function
smallDoublet * setUint64SmallDoubleG(smallDoublet *self, uint64_t p2)
void finalizeRecycleSmallDouble(void *arg UNUSED)
int writeFileSmallStringSmallDoubleG(smallDoublet *self, smallStringt *filePath)
bool equalSmallDoubleUint32G(smallDoublet *self, uint32_t p2)
createAllocateSmallDouble(jDouble)
bool equalSmallDoubleUint64G(smallDoublet *self, uint64_t p2)
internal bool equalSmallDouble(smallDoublet *self, smallDoublet *p2)
internal bool equalSmallDoubleChar(smallDoublet *self, const char *p2)
internal bool equalSmallDoubleCha(smallDoublet *self, char p2)
smallDoublet * setSmallDoubleG(smallDoublet *self, double p2)
internal smallDoublet * readStreamSmallDouble(smallDoublet *self, FILE *fp)
internal bool equalSmallDoubleUint64(smallDoublet *self, uint64_t p2)
void freeSmallDoubleG(smallDoublet *self)
#define helpTextSmallDouble
help text for this class It is public declaration so that child classes can add their help text easil...
internal bool equalSmallDoubleBase(smallDoublet *self, baset *p2)
terminateSmallDoubleFt terminate
smallDoublet * allocSmallDouble(double value)
void shEPrintfS(const char *fmt,...)
sheepy Error printf String print with logE
void cleanUpSmallDoubleFinishG(smallDoublet **val)
internal smallDoublet * setSmallDouble(smallDoublet *self, double value)
#define freeO(obj)
free buffers in obj
internal bool equalSmallDoubleSmallBytes(smallDoublet *self, smallBytest *p2)
internal bool equalSmallDoubleSmallJson(smallDoublet *self, smallJsont *p2)
internal smallDoublet * readFileSmallDouble(smallDoublet *self, const char *filePath)
internal smallDoublet * setInt64SmallDouble(smallDoublet *self, int64_t p2)
int writeFileSmallDoubleG(smallDoublet *self, const char *filePath)
smallDoublet * setInt32SmallDoubleG(smallDoublet *self, int32_t p2)
internal smallDoublet * setSmallBoolSmallDouble(smallDoublet *self, smallBoolt *p2)
bool equalSmallDoubleBaseG(smallDoublet *self, baset *p2)
smallDoublet * readFileSmallJsonSmallDoubleG(smallDoublet *self, smallJsont *filePath)
#define finishO(obj)
free container only
internal char * toStringSmallDouble(smallDoublet *self)
smallDoubleFunctionst * f
bool equalSmallDoubleInt64G(smallDoublet *self, int64_t p2)
double * getDoublePSmallDoubleG(smallDoublet *self, double *retType UNUSED, int64_t index UNUSED)
#define isOSmallString(obj)
test if obj type is smallString