Skip to content

Instantly share code, notes, and snippets.

#include "sdk30.h"
#include "ip_.h"
int logSockData(char* data, int Size, struct sockaddr_in *from);
int isMoreLogSize(int size);
int openLogFile(void);
static struct sockaddr_in server, socaddr_tmp;
static struct sockaddr_in client_cash;
#!/bin/sh
#
# Script name: setup_codesourcery.sh
# Version: 2.2 - 2012-07-19
#
# Copyright (C) 2009-2012 Matthias "Maddes" Buecher
#
#
void ValToAmount(char pdPriceStr[14], unsigned long int pdPrice) {
unsigned char iLen = 0;
char amountFormat[14] = { '0', '0', '.', '0', '0', '0', '.', '0', '0', '0', ',', '0', '0', '\0'};
unsigned char pdPricePrime = 0;
memset(pdPriceStr, 0, NUMBER_OF_ITEMS(amountFormat));
iLen = strlen(amountFormat);
pdPricePrime = pdPrice % 10;
pdPrice /= 10;
while ((pdPrice != 0 || pdPricePrime > 0) && iLen > 0){
if (amountFormat[iLen - 1] == ',' || amountFormat[iLen - 1] == '.'){
@peanutwolf
peanutwolf / Linked List
Created February 12, 2015 20:26
Linux Linked List _ no external headers
/**
*
* I grub it from linux kernel source code and fix it for user space
* program. Of course, this is a GPL licensed header file.
*
* Here is a recipe to cook list.h for user space program
*
* 1. copy list.h from linux/include/list.h
* 2. remove
* - #ifdef __KERNE__ and its #endif
#include <iostream>
using namespace std;
struct Rational
{
Rational(int numerator = 0, int denominator = 1)
:numerator_(numerator), denominator_(denominator){};
void add(Rational rational){
#include </home/peanutwolf/Документы/myKIPP/RingBuffer.h>
void buf_push_char(char data){
if(buf_pointer<=90){
RING_BUFFER[buf_pointer] = data;
buf_pointer++;
}
else{
return;
}