Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/misp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6707cd1
Choose a base ref
...
head repository: m-labs/misp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9c84387
Choose a head ref
  • 5 commits
  • 6 files changed
  • 1 contributor

Commits on Jun 2, 2012

  1. libglue: some file ops

    Sebastien Bourdeauducq committed Jun 2, 2012
    Copy the full SHA
    54d5f19 View commit details
  2. Makefile: netboot convenience target

    Sebastien Bourdeauducq committed Jun 2, 2012
    Copy the full SHA
    53fb860 View commit details
  3. libglue: asprintf

    Sebastien Bourdeauducq committed Jun 2, 2012
    Copy the full SHA
    6c4824e View commit details
  4. libglue: fprintf

    Sebastien Bourdeauducq committed Jun 2, 2012
    Copy the full SHA
    c4aa518 View commit details
  5. style

    Sebastien Bourdeauducq committed Jun 2, 2012
    Copy the full SHA
    9c84387 View commit details
Showing with 359 additions and 57 deletions.
  1. +4 −1 Makefile
  2. +2 −2 libglue/Makefile
  3. +47 −0 libglue/asprintf.c
  4. +238 −54 libglue/file.c
  5. +9 −0 libglue/include/asprintf.h
  6. +59 −0 libglue/yaffs.c
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -40,4 +40,7 @@ clean:
make -C $(MISPDIR)/lib$$lib clean; \
done

.PHONY: clean libs
netboot: misp.bin
cp misp.bin /var/lib/tftpboot/boot.bin

.PHONY: clean libs netboot
4 changes: 2 additions & 2 deletions libglue/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MISPDIR=..
include $(MISPDIR)/common.mak

CFLAGS+=-I$(YAFFSDIR)/direct -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_DEFINES_TYPES -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
OBJECTS=file.o getenv.o
CFLAGS+=-I$(YAFFSDIR)/direct -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_DEFINES_TYPES -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES -I$(MISPDIR)/libglue/include
OBJECTS=yaffs.o asprintf.o file.o getenv.o

all: libglue.a

47 changes: 47 additions & 0 deletions libglue/asprintf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <asprintf.h>

int vasprintf(char **strp, const char *fmt, va_list ap)
{
va_list aq;
int alloclen;
int len;
char *newbuf;

alloclen = 256;
*strp = malloc(alloclen);
if(!*strp)
return -1;

while(1) {
va_copy(aq, ap);
len = vscnprintf(*strp, alloclen, fmt, aq);
va_end(aq);
if(len < 0) {
free(*strp);
return len;
}
if(len < alloclen)
return len;
alloclen *= 2;
newbuf = realloc(*strp, alloclen);
if(!newbuf) {
free(*strp);
return -1;
}
*strp = newbuf;
}
}

int asprintf(char **strp, const char *fmt, ...)
{
va_list args;
int len;

va_start(args, fmt);
len = vasprintf(strp, fmt, args);
va_end(args);
return len;
}
Loading