Skip to content

Commit

Permalink
Stacks and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ajamaica committed Mar 15, 2012
1 parent 183972a commit 19e064b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
4 changes: 4 additions & 0 deletions FSm.xcodeproj/project.pbxproj
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
06B2521D14E7802B0066C1B3 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 06B2521C14E7802B0066C1B3 /* main.c */; };
06B2521F14E7802B0066C1B3 /* FSm.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 06B2521E14E7802B0066C1B3 /* FSm.1 */; };
06D171151511D17C00AEEFB1 /* stack_MemoriaDinamica.c in Sources */ = {isa = PBXBuildFile; fileRef = 06D171141511D17C00AEEFB1 /* stack_MemoriaDinamica.c */; };
06EADF4514E845D700BABBA5 /* File.c in Sources */ = {isa = PBXBuildFile; fileRef = 06EADF4414E845D700BABBA5 /* File.c */; };
/* End PBXBuildFile section */

Expand All @@ -31,6 +32,7 @@
06B2521814E7802B0066C1B3 /* FSm */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = FSm; sourceTree = BUILT_PRODUCTS_DIR; };
06B2521C14E7802B0066C1B3 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
06B2521E14E7802B0066C1B3 /* FSm.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = FSm.1; sourceTree = "<group>"; };
06D171141511D17C00AEEFB1 /* stack_MemoriaDinamica.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stack_MemoriaDinamica.c; sourceTree = "<group>"; };
06EADF4414E845D700BABBA5 /* File.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = File.c; sourceTree = "<group>"; };
7ED0A64714E84A5E00DE7E0C /* header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = header.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -67,6 +69,7 @@
children = (
069C8448150D7DBA0070C0E7 /* TABLA_LL.txt */,
06EADF4414E845D700BABBA5 /* File.c */,
06D171141511D17C00AEEFB1 /* stack_MemoriaDinamica.c */,
06B2521C14E7802B0066C1B3 /* main.c */,
06B2521E14E7802B0066C1B3 /* FSm.1 */,
7ED0A64714E84A5E00DE7E0C /* header.h */,
Expand Down Expand Up @@ -127,6 +130,7 @@
files = (
06B2521D14E7802B0066C1B3 /* main.c in Sources */,
06EADF4514E845D700BABBA5 /* File.c in Sources */,
06D171151511D17C00AEEFB1 /* stack_MemoriaDinamica.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions FSm/main.c
@@ -1,6 +1,10 @@
#include "Token.h"
#include "stack_MemoriaDinamica.c"

int main(int argc, char const *argv[]){
struct stack mi_stack;

init(&mi_stack);

if(argc == 2){

Expand Down
18 changes: 0 additions & 18 deletions FSm/stack_MemoriaDinamica.c
Expand Up @@ -60,21 +60,3 @@ void pop(struct stack *s){
free(p);
}

int main (int argc, char const *argv[]){
int i;
struct stack mi_stack;

init(&mi_stack);
for(i = 0; i < 10; i++){
printf("Agregando %i\n", i);
push(&mi_stack, i);
}

printf("\nis_empty? %i\n\n", is_empty(&mi_stack));
for(; i > 0; i--){
printf("El elemento tope es %i\n", top(&mi_stack));
pop(&mi_stack);
}

return 0;
}

0 comments on commit 19e064b

Please sign in to comment.