aboutsummaryrefslogtreecommitdiff
path: root/src/presentation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/presentation.c')
-rw-r--r--src/presentation.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/src/presentation.c b/src/presentation.c
index 3ec00e3..1c822c4 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -149,61 +149,6 @@ int save_presentation(struct presentation *p, const char *filename)
}
-static char *fgets_long(FILE *fh, size_t *lp)
-{
- char *line;
- size_t la;
- size_t l = 0;
-
- la = 1024;
- line = malloc(la);
- if ( line == NULL ) return NULL;
-
- do {
-
- int r;
-
- r = fgetc(fh);
- if ( r == EOF ) {
- if ( l == 0 ) {
- free(line);
- *lp = 0;
- return NULL;
- } else {
- line[l++] = '\0';
- *lp = l;
- return line;
- }
- }
-
- line[l++] = r;
-
- if ( r == '\n' ) {
- line[l++] = '\0';
- *lp = l;
- return line;
- }
-
- if ( l == la ) {
-
- char *ln;
-
- la += 1024;
- ln = realloc(line, la);
- if ( ln == NULL ) {
- free(line);
- *lp = 0;
- return NULL;
- }
-
- line = ln;
-
- }
-
- } while ( 1 );
-}
-
-
int slide_number(struct presentation *p, SCBlock *sl)
{
SCBlock *bl = p->scblocks;
@@ -313,40 +258,6 @@ SCBlock *prev_slide(struct presentation *p, SCBlock *sl)
}
-char *load_everything(const char *filename)
-{
- FILE *fh;
- size_t el = 1;
- char *everything = strdup("");
-
- fh = fopen(filename, "r");
- if ( fh == NULL ) return NULL;
-
- while ( !feof(fh) ) {
-
- size_t len = 0;
- char *line = fgets_long(fh, &len);
-
- if ( line != NULL ) {
-
- everything = realloc(everything, el+len);
- if ( everything == NULL ) {
- fprintf(stderr, "Failed to allocate memory\n");
- return NULL;
- }
- el += len;
-
- strcat(everything, line);
- }
-
- }
-
- fclose(fh);
-
- return everything;
-}
-
-
int replace_stylesheet(struct presentation *p, SCBlock *ss)
{
/* Create style sheet from union of old and new,